-
Notifications
You must be signed in to change notification settings - Fork 59
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
adding custom validators using new extension API #1012
Comments
Does the material under Extending ASDF answer your question, particularly in the subsections Resources and resource mappings, Converters, Extensions, and Extension manifests? I didn't read carefully enough. Ed is on vacation until the end of next week, but I'll see if I can find a specific answer. |
We are looking into the steps necessary to move everything over to the new API so I looked through the new material (which is great btw.) The validators do not get mentioned from what I see and from a few short looks over the new code I could not see where the validator hooks would be now. |
This feature hasn't been implemented in the new API yet, but it's something we'll need to support. There's been some discussion of how we might implement it: #815 (comment) We need to put some thought into how we can restrict the scope of custom validators (maybe based on the schema's metaschema id) to avoid conflicts. |
thanks for looking into that (and digging out some of the older issues) I have switched everything over to the new API (which works really well) and just left an 'empty' legacy extension without any tag mappings to register the validators, seems to work nice so far 👍 |
old style (legacy) extensions allowed for custom validators, functions called when a particular schema keyword was encountered (see CustomType.validators). This PR introduces a similar feature for new style Extensions where custom validators can be defined in Extension.validators. The scope of the validators is global (same as legacy validators). fixes asdf-format#1012
old style (legacy) extensions allowed for custom validators, functions called when a particular schema keyword was encountered (see CustomType.validators). This PR introduces a similar feature for new style Extensions where custom validators can be defined in Extension.validators. The scope of the validators is global (same as legacy validators). fixes asdf-format#1012 update changelog change raise to yield
old style (legacy) extensions allowed for custom validators, functions called when a particular schema keyword was encountered (see CustomType.validators). This PR introduces a similar feature for new style Extensions where custom validators can be defined in Extension.validators. The scope of the validators is global (same as legacy validators). fixes asdf-format#1012 update changelog change raise to yield
old style (legacy) extensions allowed for custom validators, functions called when a particular schema keyword was encountered (see CustomType.validators). This PR introduces a similar feature for new style Extensions where custom validators can be defined in Extension.validators. The scope of the validators is global (same as legacy validators). fixes asdf-format#1012 update changelog change raise to yield
closed via #1050 |
What is the correct way to register custom validators now with the new extension API?
The documentation only mentions this in the deprecated old API section.
https://asdf.readthedocs.io/en/latest/asdf/extending/legacy.html#adding-custom-validators
The text was updated successfully, but these errors were encountered: