-
Notifications
You must be signed in to change notification settings - Fork 520
1.4.0 增加全局参数配置 #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
1.4.0 增加全局参数配置 #16
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d747c1d
1.4.0 增加全局参数配置
renlulu 8b450a5
Create .travis.yml
d75587a
1.4.0 更新全局参数配置
renlulu 501229f
1.4.0 修改分组全局配置
renlulu 18ee982
Merge branch '1.4.0-xiaohou' of https://github.com/dyc87112/spring-bo…
renlulu 0d27195
1.4.0 修改readme文件
renlulu 3dd02c0
1.4.0 完善分组配置和文档
renlulu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: java | ||
|
||
jdk: | ||
- oraclejdk8 | ||
|
||
install: mvn install -DskipTests=true -Dmaven.javadoc.skip=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,16 @@ swagger.contact.email=dyc87112@qq.com | |
swagger.base-package=com.didispace | ||
swagger.base-path=/** | ||
swagger.exclude-path=/error, /ops/** | ||
swagger.globalOperationParameters[0].name=name one | ||
swagger.globalOperationParameters[0].description=some description one | ||
swagger.globalOperationParameters[0].modelRef=string | ||
swagger.globalOperationParameters[0].parameterType=header | ||
swagger.globalOperationParameters[0].required=true | ||
swagger.globalOperationParameters[1].name=name two | ||
swagger.globalOperationParameters[1].description=some description two | ||
swagger.globalOperationParameters[1].modelRef=string | ||
swagger.globalOperationParameters[1].parameterType=body | ||
swagger.globalOperationParameters[1].required=false | ||
``` | ||
|
||
## 配置说明 | ||
|
@@ -85,8 +95,14 @@ swagger.exclude-path=/error, /ops/** | |
- swagger.base-path=需要处理的基础URL规则,默认:/** | ||
- swagger.exclude-path=需要排除的URL规则,默认:空 | ||
- swagger.host=文档的host信息,默认:空 | ||
- swagger.globalOperationParameters[0].name=参数名 | ||
- swagger.globalOperationParameters[0].description=描述信息 | ||
- swagger.globalOperationParameters[0].modelRef=指定参数类型 | ||
- swagger.globalOperationParameters[0].parameterType=指定参数存放位置,可选header,query,path,body.form | ||
- swagger.globalOperationParameters[0].required=指定参数是否必传,true,false | ||
``` | ||
|
||
|
||
> host属性从1.3.0.RELEASE开始支持 | ||
|
||
### Path规则说明 | ||
|
@@ -129,10 +145,19 @@ swagger.exclude-path=/ops/**, /error | |
- swagger.docket.<name>.base-package=swagger扫描的基础包,默认:全扫描 | ||
- swagger.docket.<name>.base-path=需要处理的基础URL规则,默认:/** | ||
- swagger.docket.<name>.exclude-path=需要排除的URL规则,默认:空 | ||
- swagger.docket.<name>.name=参数名 | ||
- swagger.docket.<name>.modelRef=指定参数类型 | ||
- swagger.docket.<name>.parameterType=指定参数存放位置,可选header,query,path,body.form | ||
- swagger.docket.<name>.required=true=指定参数是否必传,true,false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. swagger.docket..required=指定参数是否必传,true,false 去掉多余的内容 |
||
- swagger.docket.<name>.globalOperationParameters[0].name=参数名 | ||
- swagger.docket.<name>.globalOperationParameters[0].description=描述信息 | ||
- swagger.docket.<name>.globalOperationParameters[0].modelRef=指定参数存放位置,可选header,query,path,body.form | ||
- swagger.docket.<name>.globalOperationParameters[0].parameterType=指定参数是否必传,true,false | ||
``` | ||
|
||
说明:`<name>`为swagger文档的分组名称,同一个项目中可以配置多个分组,用来划分不同的API文档。 | ||
|
||
|
||
**分组配置示例** | ||
|
||
```properties | ||
|
@@ -144,13 +169,21 @@ swagger.docket.aaa.contact.name=zhaiyongchao | |
swagger.docket.aaa.contact.url=http://spring4all.com/ | ||
swagger.docket.aaa.contact.email=didi@potatomato.club | ||
swagger.docket.aaa.excludePath=/ops/** | ||
swagger.docket.aaa.globalOperationParameters[0].name=name three | ||
swagger.docket.aaa.globalOperationParameters[0].description=some description three override | ||
swagger.docket.aaa.globalOperationParameters[0].modelRef=string | ||
swagger.docket.aaa.globalOperationParameters[0].parameterType=header | ||
|
||
swagger.docket.bbb.title=group-bbb | ||
swagger.docket.bbb.basePackage=com.yonghui | ||
|
||
|
||
``` | ||
|
||
说明:默认配置与分组配置可以一起使用。在分组配置中没有配置的内容将使用默认配置替代,所以默认配置可以作为分组配置公共部分属性的配置。 | ||
|
||
`swagger.docket.aaa.globalOperationParameters[0].name` 会覆盖同名的全局配置 | ||
|
||
### JSR-303校验注解支持 | ||
|
||
支持对JSR-303校验注解的展示,如下图所示: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
每个docket的似乎还没支持?