springdoc / springdoc-openapi

Library for OpenAPI 3 with spring-boot
https://springdoc.org
Apache License 2.0
3.25k stars 489 forks source link

Customize "springdoc.*" properties programatically #2686

Open wdallastella opened 3 weeks ago

wdallastella commented 3 weeks ago

Describe the solution you'd like

Maybe there is already a way of doing it but I didn't find it documented.

Is there any customizer where I can change the springdoc.* properties programatically without setting the property?

springdoc:
  api-docs:
    path: "/some-other-path/api-docs"
  default-consumes-media-type: "application/json"
  default-produces-media-type: "application/json"
  writer-with-default-pretty-printer: true

Describe alternatives you've considered

Maybe having a SpringDocCustomizer so we can change those.

Additional context

We have some starters for openapi and we could abstract most of the configs on this starter so we don't need to set in all services.

wdallastella commented 2 weeks ago

Something like: https://github.com/springdoc/springdoc-openapi/compare/main...wllianwd:springdoc-openapi:feature/add-customizer-bean-for-api-docs-path?expand=1