Skip to content

Api docs disable feature not working in 1.6.12 #1946

@theanupriyasharma

Description

@theanupriyasharma

Describe the bug
Per #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

Metadata

Metadata

Assignees

No one assigned

    Labels

    incompleteincomplete description: Make sure you Provide a Minimal, Reproducible Example - with HelloController

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions