Closed valscion closed 8 years ago
Oh wait, seems like I might've misunderstood the enum
type. It seems to be a validation for any instance type, not just a string. So everything IS working correctly here. Sorry :sweat_smile: and thanks for this great gem!
NP! Thanks for taking a shot at this. And yes, I need to get around to finishing #13. I'm sure there's some outlying problems that it would dredge up.
If I have understood correctly, JSON schema defines a
type
validator to pass if any of the types in the array pass. This gem however fails when thetype
is["string", "null"]
and also theenum
property is defined with no explicitnull
value.Funnily enough, this case passes the test:
Seems like if the
enum
array also has an explicitnull
in there, it is the only way to get an optional enum value to pass.I guess this issue might've been resolved by #13 already if that was done.