Api docs disable feature not working in 1.6.12
See original GitHub issueDescribe the bug Per https://github.com/springdoc/springdoc-openapi/issues/358 , I expected the disabling of /api-docs url to be disabled since I am hosting my own swagger file at the UI however , the disable functionality is not working and it still shows auto generated swagger file on /v3/api-docs , I am trying to disable it however it does not seem to respond to my config changes. I have added an example below.
To Reproduce Steps to reproduce the behavior:
- What version of spring-boot you are using? - 2.7.5
- What modules and versions of springdoc-openapi are you using? - 1.6.12
- What is the actual and the expected result using OpenAPI Description (yml or json)? - The url is still hosting the auto generated swagger
My spring config ->
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/swagger-ui/").setViewName("forward:/swagger-ui/index.html");
registry.addRedirectViewController("/swagger-ui", "/swagger-ui/");
registry.addViewController("/api-docs").setViewName("forward:/v3/api-docs");
}
@Bean
SpringDocConfigProperties springDocConfigProperties() {
SpringDocConfigProperties docConfigProperties = new SpringDocConfigProperties();
docConfigProperties.getApiDocs().setEnabled(false);
return docConfigProperties;
}
}
My yaml config ->
springdoc:
swagger-ui:
url: /swagger.yaml
Expected behavior
- the disable api-docs feature is not working , it still shows an autogenerated swagger when I am providing one myself in resources static folder.
Screenshots None
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
springdoc.api-docs.enabled=false disabling whole swagger ...
Describe the bug I'm using springdoc-openapi-ui version 1.6.9, My intension is to load custom yaml file into swagger UI page for that I...
Read more >Springdoc Swagger UI not using swagger-config
Yeah, i already tried disabling the default url but it doesn't work for some reason. I had the same doubt, so i set...
Read more >OpenAPI 3 Library for spring-boot
Automatically generates documentation in JSON/YAML and HTML format APIs. This documentation can be completed by comments using swagger-api ...
Read more >Hello API Security + API Docs on Production? - SymfonyCasts
We're talking about security, not uh, ice cream. ... Video not working? ... The goal is to disable the docs only in production,...
Read more >Wrong accessibility service running when user selects another ...
Some others have gone so far as to disable both Google and Samsung TTS but this stops S-Voice and other useful features from...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Alright. Makes sense. I’m for now just going to add a extra entry to our spring security config to conditionally (depending on environment) deny requests going to
/webjars/**. If this ends up causing more issues / questions, I’ll look into raising a PR. Thanks!@ilya40umov,
Well good you found out that the
springdoc-openapiconfigs are not loaded. If you want to elaborate or propose some enhancement, please feel free to propose directly a PR.