Share header with multiple response objects
See original GitHub issueCan there not just be a simple header generically at the response level not specific to each of the status codes? For our case, this kind of header is 99% the same across our codebase.
---
responses:
200:
description: no error
headers:
Content-Type:
description: application/json
type: string
It would be a pain to copy+paste this to each and every routine that supports HTTP JSON responses.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:10
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Standard for adding multiple values of a single HTTP Header ...
It MUST be possible to combine the multiple header fields into one "field-name: field-value" pair, without changing the semantics of the message, by...
Read more >How to Set a Header on a Response with Spring 5 - Baeldung
If we want to set headers on single responses, we can use HttpServletResponse or ResponseEntity objects. In contrast, if our objective is to ......
Read more >HTTP headers - MDN Web Docs - Mozilla
Request headers contain more information about the resource to be fetched, or about the client requesting the resource. Response headers hold ...
Read more >HTTP/1.1: Header Field Definitions
The Accept request-header field can be used to specify certain media types which are acceptable for the response. Accept headers can be used...
Read more >Common Response Headers - Amazon Simple Storage Service
Specifies whether the object returned was (true) or was not (false) a delete marker. Type: Boolean. Valid Values: true | false. Default: false....
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
Obviously the example is bad. consider the following model:
Codes like 401, 403, 404, 406, 408 will repeat through all paths. If one could add this to a generic section and selectively overwrite it, it’d be great. Having 50 paths and adding that block over and over again ist just pain.
@webron Fine: content-length, Transfer-encoding, Range, … how obscure do I need to get? 😃