-
Notifications
You must be signed in to change notification settings - Fork 8
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
reusable validator #58
Comments
Two interfaces? Standard for WebIDL lately has been to use promises. If you did want to define a synchronous interface, perhaps simply use a different method? The method could be defined to simply invoke the promise. There's some discussion of that here, but I'm not sure why this is really necessary. In any case, the |
I don't think this is a synchronicity issue. I think it's just one of whether the API caters to the use case of reusing a schema for multiple validations. If the web API is any predictor for this, the shex.js interface is quite general, e.g. you can start it with some data and then throw successive schemas at it, or even start it with a schema and data and interrogate multiple ShapeMaps, but the common case is to start it with a schema and then query it iteratively with successive data and shapeMap reqs. |
Okay, I can see the value in this. Not sure that in WebIDL a call can return an interface, as it's not really object-oriented. Perhaps both methods are in the |
I would define it more like
I do not have a separate Validator class as this would break the async construct with the Promises. If the shapeMap would be also a promise object, it would be in theory possible to have all 4 elements running in parallel (would not be practical doh I think). |
I wrote this up without Promises in asyncAPI. |
Looks like it's a synchronous, rather than asynchronous API. |
It's common to create a validator with a schema and test many instances against it, e.g. an ingestion validator for a web service.
The text was updated successfully, but these errors were encountered: