Closed j-waters closed 2 years ago
I think you should use "style" and "explode" instead of oneOf.
https://github.com/jhthorsen/json-validator/blob/master/t/openapiv3-style-explode.t https://swagger.io/specification/#parameter-object
Also if I am wrong, please check if you get any errors in the v5_oh branch: https://github.com/jhthorsen/json-validator/pull/251
Steps to reproduce the behavior
My OpenAPIv3 has an endpoint with the following parameter:
Expected behavior
This is a valid OpenAPIv3 spec, so it should be validated without any errors
Actual behavior
Upon validating an incoming request to
http://localhost/PATH?&email=test@email.com
, I get the following error:It seems that
_coerce_parameter_format
is turning the property value intoWhich explains why it complains that we're providing an object when instead we're providing a string.
Changing the spec so it's just
Doesn't help, it just changes the error to
/email: /oneOf Expected string - got object