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
Merged

Correct path in nested models #437

merged 3 commits into from Mar 28, 2019

Conversation

@kataev
Copy link
Contributor

@kataev 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
Copy link

@codecov 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

Copy link
Owner

@samuelcolvin samuelcolvin left a comment

otherwise looks good, thank you.

tests/test_error_wrappers.py Outdated Show resolved Hide resolved

def test_nested_error():
class NestedModel1(BaseModel):
class NestedModel2(BaseModel):
Copy link
Owner

@samuelcolvin samuelcolvin Mar 28, 2019

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]

Copy link
Contributor Author

@kataev kataev Mar 28, 2019

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
Copy link
Owner

@samuelcolvin samuelcolvin Mar 28, 2019

please add PR number here as per other entries.

Copy link
Contributor Author

@kataev kataev Mar 28, 2019

np

Copy link
Owner

@samuelcolvin samuelcolvin Mar 28, 2019

also will need resolve conflicts.

Copy link
Contributor Author

@kataev kataev Mar 28, 2019

yep, already

@kataev
Copy link
Contributor Author

@kataev kataev commented Mar 28, 2019

Well, what next?

@samuelcolvin samuelcolvin merged commit fa65a07 into samuelcolvin:master Mar 28, 2019
7 checks passed
@samuelcolvin
Copy link
Owner

@samuelcolvin 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
Copy link
Contributor Author

@kataev 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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants