How to define header parameters in OpenAPI 3.0?

In OpenAPI 3.0, header parameters are defined in the same way as in OpenAPI 2.0, except the type has been replaced with schema: paths: /post: post: parameters: – in: header name: X-username schema: type: string When in doubt, check out the Describing Parameters guide. But in Swagger 3.0.0 parameters are replaced by request bodies. This … Read more

How to run Swagger 3 on Spring Boot 3

I had given up and went to use Spring Boot 2.7 after posting the question. But, after seeing Dmitriy’s answer though, I checked Springdoc one last time and found that Springdoc v2 does support Spring Boot 3. Essentially, one has to place the following in their pom: <dependency> <groupId>org.springdoc</groupId> <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> <version>2.0.0</version> </dependency> Then one can … Read more

How to use ‘Authorization: Bearer ‘ in a Swagger Spec

Maybe this can help: swagger: ‘2.0’ info: version: 1.0.0 title: Bearer auth example description: > An example for how to use Bearer Auth with OpenAPI / Swagger 2.0. host: basic-auth-server.herokuapp.com schemes: – http – https securityDefinitions: Bearer: type: apiKey name: Authorization in: header description: >- Enter the token with the `Bearer: ` prefix, e.g. “Bearer … Read more

Swagger UI – How can I expand all the operations by default?

I believe you can set the docExpansion:”full” when creating swagger-ui. See https://github.com/swagger-api/swagger-ui#parameters for details. docExpansion: Controls the default expansion setting for the operations and tags. It can be ‘list’ (expands only the tags), ‘full’ (expands the tags and operations) or ‘none’ (expands nothing). The default is ‘list’.

NSwag vs Swashbuckle [closed]

I would like to share information that I have found so far. It doesn’t answer my question but might be useful for others. I found a comment from RicoSuter who develops NSwag: NSwag not only provides the functionality of Swashbuckle (Swagger generation) but also code generators. This way we can avoid incompatibilities and offer more … Read more

Enum in swagger

In case of swagger-maven-plugin 3.1.0 this might be a minimal documentation: @ApiModel public class Input { @ApiModelProperty public Day day; } @ApiModel public enum Day { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday; } Then this is the generated json model: “definitions” : { “Input” : { “type” : “object”, “properties” : { “day” : … Read more

Swagger – Springfox always generates some response messages (401,403…) by default. How can I remove them?

You should be able to set up the plugin to not use the default response messages. Follow below instructions for different versions. For 1.0.2 or prior new SwaggerSpringMvcPlugin(…) //More config .useDefaultResponseMessages(false) //<– this should be false …; For 2.x new Docket() //More config .useDefaultResponseMessages(false) //<– this should be false …;

Slate vs Swagger – Which is better and which have more options? [closed]

Swagger and Slate serve two different purposes. Swagger is an attempt at a standardized way of describing a RESTful API (similar, for example, to ApiBlueprint) Swagger is a JSON based API definition format, which allows for the description of REST APIs. ~ API Design Tooling From Swagger Slate, on the other hand is a pretty … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)