Questions tagged [oas3]

For questions regarding API specifications written using the OpenAPI Specification, Version 3 or above. Aside from [oas3], please include any additional tags that may relate tools or programming languages being used to process specifications; e.g., [swagger], [java], [php] etc.

From Swagger's official documentation:

The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined, a consumer can understand and interact with the remote service with a minimal amount of implementation logic.

13 questions
4
votes
1 answer

OpenApi: How to define cookie in response?

OpenApi allows to define cookies in request parameters. But for response all I could find is either custom headers (signal general presence of Set-Cookie, but no clue about particular cookie) or rolling custom extension (which is also very limiting,…
Agent_L
  • 4,960
  • 28
  • 30
3
votes
1 answer

Is there a way to generate an interactive documentation for Rails APIs?

I mean something like the interactive documentation that generate FastApi, but for a Rails API. I know there is rswag, but to use this I need to write the Rspec files with the description of my endpoints in others files and then generate the json or…
Andrés
  • 65
  • 7
2
votes
1 answer

How to specify a multipart form field is optional in OpenAPI/Swagger v3?

I'd like to outline a multipart form request body, with some fields which are required, and other fields which are optional. Generally, in OAS Schema Objects, all properties not explicitly marked with required: true are defaulted to optional.…
aware
  • 118
  • 1
  • 9
2
votes
0 answers

How to add multiple examples to a Swagger schema?

I'm using Swagger with OAS3, since I need anyOf support. I have an API call that can take one of 2 possible schemas, an account or an address. The schema works well in Swagger: it shows, and validates. But the example value shows only the first…
Traveling Tech Guy
  • 27,194
  • 23
  • 111
  • 159
1
vote
0 answers

Swagger response body missing for failure responses when the Success response Media Type is image/png

I use Swagger OAS3 and trying to display an elaborated error message when the endpoint which is supposed to return an image fails. When I set the MIME type of the success response to image/png, the *Response body doesn't appear if an error is…
Isha
  • 11
  • 3
1
vote
0 answers

OAS3 - Request Body's inner object content type

Is it possible to have content type for a request body's inner object in OAS3 and get it displayed in the swagger UI's generated curl command when invoking the call? Is this a supported feature in OAS3? An example is given below. Reporter is the…
0
votes
1 answer

Annotation of Generic Java Types and Nested Arrays for Open Api Documentation

I got a little Spring Boot web service that allows you to build and query graph models. In order to reliably integrate other services with this service, I'm trying to describe the code using the io.swagger.v3.oas.annotations to generate some oas3…
0
votes
0 answers

how to handle sub domains in open api spec?

I am preparing open api spec 3.0 for an external system hosted by Government. I am lacking to handle subdomains. There are two endpoints available as per Edgar and API Documentation www.sec.gov data.sec.gov I came up with server details for Open…
Mayank
  • 11
  • 2
0
votes
0 answers

How to convert a multi-file open api 2.0 definition to 3.0 spec definition without changing the file structure

I have multi-file open api 2.0 definition, main file is called main_openapi.yaml that contains the top level fields and further details are in separate files. I want to convert this definition to 3.0 spec definition without changing the folder…
0
votes
0 answers

OAS3: How to constrain the keys of JSON objects to a particular enum definition?

In JSON, I have an object for which the possible values of the keys are constrained to an enum: { "res1" : { ... }, "res2" : { ... }, "res3" : { ... } } How do I represent in OAS3 that the key itself must be a member of the following…
al.truisme
  • 450
  • 2
  • 11
0
votes
0 answers

oas3 kotlin codegenerator: using multipart/form-data and free-form JSON object in the same request

I'm using OAS3 codegenerator to create Kotlin server code for a request containing both a file-upload, and a free-form json object that can contain arbitrary values. According to the swagger documentation, I should be able to create a free-form…
matt freake
  • 4,877
  • 4
  • 27
  • 56
0
votes
0 answers

In OAS3.0, Can you set the required fields in a request body of fields in a "oneOf" or "anyOf"

This question relates to Open API spec 3 and writing API specifications. I have been trying to work out how to set fields as required for a specific method requestBody when I am using a "oneOf" in a schema object. I know how to set required fields…
0
votes
1 answer

request entity too large error when using oas3-tools package,openapi 3.0 in node.js

index.js file 'use strict'; var path = require('path'); var http = require('http'); var cors = require('cors'); var oas3Tools = require('oas3-tools'); require("dotenv").config({ path: ".env" }); console.log(`### Running on…