-
Notifications
You must be signed in to change notification settings - Fork 2
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
_embedded resources and the self link relation #3
Comments
Under the original specification, it was unclear that resource and link rel's in HAL were single reltypes, and implied they carried the same structure of a rel attribute in the web linking spec, which is a space separated list of reltypes - so technically the HalBuilder library was correct - in that the link with a rel of "self echo" was shortland for having two links, each with "self" and "echo" respectively. Originally, HalBuilder was keeping the rel for WHY it was embedded on the embedded resource itself, so the self link was being collapsed into one link. However, the current specification being put forward to IETF clarifies this by stating its a reltype.
With the plural of names/types being referenced I take this to mean "each property name is a link relation type". The current 2.0.1-SNAPSHOT builds ( from source ) now correctly separate an embedded resources embedding reltype ( why its embedded ) from the links on the embedded resource itself. Do you still see this behavior on the current 2.0.1 builds ( note that if you're coming from the 1.x version, EVERYTHING is changed - classes are now called Representation rather Resource, and the package has changed and been split into separate repositories ( and no longer bleeds out Google Guava Optionals ). I need to write up some migration docs for all this actually :) |
Thank you for all your efforts with this project - it has been very helpful. Would you recommend migrating to the 2.0.1 builds sooner rather than later? I'm currently using 1.0.5 for a project and I'd like to be solid ground for creating my representations. Is there a plan to push them to Maven Central? |
Well the 1.0x branches are now unmaintained, and I hope to start releasing 2.x versions soon as I'll likely be using that in an upcoming project stream at work. I like the direction I'm now heading with the separate artifacts and extension modules, but would also be good to get some feedback from anyone using it first ( mind you - afaik theres only about 3 people so far, that I know of ). The plan is to definitely push to central and the sooner the better. |
Thanks for getting back to me. I'm using your library in my MultiBit For some trivial code examples see I would certainly appreciate any advice you could offer regarding the use I am able to work on my MBM project full time for the next 4 weeks so if On 30 September 2012 06:54, Mark Derricutt [email protected] wrote:
|
@talios Brilliant explanation. I'm using 1.x simply because it's available in Maven central. I'll be sure to try the 2.x builds and feed back to you. |
@gary-rowe I like the look of MultiBitMerchant - will definitely have to call it out in an upcoming blog post about 2.0.1, I notice you've got a MinifiedJsonRenderer - is the lack of pretty-printing the only difference between this and the original ( I only had a quick glance ), sounds like something that might be a good option to include on the default ones and configured on the RepresentationFactory instance. @biddster Cheers! As something that started as both an hack to see how the HAL format would play out, and an experiment in API design I think both have worked out reasonably well - with a few rough edges remaining. |
This conversation should probably really take place on the mailing list, but what the hell - just posted to my tumblr about 2.0.1 - http://www.theoryinpractice.net/post/32729432438/halbuilder-2-0-1-progress |
@talios Thanks for looking over MBM. As you point out, the MinifiedJsonRenderer is there because I didn't want the pretty pritining JSON and, yes, having it as an option for the RepresentationFactory would be a good design choice. I've made extensive updates to MBM recently, particularly in the HAL representation area, if you feel inclined, you may want to conduct a second review. You'll notice that I've gone for a design based on composition which gives a good way to assembly arbitrary representations. |
I'm returning a collections of items from a resource. I assemble a hal response using .withSubresource("echo", subRes) where I supply a relation of "echo". In each of my sub-resources, the self link relation is prefixed with the relation name I passed to .withSubresource(). ie "echo self".
I wasn't expecting this to be the case. Once I've traversed using _embedded.echo[0]._links, I was expecting to deal in standard link relation nomenclature, ie be able to use self, not have to know that I have to prefix the parent link relation name.
None of the examples that I've seen indicate this is expected...
http://blog.stateless.co/post/13296666138/json-linking-with-hal
Happy to accept I've missed the point so feel free to flame and clarify :-)
Thanks for the great work.
The text was updated successfully, but these errors were encountered: