Yelp / swagger_spec_validator

Other
104 stars 71 forks source link

Validation should fail when default does not match type #80

Closed bplotnick closed 6 years ago

bplotnick commented 7 years ago

According to the specification for param default:

Declares the value of the parameter that the server will use if none is provided, for example a "count" to control the number of results per page might default to 100 if not supplied by the client in the request. (Note: "default" has no meaning for required parameters.) See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. Unlike JSON Schema this value MUST conform to the defined type for this parameter.

This is not checked currently, and a spec with a param default of a different type (e.g. int when type is string, or non-array for array) will pass validation.