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
Tag: swagger
HTTP not present on Schemes Swagger dropdown
I’m using springfox-swagger-ui and for whatever reason, only https scheme is available on the dropdown, even if I reach swagger ui through http. I can’t use https for the moment, so need that scheme enabled but couldn’t find anything on the documentation. Any idea why is this happening? Answer Add these following lines to your yaml page:
How to handle header field with swagger in a java project?
I want to add header parameters to swagger ui so that the user can pass these values also. Could someone guide on what the java code for this would look like. I am using springfox-swagger2 and springfox-swagger-ui version 2.9.x (There are other post of SOF that describe about adding these through swagger editor or are for other technologies, so they
Generating POJOs using OpenAPI generator with Lombok Annotations
I am using OpenAPI generator maven plugin like one below for generating Java client code for models . When , I generate the model classes, they get generated with usual POJO field declarations and getters and setters. But what I want to do is, instead of generating getters and setters, I want my classes to get automatically generated with Lombok
Java Spring Boot OpenApi 3 – How to add description for RequestBody?
I want to have a description for RequestBody in spring boot openapi 3 . so i make my code like this : RequestBody description is Book to add. My desire UI is like this : But nothings happen ! There is no description in my UI. description was added to Schemas panel Book entity !!! What is the problem ?
Is OpenAPI v.3 incomplete or convertor is wrong?
I am trying to validate some data for the REST API using swagger description. I have converted swagger.json into OpenAPI 3.0.1 using swagger editor conversion option, and now trying to read it into OpenAPI object with ObjectMapper with following lines of code: First, I got an error as it could not recognized the field x-codegen-request-body-name generated by the converter. Fine,
springfox ApiModelProperty position sorting not working
In my spring boot application, I cannot be able to manage my swagger JSON with fields ordered properly on @ApiModel annotated class. Firstly, I imported springfox lib into my pom.xml: Secondly, I created SwaggerConfig.java: Thirdly, I created my PersonDTO annotated by @ApiModel: Then, when I requesting for Json output at url http://localhost:[port]/[servlet-context-path]/v2/api-docs, it seems that the position order is not
How to make Swagger put new line in the generated HTML (in Swagger UI page)?
I have a REST service method annotated with io.swagger.annotations.ApiOperation @ApiOperation(value = “some string”) I need some string to generate newlines in the HTML page swagger-ui.html (i.e. in the Swagger UI page where I see my docs and I can test my API methods). I tried putting <br/> and n in some string, and anything I could think of, and anything
Swagger codegen generates duplicated variables
I’m trying to generate client from yaml that contains That means, accept and contentType will be present in generated method signature. On top of that, I’v configured plugin like this Still, after mvn clean install I’m getting Error:(130,31) java: variable accept is already defined in method And generated code contains I’v tried different versions of plugin (from 2.3.0 up to
How to annotate array of objects response in Swagger
I have to debug a REST API Java project that has been developed using Swagger.I’m new to it, so I’m a little bit confused on how to do certain things. For example, here’s one method: The @ApiResponse for the code 200 is not of type LocationResponse but of type ArrayList<LocationResponse>, as it can return more than one location. What would