Open pablo-develop opened 4 years ago
As far as I can tell, Swagger 2.0 specification does not support examples for form data. We do generate an example
field for form data parameters, but it should not be there according to the spec.
However, it seems to me that Swagger UI might support x-example
field for form data. If someone can figure out if that works, a PR fixing this would be welcome. I.e. now we generate Swagger like this for formData (for the example above):
"parameters": [
{
"in": "formData",
"name": "my-spec",
"description": "description",
"type": "string",
"required": true,
"title": "example.server/my-spec",
"example": "swagger-example"
}
]
Maybe it would work if it was like this?
"parameters": [
{
"in": "formData",
"name": "my-spec",
"description": "description",
"type": "string",
"required": true,
"title": "example.server/my-spec",
"x-example": "swagger-example"
}
]
I would expect to see the the same example for both use cases (
:body
and:form
) but thats not the casehere is a reproducible example: