Created
August 25, 2014 15:16
-
-
Save mamund/fee16d9138b17433d3b2 to your computer and use it in GitHub Desktop.
supporting custom templates in Cj
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
{ | |
"collection" : { | |
"version" : "1.0", | |
"href" : "http://api.example.com/list", | |
"links" : [ | |
{"rel" : "payment", "href" : "http://api.example.com/payment", "prompt" : "Select Payment Method"} | |
], | |
"items" : [ | |
... | |
] | |
} | |
} |
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
{ | |
"collection" : { | |
"version" : "1.0", | |
"href" : "http://api.example.com/payment", | |
"links" : [ | |
{"rel" : "collection", "href" : "http://api.example.com/list", "prompt" : "Return to Shopping Cart"} | |
], | |
"template" : [ | |
{"name" : "cash", "value" : "", "prompt" : "Pay with cash", "regexp" : "^(?:true|false)$"}, | |
{"name" : "check", "value" : "", "prompt" : "Pay with check", "regexp" : "^(?:true|false)$"}, | |
{"name" : "billme", "value" : "", "prompt" : "Bill me later", "regexp" : "^(?:true|false)$"} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment