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
Definition schema class #135
Definition schema class #135
Conversation
the purpose of these changes was to let DefinitionSchema behave like a proper dictionary to allow safe runtime-manipulation of a schema. if such manipulation raises an exception that is handled, the previous state is retained. while working on it, i stumbled over some issues that are addressed. to have more descriptive and unambigious names: - renames ValidationError to DocumentError - renames ERROR_SCHEMA_TYPE to ERROR_SCHEMA_TYPE_TYPE - ERROR_SCHEMA_CONSTRAINT_TYPE_TYPE would be more correct - renames ERROR_SCHEMA_FORMAT to ERROR_SCHEMA_TYPE - adds a ERROR_SCHEMA_CONSTRAINT_TYPE for constraints that are not defined as mapping other: - exceptions are inherited from Exception, so they are not caught by `except ValueError`
9e1fa72
to
ac08315
Compare
i added some commits to purge the in-code-backlog well, more tests would be possible. :-/ |
e5e4c36
to
0b8fc4f
Compare
@@ -51,6 +51,9 @@ matters, we can use it to validate all odd values: | |||
>>> v.validate({'oddity': 9}) | |||
True | |||
|
|||
In a schema schema you can use space characters instead of underscores, e.g. | |||
``{'oddity': {'is odd': 42'}}`` is an alias for ``{'oddity': {'is odd': 42'}}``. |
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.
?
Nice. Would you also update CHANGES to reflect the change from ValidationError to DocumentError, and error constants which have changed names? |
0b8fc4f
to
2e39ac9
Compare
also a little refactoring of error-messages
includes fixes: - normalizes unknown fields per `allow_unknown` - normalizes unknown fields in subdocuments - allows empty `schema`-rule-definitions
2e39ac9
to
02d8159
Compare
also removes an obsolete check when validating a dict for 'schema'-rule
a'ight, i added the last commits to this pr. |
this includes a commit that improves DefinitionSchema and one that fixes an issue that came up in the doctests for the first time.