Questions tagged [openapi]

The OpenAPI Specification, originally known as the Swagger Specification, is a specification for machine-readable interface files for describing, producing, consuming, and visualizing RESTful Web services.

A variety of tools can generate code, documentation and test cases given an interface file. Development of the OpenAPI Specification (OAS) is overseen by the Open API Initiative, an open source collaborative project of the Linux Foundation.

Ref: https://en.wikipedia.org/wiki/OpenAPI_Specification

Related tags

4284 questions
2
votes
1 answer

I need to add multiple examples for the @Parameter in springdoc-openapi, but this is not generating the given examples

I am trying to add swagger documentation to my project. I need to add multiple examples for the @Parameter in @RequestBody for the Sample.class, The following piece of code is how its mentioned to be written in the docs. @PostMapping("/") …
AshithR
  • 98
  • 1
  • 9
2
votes
0 answers

How to view static pages generated under META-INF using Grails 4

Micronaut is the parent application context of Grails 4. We are trying to use some Micronauts features on our Grails 4 application. In particular, we are trying to use Micronaut Swagger/OpenAPI documentation generator feature. We included the…
Chocksmith
  • 1,188
  • 2
  • 12
  • 40
2
votes
2 answers

Bug in OpenAPI generator? Wrong format for the example value of date datatype

I'm using a openapi-generator-maven-plugin with 4.2.3 version. My configuration looks like this: OffsetDate=LocalDate
K2mil J33
  • 167
  • 2
  • 14
2
votes
1 answer

generating swagger.json with backwardly compatible enum using serializeAsV2

Recently I upgraded my api from netcore2.1 to netcore3.1 I was hoping not to ask the api users to re-write their client. Thus I expect I need the swagger.json to be backwardly compatible. In the old swagger.json an enum would look like But now it…
Kirsten
  • 15,730
  • 41
  • 179
  • 318
2
votes
0 answers

How to refer to the array element in a link response?

I want to return a list of elements, by only providing the IDs. Then I want to tell the user that they can retrieve the individual details by calling the get element api. Problem is I'm not sure about the syntax, can you check this out? paths: …
Phate
  • 6,066
  • 15
  • 73
  • 138
2
votes
0 answers

How to extract only the required fields from an OpenAPI schema?

I have an OpenAPI definition in JSON format that I have uploaded to SwaggerHub. The OpenAPI definition has one API method that has a substantial payload. Is it possible, via SwaggerHub or some other tool, to only extract the required fields so I can…
David
  • 1,203
  • 6
  • 25
  • 48
2
votes
0 answers

@Timed and @Metered doesn't work for methods for Dropwizard with metrics-jersey2 and generated API interfaces

I have a Dropwizard project which has resources based on generated Java interfaces, Resource looks like: @Path("/foo") public class FooResource implements FooApi { @Override // This method overrides the one from FooApi interface public…
Vladimir
  • 281
  • 3
  • 6
2
votes
1 answer

OpenAPI 3 python-flask: how to use multiple content types in response

In the OA3 documentation it states that you can have multiple response content types like this: paths: /users: get: summary: Get all users responses: '200': description: A list of users content: …
Mike Furlender
  • 3,869
  • 5
  • 47
  • 75
2
votes
3 answers

How to tell OpenAPI to use context-root of application in it's URL

I am running two different Payara Micro microservices in one cluster. The issue I have is that when I try to access the OpenAPI URL of MyApp1 like http://mylink.com/myApp1/openapi it does not work. It actually works when I use URL…
FourtyTwo
  • 734
  • 8
  • 19
2
votes
1 answer

openAPI 3.0 is not showing try it out button for API endpoints

I've configured my api with swagger openapi3.0, unfortunately, it is not showing try it out button for my API endpoints. am I missing any configuration in the swagger file? can anyone help me how to solve this error? Note: I'm using swagger open…
ajay
  • 328
  • 1
  • 5
  • 17
2
votes
1 answer

How to combine two components using allOf in openapi yaml specification?

I try to generate java model classes from yaml specification using openapi-generator-maven-plugin:3.3.4. In one component I have allOf parameter trying to combine two different components by their refs. It goes like: Flight: allOf: -…
Besanouno
  • 33
  • 1
  • 5
2
votes
2 answers

Why does the addition of a dependency in Maven trigger functionality?

I have a simple question: I'm just getting started with Open API 3. For this purpose I have added the following dependency in Maven. org.springdoc
VolkanCP
  • 63
  • 5
2
votes
0 answers

NSwag creating duplicate model

I am using NSwag to generate an OpenApi3 spec from my controllers. I also use a custom implementation of IDocumentProcessor to generate models not included in the controllers. The post processor models share abstract classes with the controller…
Codendaal
  • 514
  • 6
  • 14
2
votes
0 answers

Xml documewntation for Asp.Net.Core webapi with Swagger

Im using asp net core 3.1 web api. I want to include xml documentation to swagger ui. Im using de following methods in ConfigureServices: services.AddOpenApiDocument(...) and there in Configure: app.UseOpenApi(); app.UseSwaggerUi3(); Im a bit…
user10980347
2
votes
1 answer

How to define an operation with both body and header parameters in OpenAPI 2.0?

How can a OpenAPI 2.0 (Swagger 2.0) definition have a body and a header parameter in the same operation? I tried the following: /image-correction: post: operationId: image-correction_create tags: - image-corrections …
koukou
  • 65
  • 1
  • 7