springfox

Whitelabel Error Page Swagger, This application has no explicit mapping for /error, so you are seeing this as a fallback swagger2:3.0.0-SNAPSHOT

只愿长相守 提交于 2020-07-23 06:24:54
问题 Trying to configure swagger in spring boot 2.3.1. Gradle Config repositories { mavenCentral() maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' } } dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-rest' testImplementation('org.springframework.boot:spring-boot-starter-test') { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' } implementation "io.springfox:springfox-boot-starter:3.0.0-SNAPSHOT" compile('io.springfox:springfox

Whitelabel Error Page Swagger, This application has no explicit mapping for /error, so you are seeing this as a fallback swagger2:3.0.0-SNAPSHOT

蓝咒 提交于 2020-07-23 06:24:03
问题 Trying to configure swagger in spring boot 2.3.1. Gradle Config repositories { mavenCentral() maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' } } dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-rest' testImplementation('org.springframework.boot:spring-boot-starter-test') { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' } implementation "io.springfox:springfox-boot-starter:3.0.0-SNAPSHOT" compile('io.springfox:springfox

Whitelabel Error Page Swagger, This application has no explicit mapping for /error, so you are seeing this as a fallback swagger2:3.0.0-SNAPSHOT

﹥>﹥吖頭↗ 提交于 2020-07-23 06:23:14
问题 Trying to configure swagger in spring boot 2.3.1. Gradle Config repositories { mavenCentral() maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' } } dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-rest' testImplementation('org.springframework.boot:spring-boot-starter-test') { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' } implementation "io.springfox:springfox-boot-starter:3.0.0-SNAPSHOT" compile('io.springfox:springfox

Configure security schemas and contexts in Springfox and Spring MVC

浪尽此生 提交于 2020-07-18 11:43:36
问题 I have simple REST services implemented with Spring MVC. I decided to describe them with Springfox and Swagger 2.0. Everything seemed to be OK until I started adding security schemas and contexts. I use HTTP Basic authentication for certain endpoints and token-based authentication for others. Whatever I do, I cannot see any option to set HTTP Basic authentication credentials or to specify a token in Swagger UI. Below is my configuration. For simplicity's sake I apply both schemas to all

swagger annotation content-type not set

杀马特。学长 韩版系。学妹 提交于 2020-06-27 07:35:28
问题 I have this spring rest controller: @RestController @RequestMapping("/communications") class CommunicationController(private val service: CommunicationService) { @ApiOperation( produces = APPLICATION_JSON_VALUE, consumes = APPLICATION_JSON_VALUE ) @GetMapping( consumes = [APPLICATION_JSON_VALUE], produces = [APPLICATION_JSON_VALUE] ) fun findAll( criterias: CommunicationCriterias, page: Pageable ): List<CommunicationDTO> = service.findCommunications(criterias, page) } When I test this

Does springfox-swagger2 UI support choosing multiple files at once?

主宰稳场 提交于 2020-06-16 08:31:33
问题 I use Spring Boot and integrated swagger-ui (springfox-swagger2) and I want to be able to choose to upload multiple files at once. Unfortunately the Swagger UI doesn't appear to allow this, at least not give my controller method. My controller method signature: @ApiOperation( value = "batch upload goods cover image", notes = "batch upload goods cover image", response = UploadCoverResultDTO.class, responseContainer = "List" ) public Result<?> uploadGoodsCover(@ApiParam(value = "Image array",

How to customize the value of operationId generated in api spec with swagger?

回眸只為那壹抹淺笑 提交于 2020-06-12 04:31:06
问题 I have configured my spring project using springfox 2.0. I am able to generate the open api spec with it. "paths": { "/test/testinfo": { "post": { "tags": [ "test-controller" ], "summary": "getTestInfo", "operationId": "getTestInfoInfoUsingGET", "consumes": [ "application/json" ], "produces": [ "application/json" ] As you can see the value of operationId is of format [java_method_name_here]Using[HTTP_verb_here] ex. getPetsUsingGET This operationId is used while generating clients using

Generate swagger JSON file at compile time for springfox based project

拜拜、爱过 提交于 2020-05-13 05:07:16
问题 I have working project which is using springfox to generate API documentations. I want to generate swagger.json at compile time . following is sample springfox configuration, @Configuration @EnableSwagger2 public class SwaggerConfig { @Bean public Docket productApi() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(RequestHandlerSelectors.basePackage("com.abc.xyz")) .paths(regex("/*.*")) .build(); } } FYI : I have also tried https://github.com/kongchen/swagger-maven-plugin

spring整合swagger报错NoSuchMethodError: org.springframework.web.util.UriComponentsBuilder.fromHttpReq...

限于喜欢 提交于 2020-05-08 17:20:38
@参考博客 java.lang.NoSuchMethodError: org.springframework.web.util.UriComponentsBuilder.fromHttpRequest(Lorg/springframework/http/HttpRequest;)Lorg/springframework/web/util/UriComponentsBuilder; at springfox.documentation.swagger2.web.HostNamePr 原因:原因是spring-web版本不配对swagger2,UriComponentsBuilder内部方法找不到 解决办法:io.springfox俩个包若是2.7.0的版本,spring-web包的版本至少要4.1.6。搭配使用,要么spring整体升级版本,要么swagger降版本。 来源: oschina 链接: https://my.oschina.net/u/4364008/blog/4270622

Springboot 系列(十六)你真的了解 Swagger 文档吗?

断了今生、忘了曾经 提交于 2020-05-06 09:47:33
前言 目前来说,在 Java 领域使用 Springboot 构建微服务是比较流行的,在构建微服务时,我们大多数会选择暴漏一个 REST API 以供调用。又或者公司采用前后端分离的开发模式,让前端和后端的工作由完全不同的工程师进行开发完成。不管是微服务还是这种前后端分离开发,维持一份完整的及时更新的 REST API 文档,会极大的提高我们的工作效率。而传统的文档更新方式(如手动编写),很难保证文档的及时性,经常会年久失修,失去应有的意义。因此选择一种新的 API 文档维护方式很有必要,这也是这篇文章要介绍的内容。 <!-- more --> 1. OpenAPI 规范介绍 OpenAPI Specification 简称 OAS,中文也称 OpenAPI 描述规范,使用 OpenAPI 文件可以描述整个 API,它制定了一套的适合通用的与语言无关的 REST API 描述规范,如 API 路径规范、请求方法规范、请求参数规范、返回格式规范等各种相关信息,使人类和计算机都可以不需要访问源代码就可以理解和使用服务的功能。 下面是 OpenAPI 规范中建议的 API 设计规范,基本路径设计规范。 https://api.example.com/v1/users?role=admin&status=active \________________________/\____/ \__