528 questions
1
vote
1
answer
91
views
How do I use an Object as a filter in a native JPA query?
I have a native query that takes 4 (optional) parameters for filtering. 4 is a bit too many for readability, so I was looking into replacing it with an object. I encountered two separate problems ...
0
votes
1
answer
62
views
.yaml not added to group URL
When I change the property springdoc.swagger-ui.url to contain the .yaml extension, for example /v3/api-docs.yaml, I expect the URLs of the defined groups to include it as well.
For example, with the ...
0
votes
2
answers
94
views
Springdoc 2.8.15 and Spring Boot 3.5.11 not working together
I have Springdoc 2.8.15 and Spring Boot 3.5.11 running. The API spec is generated correctly as long as I don't use the @Parameter and @OpenApiDefinition annotations. If I use one of them I get an ...
2
votes
1
answer
56
views
What is the purpose of springdoc.group-configs[_].display-name if Swagger UI derives the group display name from SwaggerUrl instead
I'm trying to understand the relationship between groups and URLs in Springdoc.
For example, we might have the following Springdoc configuration:
springdoc.swagger-ui.urls[0].url=${springdoc.swagger-...
0
votes
0
answers
119
views
Creation of semi-duplicate definitions leads to display problems (problem became visible when transitioning from springdoc 1.6.13 to springdoc 2.8.14)
When a Spring Boot application using springdoc-openapi-{common, ui, web-code, ...}:1.6.13 starts, it invokes the SwaggerWelcomeWebMvc class and later AbstractSwaggerWelcome, where ...
5
votes
1
answer
1k
views
ConventionErrorViewResolver bean conflict with springdoc-openapi-starter-webmvc-ui 3.0.1
I am setting up OpenAPI doc in spring-boot on one of my projects.
Every time I try to run my project with the following dependency:
<dependency>
<groupId>org.springdoc</groupId>
...
0
votes
0
answers
90
views
Issues with polymorphis in Swagger (springdoc) in Spring Boot after upgrading to 3.5
I have created a very simple demo project with one controller endpoint:
Spring Boot 3.5.6
Springdoc 2.8.13
This was working much better in Spring Boot 2.7.x
Full project here: https://github.com/...
1
vote
1
answer
67
views
springdoc ignores @Parameter(hidden = true) on @QuerydslPredicate
I am using springdoc 2.8.13 with Spring Boot and QueryDSL.
Here’s a controller endpoint that accepts a QueryDSL predicate:
@GetMapping("/users")
public ResponseEntity<?> users(
@...
1
vote
3
answers
526
views
Configure OpenAPI custom info object with Springdoc
I have a Spring Boot application where I use OpenAPI to document my API's. Everything works as expected except I'm not able to configure a custom info object of the v3/api-docs. This is my code:
...
0
votes
0
answers
61
views
Groovy/Grails Ambiguous mapping error with springdoc swagger
This is my controller
package example.infra.adapters.input.api.v1.endpoints
import example.aplication.services.authentication.LoginAuthenticator
import example.aplication.dtos.authentication....
1
vote
1
answer
97
views
CSRF acting strange with springdoc in stateless service
Let's consider that I have a stateless service with an authentication mechanism that makes the browser automatically send the credentials which then makes even a stateless service vulnerable. I want ...
0
votes
1
answer
99
views
Petstore Swagger UI is being loaded while springdoc openapi integration with SpringMVC (non boot) application
I am trying to integrate SpringDoc in my Spring MVC application (non SpringBoot), but every time I try to access the UI, its loading petstore swagger UI.
I am using Spring webmvc 5.3.39 version and ...
1
vote
0
answers
84
views
Hide parameter in Swagger doc but keep it for OpenAPI jar generation
I have a situation where I would like to not see a HTTP method parameter in the Swagger UI documentation, but still have it generated in my method signature by OpenAPI Java client generation.
I tried ...
1
vote
0
answers
94
views
Why does method-level produces not override class-level in Spring when generating OpenAPI spec with springdoc?
Using Spring Boot (3.5.0) with springdoc (2.8.9) I noticed something unexpected when specifying produces at both the class and method levels in a @RestController.
According to the Javadoc for org....
3
votes
0
answers
50
views
Serialising OpenAPI examples loses the type information of the request
I have a polymorphic request type, CreateRequest:
@JsonTypeInfo(
use = JsonTypeInfo.Id.CUSTOM,
include = JsonTypeInfo.As.PROPERTY,
property = "@type")
@...
1
vote
1
answer
42
views
Checkout and test springdoc-openapi branch
I want to checkout and test a development branch from this project:
https://github.com/springdoc/springdoc-openapi/pull/3007
I tried:
git checkout mschout:spring-boot-3.5-support
error: pathspec '...
0
votes
1
answer
127
views
Grouping multiple request parameters as single param for @RestController method
Suppose my Swagger-enabled endpoint receives lots of request parameters. I don't want to list all of them one by one. Instead, I want to group them somehow. Preferably, as a DTO: if I declare a Map, ...
1
vote
1
answer
409
views
How to include Springdoc schemas for a request body field that uses Jackson polymorphism of an interface
To start with, here are the relevant dependencies in my build.gradle:
implementation("org.springframework.boot:spring-boot-starter-web:2.7.18")
implementation("org.springdoc:...
2
votes
2
answers
2k
views
Spring Boot 3.4.x + springdoc-openapi: NoSuchMethodError in ControllerAdviceBean during Swagger UI load
I'm currently facing an issue while integrating Swagger UI with Spring Boot security in my project.
Everything builds fine, but when I try to load Swagger UI (at /swagger-ui.html or /api-docs), I keep ...
-1
votes
1
answer
356
views
No static resource swagger-ui/index.html with org.webjars:swagger-ui 5.20.7 in Spring Boot
My company have an app that uses Spring Boot 3.3 and can't be updated to 3.4. I had to change the version of org.webjars:swagger-ui to 5.20.7, but I can't access the swagger anymore. The error is:
No ...
0
votes
1
answer
153
views
Does Springdoc OpenAPI v2 support doc generation for QueryDSL predicate paths as query parameters?
Spring Data REST allows for simple boilerplate creation of CRUD REST controllers. When integrated with QueryDSL, HTTP query parameters can be bound to QueryDSL paths to filter the collection resource. ...
0
votes
0
answers
58
views
Api-docs.yaml doesn't see enums as components
I use this dependency to generate swagger-documentation for my java application.
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>...
0
votes
1
answer
379
views
How to set the default Pageable query params on Swagger UI?
I've been developing REST API endpoints with Spring Boot. Here's the controller class:
@RestController
@RequestMapping(
path = "/api/products",
produces = {MediaType....
0
votes
0
answers
47
views
springdoc-openapi - Unable to load swagger: "apiDocsUrl" is null
I have a Spring Boot 3.3.1 application, with springdoc-openapi-starter-webmvc-ui 2.6.0.
The swagger does not work anymore. It shows me the error Fetch error response status is 500 /v3/api-docs. In the ...
1
vote
1
answer
2k
views
SpringDoc 2.8.0: Failed to introspect Class [SwaggerConfig] - IllegalStateException
After updating SpringDoc to version 2.8.0, my Spring Boot application fails to start with the following error:
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springdoc....
0
votes
1
answer
466
views
Error with Swagger/OpenAPI version field when using Spring Security and Springdoc
I'm facing an issue with my Spring Security and Springdoc OpenAPI configuration. When I configure anyRequest().authenticated(), I receive the following error message:
Unable to render this definition
...
0
votes
0
answers
87
views
Swagger loads with an error unless I add an address in the "Explore" bar
Very similar questions are answered in other posts, but their fixes just don't seem to work for me and I hope it's due to the slight difference.
I'm using springdoc-openapi-starter-webmvc-ui:2.5.0
The ...
0
votes
0
answers
430
views
SpringDoc and Spring Data Rest configuration
I'm using Spring boot 3.4.1 with Spring Data Rest. Now I implemented SpringDoc
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0'
springdoc.api-docs.enabled=true
springdoc.api-...
1
vote
1
answer
243
views
Springdoc & Swagger & Spring 6 (not springboot)
I have problems to configure properly swagger /springdoc with Spring 6 (not Spring Boot).
I have my api exposed via /CONTEXT-PATH/api, I managed to have swagger-ui accessible at /CONTEXT-PATH/api/...
0
votes
1
answer
3k
views
Why swagger is not working properly with the springdoc-openapi-ui dependency in my spring boot application with the version 3.4.1?
I'm working on a Spring Boot application and trying to integrate Swagger UI using the springdoc-openapi-ui dependency. Here's my setup:
Spring Boot version: 2.x.x / 3.x.x (3.4.1)
springdoc-openapi-ui ...
3
votes
0
answers
55
views
How to display in swagger dynamically registered routes in a java webflux applicaiton?
I am creating a demo applicaiton where I register my endpoints dynamically using an endpoint registrar based on controller beans I have instanciated. Thus there are no annotations for the spring-doc ...
0
votes
0
answers
458
views
Unable to generate Swagger api docs for springboot java 21 application
I am trying to get the swagger api docs to show up on my springboot Java 21 application. I believe I have the correct setup:
Gradle File :
implementation group: 'org.springdoc', name: 'springdoc-...
0
votes
1
answer
1k
views
ClassNotFoundError: on app launch: Spring Boot 3, springdoc, Gradle
I'm trying to start up a simple REST server (Spring Boot 3, Spring Web).
I'm used to Maven, but this time I had to use Gradle. Never had business with it before.
I may have messed up the setup. Once I ...
0
votes
1
answer
224
views
Omit super class fields in spring doc open api docs
I'm on java 8, spring-boot 1.5.1 release and I've got the dependency
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
...
0
votes
1
answer
596
views
Why won't springdoc-openapi return the api-docs when assembled just as described out of the box?
I'm chasing an error 404 when trying to retrieve the api-docs from springdoc in an app that has a lot of moving parts. In order to debug the problem I built a simple springboot app that just has the ...
-1
votes
1
answer
43
views
Endpoint not displayed with same request mapping but different params
I use spring boot
Theses 2 endpoints is in controller
@RequestMapping(value = "/deposits")
@GetMapping(params = "idDepositSignal")
public ResponseEntity<Boolean> ...
45
votes
2
answers
23k
views
Springdoc: ClassNotFoundException: org.springframework.web.servlet.resource.LiteWebJarsResourceResolver
I've just upgraded springdoc from version 2.6.0 to 2.7.0 (nothing else was changed) and now I get a
ClassNotFoundException: org.springframework.web.servlet.resource.LiteWebJarsResourceResolver
I'm ...
0
votes
0
answers
84
views
Open API definition empty with Sprint boot 3 and spring security
I have setup a spring boot project using spring boot version 3.3.5 and added springdoc version 2.6.0, this project also includes spring security and my Security config is as follow:
@Bean
public ...
0
votes
0
answers
904
views
openapi-generator: additionalProperties generated but not shown in schema
I have an OpenAPI Description with the following structure:
Schema1:
type: object
properties:
timestamp:
type: string
format: date-time
...
1
vote
2
answers
322
views
A very specific spring boot actuator / swagger integration question
I'm launching my springboot webapp and navigating to localhost/api/myservice/swagger-ui/index.html, but getting a 401 Unauthorized. I've done all the usual things from now countless answers on SO, but ...
1
vote
0
answers
920
views
Swagger why is #/components/schemas/ missing for some of my $ref?
I'm generating an OpenAPI spec using org.springdoc:openapi-gradle-plugin:1.9.0 and org.springdoc:springdoc-openapi-ui:1.8.0 in a project using Boot 2.
All of the referenced schemas are defined at the ...
1
vote
3
answers
2k
views
Springboot springdoc-openapi how to customize the swagger
Adding the dependency below gives access to the swagger ui.
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</...
0
votes
1
answer
483
views
Springdoc's GroupedOpenApi together with external Swagger urls seem to not be working
I want to combine internal application's OpenAPI spec with external specs into one single Swagger UI in Spring Gateway application
According to contributor of Springdoc library, it should be possible:
...
1
vote
1
answer
539
views
Explicitly define which groups to be rendered on swagger-ui
I am working on a spring boot 3.1.4 (java 17) project with the following dependency:
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-...
0
votes
1
answer
544
views
Springdoc apidocs display yaml by default instead of json
I have a Spring Boot 3.x application using Springdoc to generate Swagger and OpenAPI documentation. When I access /api-docs, it returns the schema in JSON format. To get the YAML format, I have to ...
-2
votes
1
answer
2k
views
Please indicate a valid Swagger or OpenAPI version field. ... swagger: "2.0" and those that match openapi: 3.0.n (for example, openapi: 3.0.0)
I am using Spring MVC 5.3.23 (Not Spring Boot) + SpringDoc 1.8
If I access http://localhost:8080/swagger-ui.html
It is redirected to http://localhost:8080/swagger-ui/index.html?configUrl=/v3/api-docs/...
0
votes
2
answers
607
views
Swagger UI from Springdoc 1.8 not working with multi-module Maven project
We have a Maven project with Spring Boot 2.7.
We have several maven modules in the maven project, including two with MVC REST APIs, and one common.
The two REST API modules build separate services ...
2
votes
1
answer
470
views
@Schema(type = "integer") in @Parameter with @RouterOperation Not Working in Springdoc OpenAPI
I'm using Spring WebFlux with Springdoc OpenAPI and trying to document an API endpoint using @RouterOperation. My code looks like this:
@RouterOperation(
path = "/api/hello",
operation = @...
0
votes
1
answer
285
views
How to make springdoc openapi available in spring boot app while using jersey?
I am using spring boot 3.3.2 with jersey (using jakarta.ws annotations). Dependencies:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-...
0
votes
0
answers
146
views
How to use gradle compileOnly dependencies at runtime also
I have a simple spring boot app with below gradle file. Gradle version used is 7.6.x
buildscript {
ext {
springBootPlugin = 'org.springframework.boot:spring-boot-gradle-plugin'
...