Skip to content

Commit

Permalink
add example if we have documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ubamrein committed Apr 10, 2020
1 parent 04fdbff commit 13590ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>ch.ubique.openapi</groupId>
<artifactId>springboot-swagger-3</artifactId>
<version>1.1.1</version>
<version>1.1.2</version>
<packaging>maven-plugin</packaging>


Expand Down
3 changes: 3 additions & 0 deletions src/main/java/ch/ubique/openapi/SwaggerGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ private Map<String, Object> getRequestParam(java.lang.reflect.Parameter obj) {
if(obj.getAnnotation(documentation) != null) {
DocumentationWrapper docWrapper = new DocumentationWrapper(obj.getAnnotation(documentation));
param.put("description", docWrapper.description());
param.put("example", docWrapper.example());
}
else {
param.put("description", wrap.name());
Expand Down Expand Up @@ -468,6 +469,7 @@ private Map<String, Object> getPathParam(java.lang.reflect.Parameter obj) {
if(obj.getAnnotation(documentation) != null) {
DocumentationWrapper docWrapper = new DocumentationWrapper(obj.getAnnotation(documentation));
param.put("description", docWrapper.description());
param.put("example", docWrapper.example());
}
else {
param.put("description", wrap.name());
Expand Down Expand Up @@ -511,6 +513,7 @@ private Map<String, Object> getRequestHeader(java.lang.reflect.Parameter obj) {
if(obj.getAnnotation(documentation) != null) {
DocumentationWrapper docWrapper = new DocumentationWrapper(obj.getAnnotation(documentation));
param.put("description", docWrapper.description());
param.put("example", docWrapper.example());
}
else {
param.put("description", wrap.name());
Expand Down

0 comments on commit 13590ff

Please sign in to comment.