-
Notifications
You must be signed in to change notification settings - Fork 26
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
Ensure all specs are validated #507
Comments
A solution for this issue should also validate correct regarding the discussion here: https://github.com/hdmf-dev/hdmf/pull/500/files#r555552469 |
Thanks for writing this up, @dsleiter. Would you be able to work on this? |
@rly sure! I'll get started on it this week. |
@rly I ran into another question while working on this. It looks like the validator does not currently check for additional attributes, datasets, groups, or links attached to a builder that are not part of the spec. eg. imagine a group spec for type Foo defines two child datasets: X, and Y. Validation of a group builder for Foo with three child datasets X, Y, and Z will not return any validation errors. Is this the desired intended behavior? I wasn't able to find anything specific to this in the hdmf documentation, but I might have missed it. I did find discussion related to this in nwb-schema docs which suggests that extending data types is the intended way of adding additional elements (last paragraph of section 1.3 here: https://nwb-schema.readthedocs.io/en/latest/format_description.html#time-series-a-base-neurodata-type-for-storing-time-series-data) |
@dsleiter sorry for the delay in response. This is related to: In short, a warning should be raised on extra attributes/datasets/groups/links that are not part of the spec. If you want to tackle that, you could finish #288 or start your own PR to do it. As you can see from the various issues raised about it, this issue does come up and it would be very useful to add a warning on extra fields into the validator. |
Yes this would be definitly helpful in getting finished. |
Oh, great thanks! I should have checked the existing issues first. I'd be happy to continue on #288 after this current issue. I think that the refactoring of |
* Ref hdmf-dev#507 * This property facilitates validating builders against specs
* Ref hdmf-dev#507 * Resolves the first two points of hdmf-dev#507 * Many comments were added during refactoring to help with understanding these comments will be removed before the branch is ready to merge
* Ref hdmf-dev#507 * These unit tests are not currently passing but should by by the end of this issue
* Ref hdmf-dev#507 * Now passes all tests * The code will be further refactored and clean up before it is ready
* Include data_type property on dataset and group specs * Ref #507 * This property facilitates validating builders against specs * Include additional validator unit tests * Ref #507 * WIP Refactor GroupValidator and update logic to pass unit tests * Ref #507 * Resolves the first two points of #507 * Many comments were added during refactoring to help with understanding these comments will be removed before the branch is ready to merge * Add new unit tests for the validator * Ref #507 * These unit tests are not currently passing but should by by the end of this issue * Refactor GroupValidator and update matching between builder and spec * Ref #507 * Now passes all tests * The code will be further refactored and clean up before it is ready * Refactor GroupValidator and SpecMatcher and add documentation * Ref #507 * Clean up extraneous comments * Refactor out IllegalLinkError creation to be consistent with other error creation * Update changelog
Description
Currently, there are a few edge cases where specs do not get validated, as raised in #500. We want to ensure that all specs get correctly validated.
Steps to Reproduce
Create an hdmf object and spec which should be invalid according to one of the three points above, and see that it passes validation.
Environment
Checklist
The text was updated successfully, but these errors were encountered: