Skip to content

Instantly share code, notes, and snippets.

@david-bc
Created October 31, 2018 13:04
Show Gist options
  • Save david-bc/e63781a7ef5e200792c7d38d8ed87b21 to your computer and use it in GitHub Desktop.
Save david-bc/e63781a7ef5e200792c7d38d8ed87b21 to your computer and use it in GitHub Desktop.
Example REST Configuration
{
"urlTemplate": "http://jsonplaceholder.typicode.com/posts?_page={{page}}&_limit={{limit}}",
"method": "GET",
"rateLimit": {
"prefix": "jsonPosts::",
"quota": 10,
"interval": 1000
},
"caching": {},
"inputs": [
{
"key": "page",
"defaultValue": 1,
"required": false
},
{
"key": "limit",
"defaultValue": 10,
"required": false
}
],
"exampleResponses": {
"200": {},
"400": {},
"500-invalid-page": {},
"500-invalid-limit": {}
}
}
{
"urlTemplate": "http://jsonplaceholder.typicode.com/users/{{userId}}",
"method": "GET",
"rateLimit": {
"prefix": "jsonUsers::",
"quota": 10,
"interval": 1000
},
"caching": {},
"inputs": [
{
"key": "userId",
"required": true
}
],
"exampleResponses": {
"200": {},
"400": {},
"404": {},
}
}
{
"urlTemplate": "http://jsonplaceholder.typicode.com/users?_page={{page}}&_limit={{limit}}",
"method": "GET",
"rateLimit": {
"prefix": "jsonUsers::",
"quota": 10,
"interval": 1000
},
"caching": {},
"inputs": [
{
"key": "page",
"defaultValue": 1,
"required": false
},
{
"key": "limit",
"defaultValue": 10,
"required": false
}
],
"exampleResponses": {
"200": {},
"400": {},
"500-invalid-page": {},
"500-invalid-limit": {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment