Browse Source
Merge pull request #8575 from YevhenBondarenko/feature/swagger-enabled
added ability to disable swagger
pull/9293/head
Andrew Shvayka
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
0 deletions
-
application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java
-
application/src/main/resources/thingsboard.yml
|
|
|
@ -87,6 +87,8 @@ import static springfox.documentation.builders.PathSelectors.regex; |
|
|
|
@Profile("!test") |
|
|
|
public class SwaggerConfiguration { |
|
|
|
|
|
|
|
@Value("${swagger.enabled:true}") |
|
|
|
private boolean enabled; |
|
|
|
@Value("${swagger.api_path_regex}") |
|
|
|
private String apiPathRegex; |
|
|
|
@Value("${swagger.security_path_regex}") |
|
|
|
@ -116,6 +118,7 @@ public class SwaggerConfiguration { |
|
|
|
public Docket thingsboardApi() { |
|
|
|
TypeResolver typeResolver = new TypeResolver(); |
|
|
|
return new Docket(DocumentationType.OAS_30) |
|
|
|
.enable(enabled) |
|
|
|
.groupName("thingsboard") |
|
|
|
.apiInfo(apiInfo()) |
|
|
|
.additionalModels( |
|
|
|
|
|
|
|
@ -989,6 +989,7 @@ edges: |
|
|
|
persistToTelemetry: "${EDGES_PERSIST_STATE_TO_TELEMETRY:false}" |
|
|
|
|
|
|
|
swagger: |
|
|
|
enabled: "${SWAGGER_ENABLED:true}" |
|
|
|
api_path_regex: "${SWAGGER_API_PATH_REGEX:/api/.*}" |
|
|
|
security_path_regex: "${SWAGGER_SECURITY_PATH_REGEX:/api/.*}" |
|
|
|
non_security_path_regex: "${SWAGGER_NON_SECURITY_PATH_REGEX:/api/(?:noauth|v1)/.*}" |
|
|
|
|