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 under security’s control. Look at your dev tools and watch the network traffic; you’ll probably
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 is incorrect, but are unsure how to configure it. Any assistance appreciated. Attempts
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 correctly for me, only generating {instance} as a String mapping to
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 Swagger API docs use the enum value (specifically, the value of toString()) rather than the JSON
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 example for specific field: As you can see below description is missing in
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 both would