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

OpenApi 3.0 Exclude Internal api definition

We have a requirement to generate multiple definitions of an API using the Php annotations. While generating api spec(json/yml), need to exclude internal api which we should not expose to outside world. And i am using swagger to generate the api…
Naveen BT
  • 115
  • 4
  • 11
2
votes
0 answers

Is there a way to merge a yaml with external references?

In my project, in order to keep the api yaml clean I use a lot of external references, for example: ApiResponse: allOf: - $ref: 'includes/apiresponse.yaml#/GenericResponse' Would it possible to generate, along with the code, also a yaml that…
Phate
  • 6,066
  • 15
  • 73
  • 138
2
votes
1 answer

Swagger Editor 3.8 examples not working for reference array schema

This question is a follow-up to this similar one - as @Helen requested a new question be asked. It seems an array type schema only accepts "example", not "examples". The following schema produces an error on the editor.swagger.io site: info: …
user9645
  • 6,286
  • 6
  • 29
  • 43
2
votes
1 answer

Is it possible to 'inject' reference to a JSON Schema

Considering I need to refer to a json with the following format: { "data": { "type": "ObjectA" } } When I write JSON schema (or more specifically, schema object of OpenAPI Specification v3.0.3) for this json request, I…
Howard Liu
  • 93
  • 1
  • 11
2
votes
1 answer

Swagger - how to show a more complex response example - ASP.net Core Web API

I have a swagger definition and I'm using XML comments to describe the request and response and give meaningful samples. Example model as follows: /// Created item information. public class ItemCreated { /// Outcome…
Rob
  • 6,819
  • 17
  • 71
  • 131
2
votes
0 answers

Default Header OpenAPI 3.0 | Java Jaxrs-RestEasy

In my project all endpoints recives 3 default headers params. I would like to define this just once. Now I'm just setting this 3 params to every endpoint @Parameter(name = "app-key", in = ParameterIn.HEADER, required = true, schema = @Schema(type =…
Téo Ribeiro
  • 135
  • 1
  • 7
2
votes
2 answers

ASP.net Core Web API - correct swagger annotations

I am writing a Web API and have defined a controller with various GET, POST methods etc. I am using Swagger Open API for my documentation and want to understand the correct way to annotate. Here's an example of a controller method I have: ///…
Rob
  • 6,819
  • 17
  • 71
  • 131
2
votes
0 answers

ServletContextAware bean getting initialized too early when using @SpringBootTest with @AutoConfigureMockMvc

I'm seeing an odd issue when using @SpringBootTest with @AutoConfigureMockMvc. I have a SpringBoot project setup with an application.yaml file that provides a custom server.servlet.context-path, this value is used in a platform layer, using a…
Tim Biggin
  • 21
  • 2
2
votes
0 answers

List of enum values in OpenAPI

I am trying to create an endpoint that returns the possible values of an enum with OpenAPI specification and I don't see how to do it reusing the already defined enum. Is it possible to do it and if so what should be the best practice? Edit: This is…
joseprupi
  • 317
  • 4
  • 13
2
votes
1 answer

Google endpoint path template "Path does not match any requirement URI template."

Hi to all I created and used openAPI by yaml and I created endpoint that maps 2 cloud functions which use path templating to route the call no error by google sdk cli. Now I call by POST…
2
votes
0 answers

Terraform clone git repo at plan or init stage

Context: I am building API Gateway with OpenAPI Specifications 3.0 using terraform. I have got the api-spec.yaml file in a different repo from the terraform code. So, here's what I have done so far. Using null_resource to clone the repo at the…
dShringi
  • 1,497
  • 2
  • 22
  • 36
2
votes
1 answer

how to fix Flask RESTful api server endpoint failing problem?

I am new to api development using openapi sepc, so I followed this blog where I just used server artifact to understand the code. I used /openapi/photo_album/codegen_server for my simple work. To do so, I downloaded the file and tried to run server…
kim
  • 556
  • 7
  • 28
2
votes
1 answer

Audience parameter is missing from Bearer Token while using Swagger (swashbuckle v5.3.1) with Asp.net Core 3.1.1

Jwt Authentication section from Startup.cs: services.AddAuthentication(options => { options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; }) .AddJwtBearer(options => { …
2
votes
1 answer

Openapi generator: is it possible to exclude some headers from auto generated code parameters?

I want to support some "infrastructural" headers and use them to describe my api but, in the generation phase, I don't want those headers to show up as parameters in the code. I will take care of them by using specific means such as interceptors. Is…
Phate
  • 6,066
  • 15
  • 73
  • 138
2
votes
1 answer

Allow null values in JSON response from python-flask swagger app?

I am using swagger/openAPI 3.0.0 to generate a python3-flask API. This API gives JSON responses. If the value for a property of my JSON response is None I need it to come out as null in the response. Instead, the property is getting completely…
Mike Furlender
  • 3,869
  • 5
  • 47
  • 75