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

Feature/jsonapi compound documents #360

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

Conversation

hubert
Copy link
Contributor

@hubert hubert commented Aug 5, 2015

all. i've added very basic support for compound documents.

similar to the earlier commits initial support of JSON API, it moves the included documents into the same namespace as the attributes. however, since JSON API specifies that attributes and included objects occupy the same namespace, there shouldn't be issues with conflicts provided the response is JSON API-compliant.

we're losing some context here by taking this tact, but this allows us to retrieve multiple resources at once in a way that will be compatible with JSON API development efforts down the road.

the next step will on this front will be to figure out how to generate associations based on the links that are returned rather than relying on a static object that specifies the path.

feedback very much appreciated.

@rjayroach
Copy link

@hubert First, thanks for taking up as maintainer of Her. much appreciated!

I've been using this branch for some testing with some internal micro services we're building. There are a few features that I want to add to JSON API support including populating an errors hash when the API returns errors, e.g. name cannot be blank. Wondering if you plan on merging this PR in and if you need help what I can do to move it forward?

@danielneis
Copy link

hello, it would be very usefull.

@vaihtovirta
Copy link
Contributor

@hubert Do you have any plans to finish this?
Let me know what's still missing and maybe I can help.

@danielneis
Copy link

I've tested the changes proposed here and found that they work.
There is a problem with types with "_" or "-", but this is generalized in all her-rb code, so I think it may not be a reason to not get it working. I've experimented with has_one and belongs_to relationships.

Relationships inside other relationships are not parsed.

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.

None yet

4 participants