Last active
December 17, 2015 08:49
-
-
Save jblanche/5582887 to your computer and use it in GitHub Desktop.
JSON API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The question is, how do we create linked resources with the main one, e.g. if for some business reasons a user is created with an avatar and the avatar is a different resource because it can be associated with other stuff than a user... | |
What should be the format of the POST request on /users doing this ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"users" : [ | |
"firstname" : "John", | |
"lastname" : "Doe", | |
"avatar" : [ | |
"url": "http://foo" | |
] | |
], | |
"links": { | |
"friends": ["1", "4", "8"] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"users" : [ | |
"firstname" : "John", | |
"lastname" : "Doe" | |
], | |
"links": { | |
"friends" : ["1", "4", "8"], | |
"avatar" : [ | |
"url" : "http://foo" | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment