Skip to content

Instantly share code, notes, and snippets.

@appsoluut
Last active May 20, 2018 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save appsoluut/07fa51c6c44fbc340d8c7102e4c95580 to your computer and use it in GitHub Desktop.
Save appsoluut/07fa51c6c44fbc340d8c7102e4c95580 to your computer and use it in GitHub Desktop.
Polymorphic RESTful response
{
"article": {
"title": "Hello world",
"body": [{
"type": "text",
"text": "Hi there"
}, {
"type": "image",
"source": "https://example.com/hello-world-banner.jpg",
"author": "John Doe",
"description": "Hello World! banner"
}, {
"type": "video",
"source": "http://mirrorblender.top-ix.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_surround.avi",
"thumbnail": "https://peach.blender.org/wp-content/uploads/dl_1080p.jpg",
"title": "Big Buck Bunny",
"duration": 574
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment