Skip to content
Advertisement

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

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

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

Advertisement