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

Providing a custom_schema results in 2x validation #1899

Open
braingram opened this issue Feb 4, 2025 · 0 comments
Open

Providing a custom_schema results in 2x validation #1899

braingram opened this issue Feb 4, 2025 · 0 comments

Comments

@braingram
Copy link
Contributor

asdf/asdf/_asdf.py

Lines 583 to 592 in 9d7ff2e

def _validate(self, tree, custom=True, reading=False):
with self._blocks.options_context():
# If we're validating on read then the tree
# is already guaranteed to be in tagged form.
tagged_tree = tree if reading else yamlutil.custom_tree_to_tagged_tree(tree, self)
schema.validate(tagged_tree, self, reading=reading)
# Perform secondary validation pass if requested
if custom and self._custom_schema:
schema.validate(tagged_tree, self, self._custom_schema, reading=reading)

Investigate what would be required to consolidate these 2 calls to validate into 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant