Questions tagged [springdoc]

The springdoc-openapi Java library helps automating the generation of API documentation using Spring Boot projects. springdoc-openapi works by examining an application at runtime to infer API semantics based on Spring configurations, class structure and various annotations.

The springdoc library automatically generates documentation in JSON/YAML and HTML formatted pages. The generated documentation can be complemented using swagger-annotations.

Useful links:

471 questions
6
votes
4 answers

Got "Ambiguous handler methods mapped for '/v3/api-docs'" after migrating from SpringFox to SpringDoc

Using Spring Boot 2.4.5 and IntelliJ 2021.2. After migrated io.springfox springfox-boot-starter 3.0.0 to
夢のの夢
  • 5,054
  • 7
  • 33
  • 63
6
votes
1 answer

Enabling Swagger springdoc-openapi-ui (OpenAPI 3.0) with Spring Security - Cannot access swagger-ui.html (401)

Swagger OpenAPI 3.0 is working with springdoc-openapi-ui and a custom OpenAPI Bean. pom.xml org.springframework.cloud spring-cloud-starter-parent
Phipsll
  • 81
  • 1
  • 2
  • 9
6
votes
2 answers

Springdoc GroupedOpenApi not following global parameters set with OperationCustomizer

When using GroupedOpenApi to define an API group, the common set of parameters that are added to every endpoint is not present in the parameters list. Below are the respective codes @Bean public GroupedOpenApi v1Apis() { return…
Debargha Roy
  • 2,320
  • 1
  • 15
  • 34
6
votes
3 answers

Springdoc OpenAPI ui does not honor context-path in "location"

Setup: I am using the Java library springdoc-openapi-ui in version 1.4.0 (via Maven) without any customization in a simple spring-boot project. The Swagger page is generated under https://my-url.com/my-context-path/swagger-ui/index.html and the…
6
votes
4 answers

Using openapi.yaml in springdoc

I can customize OpenAPI from code. Can I do same over openapi.yaml like swagger-petstore I create simple springboot project with one @RestController. I create openapi.yaml and copy it to /src/main/resources/. But I see default values on open…
Yura Shinkarev
  • 5,134
  • 7
  • 34
  • 57
6
votes
1 answer

How to create a link in OpenAPI 3.0 with Springdoc?

I am trying to create a link for a response in OpenAPI 3.0 specification. More specifically, I want to provide a known relationship between one of my responses and other available operation (cf. Link Object). In my Spring Boot project I am using…
Vladas Maier
  • 2,054
  • 2
  • 22
  • 34
6
votes
1 answer

Default response class in springdoc

I am trying to add a default error model to all endpoints in my API, for some error codes. I found a partial solution by reading the following issues: Springfox -> Springdoc: How to expose additional…
pedro_silva
  • 143
  • 2
  • 6
6
votes
3 answers

How do I write a custom sorter to sort my springdoc swagger tags by name in the UI?

I am using springdoc-openapi with the latest version (1.3.0). Now I would like sort my tags in the UI by "name" property. I know about the "springdoc.swagger-ui.tagsSorter" configuration and that I can use a custom sorter function. But I cannot find…
aleyandraaa
  • 63
  • 1
  • 1
  • 4
6
votes
2 answers

Global Parameter set using Open API configurations?

I am using Spring Boot REST OpenAPI 3 specification. In this example, I am looking to globally set the headers (Custom-Header-Version=v1) which I want to pass while making a request to each endpoint(s). Now issue is that I've 100 of REST endpoint…
PAA
  • 1
  • 46
  • 174
  • 282
6
votes
2 answers

java.lang.IllegalStateException: Unable to read meta-data for class while implementing open api with spring boot

I am trying to implement Open API Doc and Open API UI using Spring inside Spring Boot: I am referring following guide to do so: https://www.baeldung.com/spring-rest-openapi-documentation Dependencies in maven are as follows: