application.properties config log Go to URL http://localhost:8088/swagger-ui/index.html How to fix it? Answer Your configuration is mostly correct, your swagger page loads properly except that when it tries to retrieve the swagger config and api-docs via its ajax call it fails to do so because it’s unde…
Tag: springdoc
Spring Boot, Swagger and Authorisation
I have a Spring Boot API that uses Springdoc (Swagger). The API has security with “apiKey” and “code” fields being passed in the header. I am having difficulty configuring Swagger correctly to enable the Authentication function in the Swagger UI. This is the configuration: I know this …
Replace @PathVariable object with ID only for Springdoc
I am currently trying to migrate from Springfox to Springdoc. Most of my endpoints contain a @PathVariable Instance. Obviously I am only passing in the ID of the instance and Spring would automatically resolve the object for me. Here is an example: Called as /api/myInstance/role. Springfox would handle this c…
How can have springdoc-openapi use the @JsonValue enum format without changing toString?
I have a Spring Boot application using springdoc-openapi to generate Swagger API documentation for my controllers. One of the enums used in the JSON request/response has a different JSON representation than its value/toString(). This is achieved using the Jackson @JsonValue annotation: However, the generated …
How to change default schema of LocalDateTime in Swagger documentation using springdoc?
We use Spring Boot and https://springdoc.org/ to generate OpenApi documentation. We want to change default schema for LocalDateTime, so we don’t have the same annotation every time LocalDateTime is used. So, I added: it worked. The issue is that now it’s impossible to add custom description or exa…
How do I document a Rest parameter providing another type (MyClass vs. String)?
In Springfox I once used the following syntax to render a String parameter with a full model (original Github issue): The reason for this formulation is that if I put MyClass as type for the request body I had no way to distinguish when a property has not been updated or when has been set to null, because bot…