question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Api docs disable feature not working in 1.6.12

See original GitHub issue

Describe 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:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ilya40umovcommented, Nov 21, 2022

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!

1reaction
bnasslahsencommented, Nov 21, 2022

@ilya40umov,

Well good you found out that the springdoc-openapi configs are not loaded. If you want to elaborate or propose some enhancement, please feel free to propose directly a PR.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found