If you will try to use jsonschema`s Draft4Validator to
validate swagger.json, generated by flask-swagger, then
will discover it is failing, trying to match numerical
HTTP status codes from responses agains this piece
of Swagger 2.0 spec:
"responses": {
"type": "object",
"description": "Response objects names can either be any valid
HTTP status code or 'default'.",
"minProperties": 1,
"additionalProperties": false,
"patternProperties": {
"^([0-9]{3})$|^(default)$": {
"$ref": "#/definitions/responseValue"
},
"^x-": {
"$ref": "#/definitions/vendorExtension"
}
}
}
If you will try to use jsonschema`s Draft4Validator to validate swagger.json, generated by flask-swagger, then will discover it is failing, trying to match numerical HTTP status codes from responses agains this piece of Swagger 2.0 spec:
This fix just coerse responses keys to strings.