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

Spec deviation: POST relationships not available in Delta<MyResource> #15

Open
brainwipe opened this issue Aug 29, 2016 · 1 comment
Open
Labels

Comments

@brainwipe
Copy link
Owner

As per the spec:

If a relationship is provided in the relationships member of the resource object, its value MUST be a relationship object with a data member. The value of this key represents the linkage the new resource is to have.

When inside a POST controller such as:
[Route] [HttpPost] public IHttpActionResult Post([FromBody]Delta<MyResource> resourceDelta) {

There is no way to get at the relationships, they are ignored. The UpdateDocument class must include the relationships and in turn they should be accessible through the Delta<>. These are just links, the system should not attempt to automatically load them, it is should assumed that the API implementer knows what to do with these links.

@brainwipe brainwipe added the bug label Aug 29, 2016
@brainwipe
Copy link
Owner Author

The not-very-good way around this is to pass the Id of the linked object as another attribute. This would mean that POST and GET would be different and not in the spirit of the json:api but is a workaround until this feature can be implemented.

@brainwipe brainwipe added this to the 1.0.6 milestone Sep 5, 2016
@brainwipe brainwipe modified the milestones: 1.0.6, 1.0.7 Oct 4, 2016
@brainwipe brainwipe removed this from the 1.0.7 milestone Feb 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant