-
Notifications
You must be signed in to change notification settings - Fork 0
Relax validation on enum values deserialization #751
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #751 +/- ##
==========================================
- Coverage 94.43% 94.43% -0.01%
==========================================
Files 7 7
Lines 791 790 -1
==========================================
- Hits 747 746 -1
Misses 44 44 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable, if the API returns a valid result for an enum that's expecting a string then this should be fine
|
I have looked into potential backwards-compatibility issues with releasing this fix as a minor or patch release. TLDR, no issues. The change itself I would argue is a bug fix: we are replacing an unhelpful empty assertion error with a more useful As far as it relates to breaking existing releases of PyGranta packages, I do not believe there are any cases where this is possible. Reasoning below:
Making both the changes here and the changes to the Enum definition result in successful use of the bulk endpoint, with a warning that we're falling through to an undeserialized object as expected. If I make only the changes in this PR, I get the helpful message If I make only the changes to the template, I get the unhelpful assertion |
|
I unfortunately have to close this PR and recreate it with a different branch name to get it to correctly create the changelog as a bug fix. |
Sister PR on openapi-client-template https://github.com/ansys/openapi-client-template/pull/235
Relax validation on deserialization of data for enums. Enums raises sufficiently helpful exceptions when provided with an invalid value.