Questions tagged [swagger-3.0]
121 questions
34
votes
3 answers
No constructor for type SwaggerGenerator can be instantiated using services from the service container and default values
I'm trying to add Swagger to my project. The error received is as follows.
No constructor for type 'Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator' can be instantiated using services from the service container and default values.
Since I…

DonkeyBanana
- 3,266
- 4
- 26
- 65
11
votes
4 answers
How to generate swagger3 (OpenAPI3) spec in (.json/.yaml) from protobuf (.proto) files?
My original use-case:
I am building an application in GO with a gRPC server (using protobuf), and wrapping it inside an HTTPS server (using gin). Only the HTTPS server is being published to the clients for use (by which I mean that my application…

Krishna Birla
- 332
- 2
- 10
7
votes
1 answer
How to represent List of Strings in Springdoc Swagger v3?
Below is a code that is similar to the situation I have
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "OK", content = {@Content(schema = @Schema(
implementation = // <-- What to specify here?
…

Debargha Roy
- 2,320
- 1
- 15
- 34
7
votes
1 answer
Pass argument to `$ref` in OpenAPI 3
Assume I have following schema to reuse later using $ref:
"schemas": {
"Order": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"petId":…

ata
- 1,254
- 1
- 9
- 30
6
votes
2 answers
java swagger 3 annotations @ExampleObject from jsonfile
I'm documention one of my api with multiple examples like this:
@Operation(summary = "Create new")
@PostMapping("")
public ResponseEntity

Robin Dijkhof
- 18,665
- 11
- 65
- 116
6
votes
0 answers
Asp.NETCore 3.1 With Swagger launchUrl does not work after Publish
ASP.NET Core Web API project is configured with Swagger. When I run the project on my local machine the launchUrl works correctly and automatically redirects to my Swagger apidocs location (https://localhost:44373/apidocs/index.html)
But as soon as…

ameya
- 1,448
- 1
- 15
- 31
6
votes
1 answer
VSCode php-swagger 3.0 annotation plugins?
Does there is php-swagger annotation plugins in VSCode?
I write the annotation recently, but there is some inconvenience while the indent is not automatic or the keyword can not be auto-complete.
Or do anyone suggest another ide with this plugin?

Elvis Lin
- 61
- 3
6
votes
1 answer
Cannot reference a component schema defined in a separate file in Swagger
I have the following api documentation:
swagger: "3.0"
info:
version: 0.0.1
title: Test API
paths:
/users:
get:
summary: Get all registered users
produces:
- application/json
responses:
200:
…

omer
- 1,242
- 4
- 18
- 45
6
votes
1 answer
The order between AddMvc/AddSwaggerGen and UseMvc/UseSwagger(UI)
When I power my APIs with Swagger, I follow one of those guids and I always put the MVC injections before Swagger injections like this.
services.AddMvc();
services.AddSwaggerGen(_ => { ... });
app.UseMvc();
app.UseSwagger();
app.UseSwaggerUI(c => {…

Konrad Viltersten
- 36,151
- 76
- 250
- 438
4
votes
2 answers
POST method with MultipartFile as RequestPart is considered as String in swagger3 open-api Springboot project
In Spring Boot project with Swagger 3 OpenAPI.
Have a POST method with Multipart file as RequestPart.
In swagger-ui ideally it should ask for file upload but only shows file as a String.
Kindly help me get file upload instead of String in…

TheCoder
- 41
- 5
4
votes
2 answers
How to add "bearer" auth header in Swagger UI 3.0 version using javascript instead of clicking "authorize" button
I am using Swagger UI 3.0 to call the Endpoint API's listed there. And to call the api's, I have to add authentication in header. We had javascript to add the authentication to the swagger UI which adds the authentication globally to all API in the…

MD ISLAM
- 71
- 2
- 4
3
votes
1 answer
Swagger API having different response with the change of Optional Parameters
I am trying to create the OAS Swagger documentation for an existing API where the response for the API is changing on the basis of Query parameter. I am struggling to document this in a developer friendly way, so need some assistance. Below is the…

Aks
- 55
- 6
3
votes
2 answers
Preferred way to convert openapi 3 document (json or yaml) to markdown, adoc or any other static format
I try to find an easy way in java to convert an openapi 3 document (json or yaml) in a static format like markdown, html or adoc. Searching around I've found a view projects like Swagger2Markup, but they aren't ready for Openapi v3!
Does anyone have…

Thilo Schwarz
- 640
- 5
- 24
3
votes
1 answer
How to write @ApiResponse which may return a Class or a List of that class using OpenAPI 3 Swagger in Spring Boot
As written in documentation we can use anyOf with @Schema if we want to define multiple responses.
@ApiResponse(responseCode = "201", description = "OK",
content = @Content(schema = @Schema(anyOf = {Product.class, Activity.class})))
My…

Mayank Bist
- 181
- 1
- 3
- 10
3
votes
0 answers
Does response status code make sense for multiple media types for error status codes as per OpenAPI 3 (Swagger) spec
If we follow the OAS3 spec for Response here we can see that each response status code can have multiple media types and each media type in turn has a schema particular to it.
UseCase : For example oas3 example below, we can see 200 has a binary…

Mandar Autade
- 336
- 2
- 12