-
Notifications
You must be signed in to change notification settings - Fork 67
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
HAL links are duplicated when defining content in an Entity #148
Comments
Thanks @thijslemmens. As discussed in email, we aren't very smart when it comes to adding resource links atm, adding them regardless. We'll try and make it smarter to remove the duplicates. That said I am not sure what we can do around the clarity of fetching content versus metadata issue. ALPs (the standard that defines the link schema) isn't any help as it ignores content-type altogether (last time that I checked). The one thing I would say is that when SD repositories and SC stores are exported into the same URI space then SC will ignore any GET request that accepts json or hal+json and will attempt to handle anything else. The other alternative is to export the SC stores into a different URI space by either specifying a "path" on the StoreRestResource, or probably more preferably, setting the Any other options/suggestions welcome too |
I just wanted to clarify the StoreRestResource in your example @thijslemmens . Did you mean to specify this one? Exporting this store should (?) lead to content links of the form: I am assuming you meant to specify something like: Just wanted to check before I started looking at this to make sure I understood. |
You are correct. I made a mistake in generalizing my example. |
Updated the original issue |
As it stands today if an entity is annotated with multiple content properties (i.e. multiple @ContentIds) then, for each, we generate a link relation from its @ContentID field name. This functionality is fairly new. I didn't change single content entities links to match because I didn't want to make a backward incompatible change. But thinking about it now, in a wider context of content vs. metadata differentiation too, we could adopt this as a uniform approach so for the above example we would end up with something like this:
Now, this is backward incompatible and may break consumers out there but if we introduced a I think I am keen on this approach as overall it gives us more uniform system behavior and a more customizable framework. I would be interested as to how you view this solution from your perspective @thijslemmens? Presumably, as you are early on in your journey this would be ok? |
@paulcwarren backwards compatibility is not yet an issue for us. Why not have a subresource? Something like this:
|
We already have support for links like this, for content collections, so I was considering similar. I'll look into what it would take to use this style of link for content links too. Note: although from a hypermedia perspective, where the client follows link relations (linkrels) from a single known entry-point into the application, the actual URL is of little consequence actually. Changing the linkrel will break existing clients that are out there that might be following the existing linkrels. |
- also make the linkrel configurable Fixes #148
This should be fixed by this commit that is now available on 1.0.0.M7-SNAPSHOT. In short there is now a spring boot property Will cut a release this week. I'm going to close this but feel free to open if you still have an issue. |
- also make the linkrel configurable Fixes #148
When modeling an Entity:
With default repository and store:
calling the a url:
http://localhost:8080/myEntities
results in
There is an array with the same reference twice:
One is made by Spring Rest and the other one by Spring content. To get the content vs metadata you can play with the Accept header. However this does not seem very clear to me.
The text was updated successfully, but these errors were encountered: