-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Schemas #190
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #190 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 10 10
Lines 1209 1253 +44
Branches 224 232 +8
=====================================
+ Hits 1209 1253 +44 |
@@ -32,11 +32,21 @@ class Validator(NamedTuple): | |||
check_fields: bool | |||
|
|||
|
|||
class Schema: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a docstring and/or comment would be helpful here to know what this class is for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do, I need to do docs for this in general.
Needs docs, but otherwise think this is ready. |
@samuelcolvin PR looks great! When you're plan to merge and release change? |
Just needs docs. I'll do it soon. |
* starting Arguments * arguments validator WIP * working on validate_args_pair * arguments validator compiling * starting tests * WIP JSON args mapping * fix argument mapping for json * fix tests, add comment about build_args * tweaking argument errors * missing tuple args * fix tuple tests * using new errors * mapping positional arguments * fix too_long and too_short errors * linting * converting kwarg errors * improve coverage * improve coverage * add always_validate_kwargs * allow *args with zero arguments * fix extra args with args mapping * error on repeat arguments * validator decorator and more coverage * skip positional only args tests for <3.10 * fix for python <3.10 * separate build_validate_generic_mapping * Arguments, take 2 (pydantic#203) * WIP moving to lookup item for args * Arguments take 2 * adding var_args and var_kwargs handling * new arguments logic working * fixing tests * Non-default argument follows default arguments * test aliases * test kwargs * fix unexpected_positional_argument * improve coverage * PyArgs use tuple, not list * coverage and tweaks
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