Validation for empty enums
I was using this gem to check if a spec created programmatically was valid, using parser.valid?.
Yet, using this VSCode extension, I've noticed an error this gem wasn't able to catch.
According to the spec:
The value of this keyword MUST be an array. This array SHOULD have at least one element.
And my spec contained:
enum: []
The error from the extension is Array has too few items. Expected 1 or more.
Shouldn't this gem provide something similar?
Hey @jjercx, thanks for opening an issue.
As this is a "SHOULD" rather than a "MUST" this isn't validated against. This is because if it is empty it is still valid. If this project had a concept of warnings then this would be a warning rather than an error.