-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for header parameters to be objects #652
Comments
The simple types being allowed are those that have a simple string representation (without needing quotes or similar), and arrays of such have some ways of formatting (see How would such an object be represented? Simply one line of JSON? |
Preferably, the way it is specified for a body parameter, ie, to have a schema field. |
I just found that there currently is an Internet draft discussed in the HTTP working group. This basically defines a format to transport JSON arrays (while omitting the brackets) in HTTP headers. I guess this could work for custom headers with OpenAPI schema definitions for them. |
FYI we have accepted the change to allow schemas for all payloads, please see #654 |
(RFC only applies to newly created headers, as in the format for the header must already be defined as one that is a json representation, interesting consequence for yaml and other non json body media types) |
@fehguy But as I understand, there is not yet a definition which says how to serialize a JSON object/array/... into a header. My proposal was to adopt the one from the RFC, when it is done. @wparad yes, this only applies to new headers ... I was mainly thinking about custom headers defined by an API (which would fit "newly created headers"), or new standard headers which refer to that RFC (after it is published), and then need to be described in an API definition. This doesn't solve describing existing headers, for them we need a different solution. |
@ePaul sure, but let's put that on the appropriate ticket. This one is requesting that header parameters can be objects, which is accepted. |
Currently, Swagger 2.0 specifies a header parameter " is limited to simple types (that is, not an object)". Please allow header parameters to be of object type.
The text was updated successfully, but these errors were encountered: