swagger-api / validator-badge

Validate your Swagger JSON/YAML today!
http://swagger.io
Apache License 2.0
210 stars 85 forks source link

validation failing when describing request body for post request using "style" and "explode" serialization strategy #177

Open JohnRDOrazio opened 3 years ago

JohnRDOrazio commented 3 years ago

When describing the request body for a post request using "style" and "explode" as serialization strategy for primitive types rather than defining "contentType" (used for more complex serialization strategies), the validation is failing.

Relative documentation is https://swagger.io/docs/specification/describing-request-body/ in the "Form Data" and "Complex Serialization in Form Data" sections.

The API I'm trying to validate is here: https://raw.githubusercontent.com/BibleGet-I-O/endpoint/master/openapi.json

I have defined it using swaggerhub, where it shows as being valid: https://app.swaggerhub.com/apis/JohnRDOrazio/BibleGet/2.8

If instead I try validating with the badge validator: https://validator.swagger.io/validator/debug?url=https://raw.githubusercontent.com/BibleGet-I-O/endpoint/master/openapi.json

I get these errors:

{"messages":["attribute paths.'/index.php'(post).requestBody.content.encoding.contentType is missing","attribute paths.'/metadata.php'(post).requestBody.content.encoding.contentType is missing"],"schemaValidationMessages":[{"level":"warning","domain":"validation","keyword":"format","message":"format attribute \"uri-reference\" not supported","schema":{"loadingURI":"#","pointer":"/definitions/Contact/properties/url"}},{"level":"warning","domain":"validation","keyword":"format","message":"format attribute \"uri-reference\" not supported","schema":{"loadingURI":"#","pointer":"/definitions/License/properties/url"}},{"level":"warning","domain":"validation","keyword":"format","message":"format attribute \"uri-reference\" not supported","schema":{"loadingURI":"#","pointer":"/definitions/Info/properties/termsOfService"}}]}