Fix issues with connection validation #108
Merged
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.
Description
Currently, we use
field_validator
for validating if all endpoints in all connections exist. However, the problem with this approach is that it relies onchildren
of a routine being successfully validated prior to validating connections. In a likely event that a child fails to validate, the "children" key will not be present in validation data, and the validator for connections will fail with aTypeError
. This PR fixes this by reimplementing connection validator asmodel_validator
that runs iff per-field builtin validators run successfully (otherwise validating connection endpoints is meaningless).In addition, this PR fixes a hidden problem of incorrect loading of negative testcases for pydantic model validation. Currently, those tests passed trivially (!) because the loaded data consisted of tuples instead of dictionaries.
The documentation has not been updated because the changes are not user-facing, and modified internal parts are not described in the docs.
Please verify that you have completed the following steps