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

fix: support custom root type with nested models in parse_obj #2238

Merged
merged 1 commit into from Feb 13, 2021

Conversation

PrettyWood
Copy link
Member

@PrettyWood PrettyWood commented Jan 5, 2021

Change Summary

Allow to parse nested models with __root__. To do that we can do a check in the __init__ function or simply ensure __root__ key is present when needed in validate.
The latter option has been chosen.

Related issue number

closes #1193
closes #2100

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)

@codecov
Copy link

codecov bot commented Jan 5, 2021

Codecov Report

Merging #2238 (4e8bf4d) into master (13a5c7d) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master     #2238   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         4199      4199           
  Branches       854       854           
=========================================
  Hits          4199      4199           

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 13a5c7d...4e8bf4d. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot parse nested object with custom root type Custom Root Types - validate(), dict() not as expected
2 participants