Created
November 26, 2015 02:30
-
-
Save zachflower/b2f8bbb70e067f7edacc to your computer and use it in GitHub Desktop.
Example API Blueprint JSON
This file contains hidden or 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
{ | |
"element": "category", | |
"meta": { | |
"classes": [ | |
"api" | |
], | |
"title": "Hello World API" | |
}, | |
"content": [ | |
{ | |
"element": "copy", | |
"content": "A Hello World API. Always returns “Hello World”.\n\n" | |
}, | |
{ | |
"element": "category", | |
"meta": { | |
"classes": [ | |
"resourceGroup" | |
], | |
"title": "" | |
}, | |
"content": [ | |
{ | |
"element": "resource", | |
"meta": { | |
"title": "Hello World" | |
}, | |
"attributes": { | |
"href": "/hello" | |
}, | |
"content": [ | |
{ | |
"element": "copy", | |
"content": "Return “Hello World.” Always.\n\n" | |
}, | |
{ | |
"element": "transition", | |
"meta": { | |
"title": "GET resource" | |
}, | |
"content": [ | |
{ | |
"element": "copy", | |
"content": "Make a GET request.\n\n" | |
}, | |
{ | |
"element": "httpTransaction", | |
"content": [ | |
{ | |
"element": "httpRequest", | |
"attributes": { | |
"method": "GET" | |
}, | |
"content": [] | |
}, | |
{ | |
"element": "httpResponse", | |
"attributes": { | |
"statusCode": "200", | |
"headers": { | |
"element": "httpHeaders", | |
"content": [ | |
{ | |
"element": "member", | |
"content": { | |
"key": { | |
"element": "string", | |
"content": "Content-Type" | |
}, | |
"value": { | |
"element": "string", | |
"content": "text/plain" | |
} | |
} | |
} | |
] | |
} | |
}, | |
"content": [ | |
{ | |
"element": "asset", | |
"meta": { | |
"classes": "messageBody" | |
}, | |
"attributes": { | |
"contentType": "text/plain" | |
}, | |
"content": "Hello World!\n" | |
} | |
] | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"element": "transition", | |
"meta": { | |
"title": "POST resource" | |
}, | |
"content": [ | |
{ | |
"element": "copy", | |
"content": "Make a POST request.\n\n" | |
}, | |
{ | |
"element": "httpTransaction", | |
"content": [ | |
{ | |
"element": "httpRequest", | |
"attributes": { | |
"method": "POST" | |
}, | |
"content": [] | |
}, | |
{ | |
"element": "httpResponse", | |
"attributes": { | |
"statusCode": "200", | |
"headers": { | |
"element": "httpHeaders", | |
"content": [ | |
{ | |
"element": "member", | |
"content": { | |
"key": { | |
"element": "string", | |
"content": "Content-Type" | |
}, | |
"value": { | |
"element": "string", | |
"content": "text/plain" | |
} | |
} | |
} | |
] | |
} | |
}, | |
"content": [ | |
{ | |
"element": "asset", | |
"meta": { | |
"classes": "messageBody" | |
}, | |
"attributes": { | |
"contentType": "text/plain" | |
}, | |
"content": "Hello World!\n" | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment