Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add intEnum validation to NodeValidationVisitor #2357

Merged

Conversation

maximk000
Copy link
Contributor

Background

Adds a new plugin to validate intEnums in NodeValidationVisitor. Previously you could provide values outside of the allowed set without failing validation. IntEnum Shapes also qualify as Integer Shapes, so they will pass through the same validation as Integer Shapes in validateNaturalNumber() to make sure floats aren't provided.

Testing

Added test cases:

  • two for valid values defined by the intEnum
  • one for wrong shape
  • one for a number with a floating point, similar to Integer tests

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@maximk000 maximk000 requested a review from a team as a code owner July 25, 2024 21:30
@maximk000 maximk000 requested a review from sugmanue July 25, 2024 21:30
@maximk000 maximk000 force-pushed the intenumplugin-nodevalidationvisitor branch from 6e4f61c to b30e759 Compare July 25, 2024 21:45
Co-authored-by: Manuel Sugawara <[email protected]>
@sugmanue sugmanue merged commit 31a6498 into smithy-lang:main Jul 26, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants