Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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