简体   繁体   中英

Is there any option to add a prefix for /swagger-ui path? OpenApi

Do you have any idea how to add as a prefix for /swagger-ui, my application name? smth like

springdoc:
  swagger-ui:
    path: classpath:/META-INF/swagger-ui

but the code above doesnt work at all. i'd like to access localhost:8080/application-service/swagger-ui instead of localhost:8080/swagger-ui (which this is resolved with springdoc.swagger-ui.path=/swagger-ui

I dont want to use:

server:
  servlet:
    context-path: /application-service

because all the endpoints will have a different route. thankssss

springdoc:
  swagger-ui:
    path: "application-service"

When using the above method, you'll be able to access Swagger-UI at http://localhost:8080/application-service

Note that even using the above property will redirect you to localhost:8080/swagger-ui , but with the added advantage that you'll have a different URL to access the Swagger-UI. Also, as of yet the path can not have a / in it, meaning you can't have an n-level path to expose Swagger-UI (which in a way makes sense cause Swagger is reference documentation and should be easily accessibly).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM