Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this this still WIP, the PR is intended to run travis' tests and discuss changes.
eventually it shall solve #107.
state of progress:
i haven't yet figured out why the tests do not fail when
assertSuccess
is used. but i think this is an important issue.i can confirm that referring
self.document
in cerberus.py#302 makes a difference.the failure was then caused by the fact, that in
_validate_schema
the validator copied itself and the copy then changed its schema-property which would then be reflected in the first validator, that would then continue validation with the subschema, causing the failure as therequired
field wouldn't exist in the higher context.therefore i changed the code, so a new instance of a validator was used, not a copy. (on that occasion i made sure a child-validator would inherit all
__init__
-parameters unless overwritten.now the problem is that in cerberus.py#227 a given
context
is always given precedence. which will fail if a subschema is to be validated. but omitting the context (cerberus.py#542) will lead to other failues.@nicolaiarocci i'd appreciate some advice at this point. especially the code in cerberus.py#227 seems rather strange to me. why would there be a
context
-parameter which always supersedes thedocument
-parameter? the calling code could / should figure what is to be validated.