-
-
Save jamztang/1337052 to your computer and use it in GitHub Desktop.
damn-api sample spec
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
{ | |
"host": ["api.example.com", "api-staging.example.com"], | |
"headers": { | |
"X-EXAMPLE-DEVICE-TYPE": ["iphone", "android"], | |
"X-EXAMPLE-DEVICE-UUID": { | |
"value": "mock", | |
"optional": true | |
}, | |
"X-EXAMPLE-APP-ID": ["com.example.iphone.app1", "com.example.iphone.app2", "com.example.android.app1"] | |
}, | |
"api_groups": [ | |
{ | |
"name": "Account API", | |
"apis": [ | |
{ | |
"name": "Account Registration", | |
"type": "json", | |
"path": "/api/v1/account/register.json", | |
"method": "POST", | |
"body": { | |
"user[username]": "*", | |
"user[password]": "*", | |
"user[password_confirmation]": "*" | |
} | |
}, | |
{ | |
"name": "Get Account Info", | |
"type": "json", | |
"path": "/api/v1/account/profile.json", | |
"method": "GET", | |
"headers": { | |
"X-EXAMPLE-AUTH-TOKEN": "mock" | |
} | |
} | |
] | |
}, | |
{ | |
"name": "Articles API", | |
"apis": [ | |
{ | |
"name": "Get New Article Form", | |
"type": "web", | |
"path": "/api/v1/articles/new", | |
"method": "GET" | |
}, | |
{ | |
"name": "List Articles", | |
"type": "json", | |
"path": "/api/v1/articles.json", | |
"method": "GET", | |
"params": { | |
"page": "[0-9]*", | |
"per_page": { | |
"value": "[0-9]*", | |
"optional": true | |
} | |
} | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment