Browse Source
Merge pull request #13863 from dashevchenko/exposeSwaggerProperties
Configurable Swagger docs expansion
pull/13312/merge
Viacheslav Klimov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
5 additions and
1 deletions
-
application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java
-
application/src/main/resources/thingsboard.yml
|
|
|
@ -116,6 +116,8 @@ public class SwaggerConfiguration { |
|
|
|
private String appVersion; |
|
|
|
@Value("${swagger.group_name:thingsboard}") |
|
|
|
private String groupName; |
|
|
|
@Value("${swagger.doc_expansion:list}") |
|
|
|
private String docExpansion; |
|
|
|
|
|
|
|
@Bean |
|
|
|
public OpenAPI thingsboardApi() { |
|
|
|
@ -172,7 +174,7 @@ public class SwaggerConfiguration { |
|
|
|
uiProperties.setDefaultModelExpandDepth(1); |
|
|
|
uiProperties.setDefaultModelRendering("example"); |
|
|
|
uiProperties.setDisplayRequestDuration(false); |
|
|
|
uiProperties.setDocExpansion("list"); |
|
|
|
uiProperties.setDocExpansion(docExpansion); |
|
|
|
uiProperties.setFilter("false"); |
|
|
|
uiProperties.setMaxDisplayedTags(null); |
|
|
|
uiProperties.setOperationsSorter("alpha"); |
|
|
|
|
|
|
|
@ -1542,6 +1542,8 @@ swagger: |
|
|
|
version: "${SWAGGER_VERSION:}" |
|
|
|
# The group name (definition) on the API doc UI page. |
|
|
|
group_name: "${SWAGGER_GROUP_NAME:thingsboard}" |
|
|
|
# Control the initial display state of API operations and tags (none, list or full) |
|
|
|
doc_expansion: "${SWAGGER_DOC_EXPANSION:list}" |
|
|
|
|
|
|
|
# Queue configuration parameters |
|
|
|
queue: |
|
|
|
|