aglio
aglio copied to clipboard
Multiple Examples with Different Parameters
I am trying to figure out how to do list multiple examples with different parameter combinations and formatting for a single resource/request type that have consistent responses.
## MyAPICall [/resource/{param1}/{param2}{?jsonp,userID}]
### Example 1 [GET]
+ Parameters
+ param1 (string, `demo`) - Blog Subsection
+ param2 (string, `posts`) - Resources requested, comma separated (%2C encoded comma)
+ jsonp (string, `0`) - jsonp callback identifier, use `0` if not using jsonp
+ userID (string, `1234`) - userID of the caller
### Example 2 [GET]
+ Parameters
+ param1 (string, `demo`) - Blog Subsection
+ param2 (string, `posts%2Ccomments`) - Resources requested, comma separated (%2C encoded comma), i.e. posts,comments is posts%2Ccomments
+ jsonp (string, `0`) - jsonp callback identifier, use `0` if not using jsonp
+ userID (string, `1234`) - userID of the caller
+ Response 200
...
+ Response 404
...
It's also ok if I supply parameter types above the examples, and then just put in examples more simply:
## MyAPICall [/resource/{param1}/{param2}{?jsonp,userID}]
+ Parameters
+ param1 (string) - Blog Subsection
+ param2 (string) - Resources requested, comma separated (%2C encoded comma)
+ jsonp (string) - jsonp callback identifier, use `0` if not using jsonp
+ userID (string) - userID of the caller
### Example 1 [GET]
+ Parameters
+ param1: `demo`
+ param2: `posts`
+ jsonp: `0`
+ userID: `1234`
### Example 2 [GET]
+ Parameters
+ param1: `demo`
+ param2: `posts%2Ccomments`
+ jsonp: `0`
+ userID: `1234`
+ Response 200
...
+ Response 404
...
Simulated Rendered Example (this is how I wish it looked)
+1 - I am also having trouble figuring this out.
I will add my voice here as a third person trying to figure this out. Hopefully this will be responded to soon!
Has there been any update on this issue?
Three years late, but maybe this will help someone.
Parameters
is used to describe the available parameters for a given endpoint. In your case, you are looking for to describe responses based on various uses of those parameters. You can do this by adding multiple Request
entries with descriptors and different Attributes
.
## MyAPICall [GET /resource/{param1}/{param2}{?jsonp,userID}]
+ Parameters
+ param1 (string) - Blog Subsection
+ param2 (string) - Resources requested, comma separated (%2C encoded comma)
+ jsonp (string) - jsonp callback identifier, use `0` if not using jsonp
+ userID (string) - userID of the caller
+ Request Example 1
+ Attributes
+ param1: `demo`
+ param2: `posts`
+ jsonp: `0`
+ userID: `1234`
+ Response 200
...
+ Request Example 2
+ Attributes
+ param1: `demo`
+ param2: `posts%2Ccomments`
+ jsonp: `0`
+ userID: `1234`
+ Response 200
...
+ Response 404
...```