Closed markboots closed 6 years ago
I'm not sure about this. What if an implementation wants to offer both methods?
Maybe we can use a single property path
and differentiate via the reported MIME type. JSON API has a registered MIME type: http://jsonapi.org/#mime-types. This only applies to URL type paths of course.
An alternative, which deviates from the Date Resource Package is to use a different property for API based access. data-endpoint
or something similar?
Thanks @ggiraldez , good question. If an implementation wanted to offer both... they would need to be at different paths, right?
I'm not sure about differentiating via MIME type...
I also realized from your post that we break the Data Resource Package if we use the path
for the API endpoint... as software expecting Data Resource Packages would expect a data file there.
So I like your proposal to only use path
for the file-mode access. api-data-url
could be an optional additional parameter with the API URL. If path
is null, then it means only API access is supported, and api-data-url
must be provided.
Thumbs up during discussion on the call!
We came across something small while implementing the retrieve API:
The Resource specification currently says that the resource can be located at a file or a URL, consistent with the Data Packages spec:
For resources stored at URLs (e.g. http://my.demoserver.com/flowpackages/2347832/data.json), this leaves ambiguity on whether the resource should be accessed:
Suggestion: add a new optional parameter to the Resource:
access-method
is an optional parameter, and can beapi
orfile
. If the access method isapi
, it indicates the resource can be queried using the API Access specification, with support for pagination and filtering. If the access method isfile
, it indicates all responses are available in a static JSON file. The default if this parameter is not provided isfile
.(Not sure what we should recommend and use as the default if not provided - suggestions? Or should this parameter simply be mandatory?)
(Example of what would be statically hosted at the URL in
file
-mode: