-
Notifications
You must be signed in to change notification settings - Fork 44
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
Data Model validation as API #133
Comments
Generally “since the code is already there” seems a weak argument to do more work on that code (if it is of little use, it might better be dropped altogether). In this case, there may indeed be some value, and combined with other utilities around the WA data model it could be material for a separate package indeed. Coincidentally, I was recently thinking to suggest creating such a package (I thought to call it If we end up adding this package, that would be a good home for the validation test too. We should also ensure that the TypeScript type I introduce there corresponds to the validation tests. (ideally we would deduplicate things and generate both the type and validator at once from a specification..) |
Currently
yarn validate --url <url>
can be used to validate JSON documents against the Web Annotation Data Model schema. This is achieved through executingtest/data-model.test.ts
. I'm wondering if this should/could be included as API somewhere? An example use case would be where a server may wish to validate uploaded annotation data against the schema. I am aware that this probably doesn't fall into either thedom
orselector
package, but since the code is already there, it seems like a waste to not to include it in a more developer-friendly form. Perhaps in a newutil
package? It should be relatively trivial, and I could take that on.The text was updated successfully, but these errors were encountered: