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
0
votes
1 answer

Spring Controller validation seems does not work when I describe API specification with SpringDoc and interfaces

I have gradle multimodule poject containing: 'api-spec' module which contains java interfaces of rest controllers to describe API specification with SpringDoc generator 'wallet' module which contains java classes of rest-controllers implementing…
bvn13
  • 154
  • 11
0
votes
1 answer

How to get the Swagger schema for a specific version of a Swagger API?

I know I can add a /v3/api-docs/ to the end of my APIs endpoint to get a JSON representation of my APIs schema. Is there a way to get the schema for a specific version of the API?
Raphael Rafatpanah
  • 19,082
  • 25
  • 92
  • 158
0
votes
2 answers

Hide uri alias from appearing in open api spec/documenation

i have a controller with 2 paths as below, @PostMapping(path = {"/user/vehicle", "/user/car"}) public UserVehicle getUserVehicle( But i want only "/user/vehicle" to be included in open api doc (and hide the "/user/car") in open api specs/doc. Is…
Rajan
  • 49
  • 6
0
votes
0 answers

How to exclude resource/library from OpenApi 3 documentation in Spring boot

I need to exclude endpoints from the documentation which are added to the project through the maven dependency. My OpenApi configuration: @Configuration public class OpenApiConfiguration { @Value("${app.version:unknown}") …
olga
  • 1
  • 2
0
votes
0 answers

How to expose different path of an operation?

I have a spring boot application which is located behind a reverse proxy. This proxy rewrites paths. In my application I have a REST controller and document it with springdoc @Operation(summary = "Expose some data", ...) @RequestMapping(path = "/a",…
Telamon
  • 46
  • 3
0
votes
1 answer

Springdoc configUrl behind api gateway

I have springdoc swagger ui up and running with a spring cloud gateway route /myapi. So when I hit the url https://myhost.com/myapi it redirects me to a url https://myhost.com/myapi/webjars/swagger-ui/index.html?configUrl=/swagger-config.json I…
0
votes
1 answer

Springdoc webflux automatically convert String to java.time.LocalDate error

When I use org.springdoc:springdoc-openapi-spring-boot-2-webflux:3.1.5to build reactive api. I got following error: Caused by: java.time.format.DateTimeParseException: Text '2021-03-24' could not be parsed at index 4 Sample…
wu tao
  • 3
  • 1
0
votes
1 answer

Group APIs by parameter or tag or any different key

I have four types of API which needs to be grouped: profileOne = path: v1/profileOne/ profileTwo = path: v1/profileTwo/ common = path: v1/common (could be accessible by both profiles) But I also have some APIs for example: v1/test and v1/hello which…
Guilherme Bernardi
  • 490
  • 1
  • 6
  • 18
0
votes
1 answer

How can we add to the default response codes in Spring docs Open API on actuator endpoints such as /health?

I am able to display the actuator endpoints in my API through this config: springdoc: show-actuator: true I am able to manage the http mappings of my /health endpoint with this config: management: endpoint: health: status: …
0
votes
1 answer

SpringDoc generate OpenApi spec with multiple media types

In my Spring project I'm using Springdoc to generate a OpenApiSpecification doc. I created my Api with these annotations. I want to have the same endpoint url with different mediatype to handle the POST of different objects. @Validated @Tag(name =…
drenda
  • 5,846
  • 11
  • 68
  • 141
0
votes
1 answer

Specify response type for springdoc/io.swagger.core.v3 "ApiResponse"

I have an @RestController endpoint defined as @GetMapping(value = "/end/point/{id}") public ResponseEntity endpoint( @PathVariable("id") @NotBlank @Pattern(regexp ="^[A-Za-z]$") String cdsId){ ... conditions to return…
scoll
  • 117
  • 1
  • 15
0
votes
1 answer

Spring boot - springdoc custom url for swagger-ui

I need to use a specific url for Swagger-ui. I have tried to use the property "springdoc.swagger-ui.path" but it only redirects. application.propperties: springdoc.swagger-ui.path=/helloWorld/swagger Url in browser:…
FireStarter
  • 43
  • 2
  • 7
0
votes
1 answer

Swagger UI, SpringDoc, OpenAPI 3.0: UI fields for POST body instead of textarea?

SpringDoc 1.5.3 (latest) SwaggerUI 3.41.0 (latest) Swagger UI shows nice fields for @RequestParam. I have a POST endpoint, so I used @RequestBody. I can send a JSON and it parses into my body object. So far so good. But Swagger UI shows only a…
Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
0
votes
1 answer

Automatic Swagger annotation-based description generation in Springdoc

Basically my question is the same as this one but for Springdoc (and not Springfox). In short, I have a Spring-boot app and I am using spring-security @PreAuthorize annotation to secure some of my apis, currently based on hasAuthority only. Is there…
0
votes
0 answers

springdoc-openapi : not showing correct tag when init

I am using springdoc-openapi to create API documentation and I'm using $ref to reference the external yaml file. Here's my config: tags: - name: example description: 'Description for Example' paths: /example/{id}/{pathParam2}: get: …