Skip to content
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

[#17] Relax sub-entity rel requirement, default to ["item"] #48

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ericelliott
Copy link
Contributor

Changes as per hangout discussion and [https://github.com//issues/17](issue #17).

Eric Elliott and others added 5 commits February 16, 2015 11:51
* Allows more efficient encoding
* Does not force the representation to tightly couple child entities to parent entities via required `rel`.
@apsoto
Copy link

apsoto commented Apr 9, 2015

Looks ok to me except for the default rel. If no rel is provided, I'd prefer no assumptions

@ericelliott
Copy link
Contributor Author

@apsoto I believe the default rel was the compromise we came to at the first Google hangout meeting. I think a home-grown client could feel free to ignore it. =)

@kevinswiber
Copy link
Owner

I started revisiting this a little more yesterday. I think what concerns me about this change is the fact that the media type format starts leaking into the domain application protocol. I'm starting to back-track in my head and think about relaxing that requirement to a SHOULD.

@ericelliott
Copy link
Contributor Author

the media type format starts leaking into the domain application protocol

Well, it does seem to do that if we have a default rel, I agree. Without the default rel, it doesn't. In my flavor of Siren, I have entityAttributes that get shared across all entities, and that's where I set the rel values for entities. This allows me to upgrade old collection APIs to use Siren just by adding a simple wrapper and stuffing the original contents into Siren entities. No need to map every entity to make it Siren-compatible, or bloat the response by repeating attributes on every sub-entity. I've been doing this in production almost since I started using Siren.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants