Skip to content

Handle Unset Enums when deserializing #306

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

Merged
merged 2 commits into from
Jan 22, 2021

Conversation

bowenwr
Copy link
Contributor

@bowenwr bowenwr commented Jan 19, 2021

When an Enum is Unset during deserialization, it causes an error by attempting to instantiate it from UNSET.

@codecov
Copy link

codecov bot commented Jan 19, 2021

Codecov Report

Merging #306 (f1b3e4e) into main (abf906d) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #306   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           47        47           
  Lines         1385      1385           
=========================================
  Hits          1385      1385           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abf906d...f1b3e4e. Read the comment docs.

@bowenwr
Copy link
Contributor Author

bowenwr commented Jan 19, 2021

CC @dbanty. Good chance we have this issue other places as well but Enums were the ones ruining my day. 😬

emann
emann previously approved these changes Jan 20, 2021
Copy link
Collaborator

@emann emann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks as always @bowenwr 😄

Unrelated, but this makes me think that maybe we should look into hypothesis - I've never used it personally, but I think it would help us in covering edge cases like this that slip by unnoticed.

@bowenwr
Copy link
Contributor Author

bowenwr commented Jan 20, 2021

Thanks for a speedy review @emann (didn't there used to be a guitar in there?)! I don't have personal experience with hypothesis, but agree that property-based testing might help us catch a lot more.

@emann
Copy link
Collaborator

emann commented Jan 20, 2021

@bowenwr There was a guitar in there until I managed to steal @emann - it had been taken but inactive for 9 years and github gave it to me!

I also have no personal experience with hypothesis haha - I do think it could be useful here though, so I may look into it in the near future.

@bowenwr
Copy link
Contributor Author

bowenwr commented Jan 22, 2021

Thanks @emann! Anything blocking this from a merge?

@emann emann enabled auto-merge (squash) January 22, 2021 15:34
@emann
Copy link
Collaborator

emann commented Jan 22, 2021

@bowenwr nope, sorry! I've enabled auto-merge, if you could add a changelog entry and pull in the latest changes from main that'd be swell and it should merge automatically

@bowenwr bowenwr requested a review from emann January 22, 2021 16:13
@bowenwr
Copy link
Contributor Author

bowenwr commented Jan 22, 2021

@emann Done, thank you!

@emann emann disabled auto-merge January 22, 2021 16:57
@emann emann merged commit aa6972c into openapi-generators:main Jan 22, 2021
bowenwr added a commit to benchling/openapi-python-client that referenced this pull request Jan 28, 2021
bowenwr added a commit to benchling/openapi-python-client that referenced this pull request Jan 30, 2021
@eli-bl eli-bl deleted the fix-enums-unset branch November 22, 2024 19: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