You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an embedded does not contain a self-link, a warning is printed and the item is ignored. While the spec looks contradictory, the embedded should not be ignored
The HAL spec is clear on this point:
The reserved "_links" property is OPTIONAL.
The HAL-FORMS spec looks contradictory since it states:
[the link element] is a RECOMMENDED element
and then (while this looks to break HAL backward compatibility)
Every HAL-FORMS document SHOULD have at least one link element in the collection with a key value set to self
[…]
Clients MAY reject a HAL-FORMS document that does not contain a link element with the key value set to self.
It recommends to defaults self-link to the URI used for the request but this looks incompatible with current cache handling in ketting since URI is used as a cache key
Is there any hope to have this behavior fixed?
The text was updated successfully, but these errors were encountered:
Ketting right now does not not aim to be a perfect client for every use-cases of HAL. Ketting is opinionated and needs certain things to be true to fit its architecture. We also need to support a number of different formats, and find a lowest common denominator.
This sometimes means trade-offs, and one of those trade-offs is is that if a hypermedia API (regardless of format) uses a concept of embedded/transcluded resources then it needs those resources to be globally identifiable through a URI.
If you have control over the server, I would suggest simply adding a self link pointing to something unresolvable like a urn: URI. Frankly I find the idea of using a subresource/embedded resource without a URI really strange, and wonder if this should not have been a regular property on your resource.
The only workaround I can see adding in Ketting in the future is to give users some way to get access to the raw underlying HAL response, but I have no immediate plans to do this.
For now I think it's best to close this, because I can't honestly say at the moment if this will ever become a priority, I'm sorry! The ugly thing you can do right now is call .fetch() directly on a resource but I totally understand this is annoying as you opt-out of all the other features.
When an embedded does not contain a self-link, a warning is printed and the item is ignored. While the spec looks contradictory, the embedded should not be ignored
The HAL spec is clear on this point:
The HAL-FORMS spec looks contradictory since it states:
and then (while this looks to break HAL backward compatibility)
It recommends to defaults self-link to the URI used for the request but this looks incompatible with current cache handling in ketting since URI is used as a cache key
Is there any hope to have this behavior fixed?
The text was updated successfully, but these errors were encountered: