Closed joypeterson closed 8 years ago
At the beginning of validator.js where the types var is declared, the value of the consumes property is declared as
consumes: { type: 'string', pattern: /multipart\/form-data|application\/x-www-form-urlencoded/, required: true },
However, with the current version of Swagger, consumes is coming in as an array. e.g.
[ 'multipart/form-data' ]
I think the schema for consumes needs to be updated to
consumes: { type: 'array', required: true, items: { type: 'string', pattern: /multipart\/form-data|application\/x-www-form-urlencoded/ }, minItems: 1, uniqueItems: true },
This appears to be working correctly in my limited testing, but I am fairly new to Swagger so I might be missing something.
If backwards compatibility is desired, it could be updated to:
consumes: { oneOf: [ { type: 'array', required: true, items: { type: 'string', pattern: /multipart\/form-data|application\/x-www-form-urlencoded/ }, minItems: 1, uniqueItems: true }, { type: 'string', pattern: /multipart\/form-data|application\/x-www-form-urlencoded/, required: true } ] },
I now see that this was fixed by pull request #55. I will submit a pull request to update the unit tests in order to prevent a regression.
Resolved, thanks.
At the beginning of validator.js where the types var is declared, the value of the consumes property is declared as
However, with the current version of Swagger, consumes is coming in as an array. e.g.
I think the schema for consumes needs to be updated to
This appears to be working correctly in my limited testing, but I am fairly new to Swagger so I might be missing something.
If backwards compatibility is desired, it could be updated to: