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

check keyword rules #173

Closed
stansmith907 opened this issue Nov 27, 2017 · 4 comments
Closed

check keyword rules #173

stansmith907 opened this issue Nov 27, 2017 · 4 comments
Labels

Comments

@stansmith907
Copy link
Contributor

thesaurus is not required in a keyword set. However, when thesaurus appears as an empty hash it does not pass validation. Message is "citation is missing title".

@jlblcc
Copy link
Member

jlblcc commented Nov 27, 2017

Yep, thesaurus is a citation- so a title is required. For keyword{} the thesaurus must either be a valid citation or not present. As noted, an empty object is considered invalid.

@stansmith907
Copy link
Contributor Author

stansmith907 commented Nov 27, 2017

Yes, title is required for citation, but citation (thesaurus) is not required for keyword. The empty thesaurus object ("thesaurus": {}) is behaving as if a citation is present. I don't remember us making a rule that empty objects are to behave as loaded objects, but maybe we did.


I checked other tests and empty objects are ignored. Then I figured out it was because of the way I'm testing. I only test the component in question, I don't run usually run it in from the top and generate a full metadata record. Just testing the module bypasses the schema validation which is early in the stack. And when I do the schema tests they are done on complete objects.

So I guess we did decide (or have to) treat empty objects as complete objects. Kind of sucks.

@jlblcc
Copy link
Member

jlblcc commented Nov 27, 2017

That's just the nature of the schemas. If we have any required properties for an object, an empty object is going to fail validation. In theory, We could write the schemas to allow an empty object, but that would require the oneOf construct for every single object in the schemas.

@stansmith907
Copy link
Contributor Author

It is what it is.

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

No branches or pull requests

2 participants