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

Correct path in nested models #437

Merged
merged 3 commits into from Mar 28, 2019

Conversation

Projects
None yet
2 participants
@kataev
Copy link
Contributor

kataev commented Mar 28, 2019

Hello, i find what first part of path is missed on errors in nested models.
Here the fix and tests.

@codecov

This comment has been minimized.

Copy link

codecov bot commented Mar 28, 2019

Codecov Report

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

@@          Coverage Diff          @@
##           master   #437   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          14     14           
  Lines        2157   2160    +3     
  Branches      426    427    +1     
=====================================
+ Hits         2157   2160    +3
@samuelcolvin
Copy link
Owner

samuelcolvin left a comment

otherwise looks good, thank you.

Show resolved Hide resolved tests/test_error_wrappers.py Outdated

def test_nested_error():
class NestedModel1(BaseModel):
class NestedModel2(BaseModel):

This comment has been minimized.

Copy link
@samuelcolvin

samuelcolvin Mar 28, 2019

Owner

this a bit confusing, no need to nest the class definitions, just

class NestedModel3(BaseModel):
    x: str

class NestedModel2(BaseModel):
    data2: List[NestedModel3]

class NestedModel1(BaseModel):
    data1: List[NestedModel2]

This comment has been minimized.

Copy link
@kataev

kataev Mar 28, 2019

Author Contributor

done

HISTORY.rst Outdated
@@ -7,6 +7,7 @@ v0.21.1 (unreleased)
....................
* add ``IPv{4,6,Any}Network`` and ``IPv{4,6,Any}Interface`` types from ``ipaddress`` stdlib, #333 by @pilosus
* add docs for ``datetime`` types, #386 by @pilosus
* fix path in nested models, by @kataev

This comment has been minimized.

Copy link
@samuelcolvin

samuelcolvin Mar 28, 2019

Owner

please add PR number here as per other entries.

This comment has been minimized.

Copy link
@kataev

kataev Mar 28, 2019

Author Contributor

np

This comment has been minimized.

Copy link
@samuelcolvin

samuelcolvin Mar 28, 2019

Owner

also will need resolve conflicts.

This comment has been minimized.

Copy link
@kataev

kataev Mar 28, 2019

Author Contributor

yep, already

Denis Kataev added some commits Mar 28, 2019

@kataev kataev force-pushed the kataev:master branch from fbad9c7 to b13c7c5 Mar 28, 2019

@kataev

This comment has been minimized.

Copy link
Contributor Author

kataev commented Mar 28, 2019

Well, what next?

@samuelcolvin samuelcolvin merged commit fa65a07 into samuelcolvin:master Mar 28, 2019

3 checks passed

codecov/project 100% (+0%) compared to caaa16e
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
@samuelcolvin

This comment has been minimized.

Copy link
Owner

samuelcolvin commented Mar 28, 2019

Awesome, thank you very much.

I'll try and wait for #428 to deploy, but if that takes a long time I'll deploy this in a few days. Hope that's okay.

@kataev

This comment has been minimized.

Copy link
Contributor Author

kataev commented Mar 28, 2019

Yep, no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.