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

Schemas #190

Merged
merged 7 commits into from Jun 28, 2018
Merged

Schemas #190

merged 7 commits into from Jun 28, 2018

Conversation

@samuelcolvin
Copy link
Owner

@samuelcolvin samuelcolvin commented Jun 3, 2018

implement #129

Sadly the syntax I has hoped to use (tuples of default, Schema) doesn't work since tuple packing with variable type annotations turns out to be a syntax error (referenced in parsing python/typing#258) it works with parentheses but that's annoying.

Instead I've moved the default declaration into the schema

class FoobarModel(BaseModel):
    foo: int = Schema(4, title='Foo Title')
    bar: str = Schema(..., description='this description of bar')
@codecov
Copy link

@codecov codecov bot commented Jun 3, 2018

Codecov Report

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

@@          Coverage Diff          @@
##           master   #190   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          10     10           
  Lines        1209   1253   +44     
  Branches      224    232    +8     
=====================================
+ Hits         1209   1253   +44

@samuelcolvin samuelcolvin mentioned this pull request Jun 11, 2018
@@ -32,11 +32,21 @@ class Validator(NamedTuple):
check_fields: bool


class Schema:
Copy link

@dsully dsully Jun 11, 2018

Adding a docstring and/or comment would be helpful here to know what this class is for.

Copy link
Owner Author

@samuelcolvin samuelcolvin Jun 11, 2018

will do, I need to do docs for this in general.

@samuelcolvin
Copy link
Owner Author

@samuelcolvin samuelcolvin commented Jun 13, 2018

Needs docs, but otherwise think this is ready.

@Gr1N
Copy link
Contributor

@Gr1N Gr1N commented Jun 25, 2018

@samuelcolvin PR looks great! When you're plan to merge and release change?

@samuelcolvin
Copy link
Owner Author

@samuelcolvin samuelcolvin commented Jun 25, 2018

Just needs docs. I'll do it soon.

@samuelcolvin samuelcolvin merged commit dd8d013 into master Jun 28, 2018
5 checks passed
@samuelcolvin samuelcolvin deleted the schema branch Jun 28, 2018
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

3 participants