-
Notifications
You must be signed in to change notification settings - Fork 10
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
Request: make available formats explicit #225
Comments
A defensive strategy could rely on the idea that a "REST API should be entered with no prior knowledge beyond the initial URI (bookmark) and set of standardized media types that are appropriate for the intended audience (i.e., expected to be understood by any client that might use the API)." (https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven) But I agree that this would still leave plaintext, xml, html, ebook formats, pdf, or even image formats for the corresponding scan images as potential representations. I see two (not mutually exclusive) standard approaches:
Both methods work without adding fields and information to the response body. IMHO, where standards deal with things on a higher level of the API stack, they should be solved there (i.e. HTTP or HATEOAS/RESTful behaviour, maybe Hydra also has something to say about it?). However, I am not sure if this means that the spec should not mention/discuss this at all. |
Hi, I believe Content negotiation is the go-to for this, but HTTP Link headers could be a neat way to supplement it. |
Relying on underlying protocol layers if possible would be nice. Although requested format is already part of the DTS layer. One disadvantage of the content negotiation approach (if I understand correctly!) is that the client would have to know what is the range of possible formats it can ask for in general, so that may excludes discovery of new or custom formats. Also it doesn't allow the client to filter a collection by formats. Example use case: a web-based text viewer which can only show HTML texts from a list. With the two options suggested above I think the viewer would have to probe each document in a collection individually in order to show to the user a shortlist. If the collection is long, the process will be slow and won't scale well (e.g. EDH has a collection with 80,000 docs). Alternatively showing the complete list of documents in the collection and letting the user probe them one by one lead to a frustrating experience. |
- Renamed `?id` query parameter identifying a `Resource` to `?resource` - Renamed the `?format` query parameter for content-negociation to `?mediaType` (Implements parts of distributed-text-services#225) - Renamed the `<dts:fragment>` XML node for XML/TEI responses to `<dts:wrapper>`. - Added attributes to the `<dts:wrapper>` element to allow for identifying specific nodes within the wrapped TEI (Fixes distributed-text-services#133) - Removed the requirement for `Link` and `Media-Type` HTTP Response Headers - Implementation stil **should** provide such capacity. - Clarified error codes and condition of errors generations. - Removed URI templates as per Hydra definition. - Added implementation of multiple trees through the `?tree` parameter ( (fixes distributed-text-services#142, distributed-text-services#223, distributed-text-services#202)
During the RC Workshop in Durham, it was decided that an Implementation in the specs will be visible in #238 |
The property |
We published the resolution of this issue during the tech committee meeting on 2024-03-08 This is an alpha release and we are looking for feedback! |
Hi,
Tell me if I'm wrong but I don't see where in the specification an implementation can expose the formats it supports. Is that some implicit knowledge an API client is currently assumed to have about the services it calls (i.e. a text viewer must somehow know that a specific DTS implementation offers HTML or plain text as alternative formats)?
If that feature is ever considered, for maximum granularity/flexibility, it might be preferable to declare acceptable formats at the document level (e.g. in the members returned by the Collection response).
The text was updated successfully, but these errors were encountered: