Open
Conversation
Make `enum` for number pass even when there's no `minimum` and `maximum`. Also, allow `enum` only if `minimum` and `maximum` are not set.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Member
Author
|
Some tests fail, but If this is good we can fix those and we can also do something similar to strings types. |
ioggstream
suggested changes
Oct 4, 2022
Contributor
ioggstream
left a comment
There was a problem hiding this comment.
- max/min + enum is OK to me
| minimum: 1 | ||
| ko_EnumAndMinMax: | ||
| type: number | ||
| enum: [3] |
Contributor
There was a problem hiding this comment.
This can be syntactically valid to me. I could for example validate boundaries before checking the enumeration.
Member
Author
There was a problem hiding this comment.
Makes sense.
We need to check if enum values are inside the min-max range though, I don't think it's possible with Spectral without a custom function.
Contributor
There was a problem hiding this comment.
@bfabio no need to push it that far for now. Probably spectral will do it for us in background today or tomorrow.
Co-authored-by: Roberto Polli <robipolli@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make
enumfor number pass even when there's nominimumandmaximum.Also, allow
enumonly ifminimumandmaximumare not set.