Yelp / swagger_spec_validator

Other
104 stars 71 forks source link

Validate array definitions #95

Closed macisamuele closed 6 years ago

macisamuele commented 6 years ago

Fixes #94

The PR adds an additional check on schema objects to ensure that if type is array then items attribute has to be present.

I've tried to modify the schema in order to avoid an additional python method but it was overly complicated and hard to maintain (also checked swagger-tools npm package implementation)

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.02%) to 98.205% when pulling 53d6c44caa1d424f646e340abf400503974fbc3c on macisamuele:maci-ensure-items-is-required-if-type-array into 40e1cc926775777ff2d56e271fd61697c6235579 on Yelp:master.

macisamuele commented 6 years ago

The check will work only for objects in #/definitions/ as inline definitions are not checked yet (#96)