springfox

How to generate offline Swagger API docs?

我怕爱的太早我们不能终老 提交于 2019-12-18 12:16:59
问题 I have a spring boot MVC java Web app. I've been able to integrate Springfox for API documentation. I can visually see all of the APIs when server is up and running. How can I generate OFFLINE swagger API documentation? Note: I would not like to use asciidoc or markdown documentation, but I'd like the same swagger API user interface in html files. I'd like so that the links are relative to local directory instead of local host server links. Thanks 回答1: Springfox allows you to easily create a

How to generate offline Swagger API docs?

£可爱£侵袭症+ 提交于 2019-12-18 12:16:23
问题 I have a spring boot MVC java Web app. I've been able to integrate Springfox for API documentation. I can visually see all of the APIs when server is up and running. How can I generate OFFLINE swagger API documentation? Note: I would not like to use asciidoc or markdown documentation, but I'd like the same swagger API user interface in html files. I'd like so that the links are relative to local directory instead of local host server links. Thanks 回答1: Springfox allows you to easily create a

SpringFox Docket per controller not working in spring boot

送分小仙女□ 提交于 2019-12-18 07:23:40
问题 In my spring boot application, I have multiple Rest Controllers and need to generate swagger for each controller seperately. By using below Docket config for each controller in my spring boot application class, i am able to download controller specific swagger by going to /v2/api-docs?group=ai where i = 1 to n However in swagger-ui.html, when i select a1(/v2/api-docs?group=a1), it shows path as "/api/a1/a1", while selecting a2(/v2/api-docs?greoup=a2), it shows correct path i.e. /api/a2 I have

Using @RequestParam annotated method with swagger ui

蹲街弑〆低调 提交于 2019-12-18 01:52:53
问题 I am using Springfox libraries to generate documentation for REST service and display it in Swagger UI. I followed the directions in Springfox documentation. I have one controller, which uses parameters from query string and the method is mapped as following: @ApiOperation(value = "") @RequestMapping(method = GET, value = "/customcollection/{id}/data") public Iterable<CustomeType> getData(@ApiParam(value = "The identifier of the time series.") @PathVariable String id, @ApiParam(name =

springfox(swagger2) does not work with GsonHttpMessageConverterConfig

眉间皱痕 提交于 2019-12-18 01:21:23
问题 What I am trying to build is a spring-boot (v1.2.3) application and expose my Rest API with SpringFox(swagger2) v2.0.0 my Swagger Spring config @EnableSwagger2 @Configuration public class SwaggerConfig { @Bean public Docket myApi() { return new Docket(DocumentationType.SWAGGER_2) .genericModelSubstitutes(DeferredResult.class) .useDefaultResponseMessages(false) .forCodeGeneration(false) .pathMapping("/my-prj"); } } I need to use gson to convert my pojo's to json, and I do it this way:

swagger @ApiModelProperty example value for List<String> property

≯℡__Kan透↙ 提交于 2019-12-17 22:45:30
问题 I have one class in which there is one property which is List<String> public class MyClass { .... @ApiModelProperty(position = 2) private List<String> productIdentifiers; .... } This code generates the example values as following: { "customerId": "1001", "productIdentifiers": [ "string" ], "statuses": [ "NEW" ] } The example values here shown are not valid. My expected example values should be like : { "customerId": "1001", "productIdentifiers": [ "PRD1", "PRD2", "PRD3" ], "statuses": [ "NEW"

Swagger2接口文档功能

廉价感情. 提交于 2019-12-16 01:32:15
1、引入pom <!-- Swagger2接口文档 --> < dependency > < groupId > io.springfox </ groupId > < artifactId > springfox-swagger2 </ artifactId > < version > 2.9.2 </ version > </ dependency > < dependency > < groupId > io.springfox </ groupId > < artifactId > springfox-swagger-ui </ artifactId > < version > 2.9.2 </ version > </ dependency > < dependency > < groupId > com.github.xiaoymin </ groupId > < artifactId > swagger-bootstrap-ui </ artifactId > < version > 1.8.7 </ version > </ dependency > 2、配置类 package com . itennishy . ycweb . config ; import org . springframework . context . annotation . Bean ;

项目使用swagger定义接口

人盡茶涼 提交于 2019-12-14 11:23:19
pom.xml <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.4.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.4.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.4.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.4.0</version> <scope>compile</scope

Using Springfox to document jax-rs services in a Spring app

不羁岁月 提交于 2019-12-14 01:26:14
问题 I want to document the API of an existing app using Springfox. I added these dependencies to pom.xml: <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.2.2</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.2.2</version> </dependency> I've added the swagger package to the jersey packages in web.xml so that Swagger2Controller is picked up: <?xml version="1.0" encoding=

SpringBoot集成Swagger(Swagger的使用),生成接口文档,方便前后端分离开发

橙三吉。 提交于 2019-12-13 10:38:20
首先上一张成果图。 1、Maven依赖 <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.7.0</version> </dependency> <!-- swagger-ui 用于查看的 --> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.7.0</version> </dependency> 2、需要自定义一个配置类,然后添加到Spring容器中。 import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders