Skip to content

Commit 6542bb9

Browse files
committed
文档调整
1 parent 372461f commit 6542bb9

File tree

1 file changed

+26
-43
lines changed

1 file changed

+26
-43
lines changed

README.md

Lines changed: 26 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# 简介
22

3-
[![Build Status](https://travis-ci.org/dyc87112/spring-boot-starter-swagger.svg?branch=1.5.0)](https://travis-ci.org/dyc87112/spring-boot-starter-swagger)
4-
53
该项目主要利用Spring Boot的自动化配置特性来实现快速的将swagger2引入spring boot应用来生成API文档,简化原生使用swagger2的整合代码。
64

75
- 源码地址
@@ -34,7 +32,7 @@
3432
</dependency>
3533
```
3634

37-
**注意:从`1.6.1`开始,我们按Spring Boot官方建议修改了artifactId为`swagger-spring-boot-starter`,1.6.0之前的版本不做修改,依然为使用`spring-boot-starter-swagger` !**
35+
**注意:从`1.6.0`开始,我们按Spring Boot官方建议修改了artifactId为`swagger-spring-boot-starter`,1.6.0之前的版本不做修改,依然为使用`spring-boot-starter-swagger` !**
3836

3937
- 在应用主类中增加`@EnableSwagger2Doc`注解
4038

@@ -251,19 +249,34 @@ swagger.ui-config.submit-methods=get,delete
251249
swagger.ui-config.submit-methods=
252250
```
253251

254-
---
252+
- 其他配置
255253

256-
### 来自2018年的版本升级,欢呼吧,Coder们
254+
```properties
255+
# json编辑器
256+
swagger.ui-config.json-editor=false
257257

258-
> 2018-03-21 今日春分,细雨如风 `1.7.0` 版本诞生 @gumutianqi
258+
# 显示请求头
259+
swagger.ui-config.show-request-headers=true
259260

260-
#### UI升级到 2.8.0 版本 (1.7.0 + 支持)
261+
# 页面调试请求的超时时间
262+
swagger.ui-config.request-timeout=5000
263+
```
261264

262-
- 扁平化设计
263-
- 更加华丽
264-
- 更加易用
265-
- 可配置项更加自由
265+
### ignoredParameterTypes配置(1.6.0 + 支持)
266266

267+
```properties
268+
# 基础配置
269+
swagger.ignored-parameter-types[0]=com.didispace.demo.User
270+
swagger.ignored-parameter-types[1]=com.didispace.demo.Product
271+
272+
# 分组配置
273+
swagger.docket.aaa.ignored-parameter-types[0]=com.didispace.demo.User
274+
swagger.docket.aaa.ignored-parameter-types[1]=com.didispace.demo.Product
275+
```
276+
277+
> 该参数作用:
278+
> Q. Infinite loop when springfox tries to determine schema for objects with nested/complex constraints?
279+
> A. If you have recursively defined objects, I would try and see if providing an alternate type might work or perhaps even ignoring the offending classes e.g. order using the docket. ignoredParameterTypes(Order.class). This is usually found in Hibernate domain objects that have bidirectional dependencies on other objects.
267280
268281
### Authorization 鉴权配置 (1.7.0 + 支持)
269282

@@ -282,7 +295,7 @@ swagger.authorization.auth-regex=^.*$
282295

283296
备注:目前支持`ApiKey`鉴权模式,后续添加`Oauth2``BasicAuth`支持
284297

285-
##### 使用须知
298+
**使用须知**
286299

287300
> 1. 默认已经在全局开启了`global`的SecurityReferences,无需配置任何参数就可以使用;
288301
> 2. 全局鉴权的范围在可以通过以上参数`auth-regex`进行正则表达式匹配控制;
@@ -295,7 +308,7 @@ swagger.authorization.auth-regex=^.*$
295308
String hello();
296309
```
297310

298-
##### 关于如何配置实现鉴权,请关注以下code:
311+
**关于如何配置实现鉴权,请关注以下code:**
299312

300313
```java
301314
/**
@@ -337,36 +350,6 @@ private List<SecurityReference> defaultAuth() {
337350
}
338351
```
339352

340-
341-
- 其他配置
342-
343-
```properties
344-
# json编辑器
345-
swagger.ui-config.json-editor=false
346-
347-
# 显示请求头
348-
swagger.ui-config.show-request-headers=true
349-
350-
# 页面调试请求的超时时间
351-
swagger.ui-config.request-timeout=5000
352-
```
353-
354-
### ignoredParameterTypes配置(1.6.0 + 支持)
355-
356-
```properties
357-
# 基础配置
358-
swagger.ignored-parameter-types[0]=com.didispace.demo.User
359-
swagger.ignored-parameter-types[1]=com.didispace.demo.Product
360-
361-
# 分组配置
362-
swagger.docket.aaa.ignored-parameter-types[0]=com.didispace.demo.User
363-
swagger.docket.aaa.ignored-parameter-types[1]=com.didispace.demo.Product
364-
```
365-
366-
> 该参数作用:
367-
> Q. Infinite loop when springfox tries to determine schema for objects with nested/complex constraints?
368-
> A. If you have recursively defined objects, I would try and see if providing an alternate type might work or perhaps even ignoring the offending classes e.g. order using the docket. ignoredParameterTypes(Order.class). This is usually found in Hibernate domain objects that have bidirectional dependencies on other objects.
369-
370353
## 贡献者
371354

372355
- [程序猿DD-翟永超](https://github.com/dyc87112/)

0 commit comments

Comments
 (0)