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

Serialize only __root__ value #752

Merged
merged 8 commits into from Aug 17, 2019

Conversation

@dmontagu
Copy link
Collaborator

dmontagu commented Aug 16, 2019

Change Summary

Converts .json() to return the contents of the __root__ key for models with a custom root.

Related issue number

#730

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>.rst file added describing change
    (see changes/README.md for details)
David Montague
@dmontagu dmontagu force-pushed the dmontagu:serialize-custom-root branch from 2711e2f to 492f4b2 Aug 16, 2019
David Montague
David Montague
@codecov

This comment has been minimized.

Copy link

codecov bot commented Aug 16, 2019

Codecov Report

Merging #752 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #752   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          15     15           
  Lines        2723   2726    +3     
  Branches      536    537    +1     
=====================================
+ Hits         2723   2726    +3
Copy link
Owner

samuelcolvin left a comment

otherwise looks good.

docs/examples/custom_root_field.json Show resolved Hide resolved
docs/index.rst Outdated Show resolved Hide resolved
docs/index.rst Outdated Show resolved Hide resolved
pydantic/main.py Outdated Show resolved Hide resolved
dmontagu and others added 5 commits Aug 16, 2019
Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
David Montague
@samuelcolvin samuelcolvin merged commit 65d838a into samuelcolvin:master Aug 17, 2019
9 checks passed
9 checks passed
Header rules No header rules processed
Details
Pages changed 4 new files uploaded
Details
Redirect rules No redirect rules processed
Details
Mixed content No mixed content detected
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
samuelcolvin.pydantic Build #20190817.12 succeeded
Details
samuelcolvin.pydantic (Job Python36) Job Python36 succeeded
Details
samuelcolvin.pydantic (Job Python37) Job Python37 succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.