Skip to content

Properly formatting UUID if value to be unmarshalled is already a UUID. #112

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 4 commits into from
Mar 22, 2019

Conversation

diogobaeder
Copy link

Before this change, if a UUID instance got received as value in the Schema, it was breaking the unmarshal because UUID instances can't be used as values to instantiate other UUIDs.

An example of where this might happen is if you define a parameter with uuid format in a spec for a Flask app, and then use the <uuid> converter in the route path (for the Flask router), which converts the parameter to a UUID instance before it reaches the unmarshalling step.

Before this change, if a UUID instance got received as value in the
Schema, it was breaking the unmarshal because UUID instances can't be
used as values to instantiate other UUIDs.
@codecov
Copy link

codecov bot commented Feb 28, 2019

Codecov Report

Merging #112 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #112      +/-   ##
==========================================
+ Coverage    96.3%   96.31%   +0.01%     
==========================================
  Files          54       54              
  Lines        1462     1467       +5     
==========================================
+ Hits         1408     1413       +5     
  Misses         54       54
Impacted Files Coverage Δ
openapi_core/schema/schemas/models.py 95.15% <ø> (ø) ⬆️
openapi_core/schema/schemas/util.py 95.23% <100%> (+1.48%) ⬆️

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 aa978cb...aa206d8. Read the comment docs.

@diogobaeder
Copy link
Author

Hi,

Sorry to bother you, but any news on this one? I'm having to use str in place of UUID in a Flask-driven application because of this issue...

Thanks,
Diogo

@lbolla
Copy link

lbolla commented Mar 12, 2019

I'd love this to be merged, too!

@diogobaeder
Copy link
Author

Hi, any news on this one? Sorry to bother, but I really need this change...

@p1c2u p1c2u merged commit c846b2e into python-openapi:master Mar 22, 2019
@diogobaeder
Copy link
Author

Thanks man! :-)

bjmc pushed a commit to bjmc/openapi-core that referenced this pull request Jun 12, 2019
Properly formatting UUID if value to be unmarshalled is already a UUID.
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.

3 participants