Created
September 30, 2012 19:25
-
-
Save mikekelly/3808215 to your computer and use it in GitHub Desktop.
This file contains 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
{ | |
"_links": { | |
"self": { "href": "/foo" }, | |
}, | |
"_controls": { | |
"attack": { | |
"target": "/attacks", | |
"method": "POST", | |
"headers": { | |
"Content-Type": "application/json" | |
}, | |
"schema": { /*_json_schema_doc_here_*/ } | |
} | |
} | |
} |
This file contains 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
{ | |
"_links": { | |
"self": { "href": "/" }, | |
"example": { "href": "/example" } | |
}, | |
"_controls": { | |
"widgetate": { | |
"target": "/widget/{newID}", | |
"method": "PUT", | |
"headers": { | |
"Content-Type": "application/xml" | |
}, | |
"body": "<widget>\\n <name>{{name}}</name>\\n\\n <blobs>\\n {{#blobs}}\\n <blob>\\n {{#first}}\\n <first>true</first>\\n {{/first}}\\n <contents>{{contents}}</contents>\\n </blob>\\n {{/blobs}}\\n </blobs>\\n\\n {{#is_empty}}\\n <note>This is an empty widget</note>\\n {{/is_empty}}\\n</widget>\\n" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
JSON Hyper-Schema looks like it includes nearly everything in the
_controls
example above. Notably, it specifiesencType
andmediaType
rather than arbitrary headers.