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

TypeError() return the expected Class as last exception argument #2147

Merged

Conversation

JohnPreston
Copy link
Contributor

@JohnPreston JohnPreston commented Apr 17, 2023

When the validator is used instead of the AWSProperty class (i.e. in WAFv2 for Statement), the TypeError() will return the expected AWSProperty SubClass as the last argument. This enables other libraries to identify the expected class and perform manipulations to import the resource property class.

For simpler class types (int, str, etc.) the validators only validate that the input is of that exact type and is simpler to catch.

Went over all the validators, these are the only two with an AWSProperty type validation, for due diligence. Although only need this today with WAFv2

@markpeek markpeek merged commit b241a05 into cloudtools:main Aug 12, 2023
@markpeek
Copy link
Member

Thank you for the PR and sorry for the delay in merging.

@JohnPreston JohnPreston deleted the feature/type-error-complex-types branch August 14, 2023 04:42
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