Reputation: 501
I have added added few error code in the swagger responses section: 201, 3XX, 400, 401, 4XX, 5XX.
Also, as per swagger2.0 doc you can have: "The following range definitions are allowed: 1XX, 2XX, 3XX, 4XX, and 5XX. If a response range is defined using an explicit code, the explicit code definition takes precedence over the range definition for that code."
But still I get the error: "should NOT have additional properties. additionalProperty: 3XX, 4XX, 5XX"
Any clue?
Upvotes: 2
Views: 10361
Reputation: 97540
That quote is from the OpenAPI 3.0 Specification, not 2.0.
The 2.0 spec does not support wildcard response codes. You need to use specific codes, such as 200
, 400
, 404
, etc., and you can use the default
response to match all HTTP codes that are not covered individually by your spec.
Upvotes: 3