Reference Response headers Open API v3.0
See original GitHub issueI’ve been experimenting trying to break my large file into smaller and easier to handle files. I may be completely miss understanding part of the documentation where it says Headers can be a reference object.
But how come this doesn’t validate in the 3.0.
/Account:
parameters:
- $ref: #/components/parameters/userAgent
- $ref: #/components/parameters/installationID
get:
tags:
- Account
summary: Gets a list of Accounts
description: Returns a list containing all Accounts. The list supports paging.
operationId: listAccounts
responses:
200:
description: A list of AchAccount
content:
'*/*':
schema:
$ref: '#/components/schemas/Accounts'
headers:
$ref: #/components/responses/DefaultHeaders/headers
500:
$ref: #/components/responses/StandardErrorResponse
default:
$ref: #/components/responses/TotallyUnexpectedResponse
parameters:
- $ref: #/components/parameters/offline_filter
- $ref: #/components/parameters/limit_filter
- $ref: #/components/parameters/page_filter
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Describing Responses - Swagger
OAS 3 This guide is for OpenAPI 3.0. ... A response is defined by its HTTP status code and the data returned in...
Read more >OpenAPI Specification v3.1.0 | Introduction, Definitions, & More
The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs.
Read more >OpenAPI 3.0 Domain Example | SwaggerHub Documentation
Below is an example of an OpenAPI 3.0 domain definition ... OpenAPI version identifier - required for OpenAPI 3.0 domains openapi: 3.0.0 ......
Read more >How to define header parameters in OpenAPI 3.0?
But in Swagger 3.0.0 parameters are replaced by request bodies. This is only true for form and body parameters. Other parameter types (path, ......
Read more >Working with OpenAPI definitions for HTTP APIs
You can define your HTTP API by using an OpenAPI 3.0 definition file. Then you can import the definition into API Gateway to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
headers
is a map of header names to response header definitions (aka Header Objects). The “value” of a header name can be an inline definition, or a$ref
to a definition stored elsewhere (either in the current file or an external file). Within the current OpenAPI document, response headers can be stored in the#/components/headers
section.Note that you can only
$ref
individual headers but not the entireheaders
section.Hope this helps!
@bolshoydi you can’t, you can only
$ref
individual response headers - as shown in the example. However, there are existing feature requests to improve header reuse: Share header with multiple response objects Structural improvements: enhance headers handling