-
Notifications
You must be signed in to change notification settings - Fork 279
Closed
Labels
type:bugA broken experienceA broken experience
Milestone
Description
consumes in global context is not propagated to the request body
We need to fix it in a similar way to how we fixed produces in #267 and #398.
{
"swagger": "2.0",
"info": {
"title": "Two responses",
"version": "1.0.0"
},
"schemes": [
"https"
],
"basePath": "/",
"paths": {
"/items": {
"post": {
"responses": {
"200": {
"description": "An OK response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Item"
}
}
},
"default": {
"description": "An error response",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"parameters": [
{
"name": "name",
"in": "formData",
"description": "Updated name of the pet",
"required": false,
"type": "string"
}
]
},
"patch": {
"responses": {
"200": {
"description": "An OK response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Item"
}
}
},
"default": {
"description": "An error response",
"schema": {
"$ref": "#/definitions/Error"
}
}
},
"produces": [
"application/json",
"application/xml"
],
"consumes": [
"application/json",
"text/plain"
],
"parameters": [
{
"name": "name",
"in": "formData",
"description": "Updated name of the pet",
"required": false,
"type": "string"
}
]
}
}
},
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"definitions": {
"Item": {
"properties": {
"id": {
"type": "string",
"description": "Item identifier."
}
}
},
"Error": {
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"fields": {
"type": "string"
}
}
}
}
}
With the above document, the media type added to POST does not respect the "application/json" defined in the global level.
Metadata
Metadata
Assignees
Labels
type:bugA broken experienceA broken experience