You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@annotator.apache.org by GitBox <gi...@apache.org> on 2022/11/16 14:41:41 UTC

[GitHub] [incubator-annotator] PermissionError opened a new issue, #133: Data Model validation as API

PermissionError opened a new issue, #133:
URL: https://github.com/apache/incubator-annotator/issues/133

   Currently `yarn validate --url <url>` can be used to validate JSON documents against the Web Annotation Data Model schema. This is achieved through executing `test/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 the `dom` or `selector` 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 new `util` package? It should be relatively trivial, and I could take that on.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@annotator.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-annotator] Treora commented on issue #133: Data Model validation as API

Posted by GitBox <gi...@apache.org>.
Treora commented on issue #133:
URL: https://github.com/apache/incubator-annotator/issues/133#issuecomment-1325723751

   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 `@apache-annotator/annotation`), to incorporate some code from [this module](https://code.treora.com/gerben/web-annotation-utils) that I had made to satisfy my own needs. I don’t know if I’ll get back to it soon, so I just pushed some my work-in-progress, see #137.
   
   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..)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@annotator.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org