0

I have a spring boot 3 application and I have added springdoc-openapi dependency ie

<dependency>
  <groupId>org.springdoc</groupId>
  <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
  <version>2.5.0</version>

I have added following properties in application.properties

springdoc.swagger-ui.path=/swagger-ui.html
springdoc.swagger-ui.config-url=/applicationname/rest/env1/api-docs/swagger-config
springdoc.swagger-ui.disable-default-url=true
springdoc.api-docs.path=/api-docs

when I run the application in my local , I am able to access swagger using http://localhost:8080/swagger-ui.html

but when I deploy in env1, I am seeing No API Definition Provided

My application context path is

https://domain/applicationname/rest/env1

I am accessing swagger using

https://domain/applicationname/rest/env1/swagger-ui.html

I am able to load the api-doc definition using

https://domain/applicationname/rest/env1/api-docs

In security config I have

@Bean
    @Order(1)
    public SecurityFilterChain publicChain(HttpSecurity http){
    http.authoriseRequests(req ->req.requestMatchers("/swagger-ui.html",
    "/swagger-ui.html/**","/api-docs","/v3/api-docs","v3/api-docs/**","/api-docs/**").
     permitAll().anyRequest().permitAll);

    return http.build();
    }

@Bean
    @Order(2)
    public SecurityFilterChain privateChain(HttpSecurity http){
    http.authoriseRequests(req ->req.requestMatchers("/api/test**").hasRole(ROLE).anyRequest.permitAll());

    return http.build();
    }

Can some one tell me how can I fix this

0

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.