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

Unable to specify relationships while creating/updating a resource #14

Closed
ngseer opened this issue Nov 25, 2019 · 1 comment
Closed

Comments

@ngseer
Copy link
Contributor

ngseer commented Nov 25, 2019

Describe the bug
relationships clause is not allowed in request data model though it's allowed by the spec.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new JsonApiRequest model.
  2. See there's no ability to add relationships to it.

Expected behavior
Requests like this should be allowed (an example from the spec):

POST /photos HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json

{
  "data": {
    "type": "photos",
    "attributes": {
      "title": "Ember Hamster",
      "src": "http://example.com/images/productivity.png"
    },
    "relationships": {
      "photographer": {
        "data": { "type": "people", "id": "9" }
      }
    }
  }
}
@DeanWay
Copy link
Owner

DeanWay commented Nov 29, 2019

fixed in 0.10.0, by allowing an optional relationships key on request resource objects, consisting of a mapping of strings to resource linkage data (#15)

@DeanWay DeanWay closed this as completed Nov 29, 2019
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

No branches or pull requests

2 participants