apiaryio / api-blueprint

API Blueprint
https://apiblueprint.org
MIT License
8.64k stars 2.14k forks source link

Parameters for some HTTP verbs only #353

Closed andrey-shostik closed 8 years ago

andrey-shostik commented 8 years ago
# mev-test
Polls is a simple API allowing consumers to view polls and vote in them.

## Show User Feed [/statuses/user_timeline.json]
+ Parameters
    + user_id (optional, number, `12345`) ... Set to `true` to remove instead of deactivate
    + screen_name (optional, text, `notario`) ... The screen name of the user for whom to return results for.

### /statuses/user_timeline.json [GET]

+ Response 200 (application/json)

The two parameters needs to be defined at resource level, else I get a warning:

parameter 'user_id' not specified in 'Show User Feed' its '/statuses/user_timeline.json' URI template Line: 8• API Blueprint
parameter 'screen_name' not specified in 'Show User Feed' its '/statuses/user_timeline.json' URI template Line: 8• API Blueprint

Am i doing something wrong? How can we define parameters for some verbs only?

pksunkara commented 8 years ago

@andrey-shostik You need to make sure that the parameters are present in the URLs. You should be able to get this working by adding parameters under the actions.

# mev-test
Polls is a simple API allowing consumers to view polls and vote in them.

## Show User Feed [/statuses/user_timeline.json]

### Get Feed [GET /statuses/user_timeline.json{?user_id,screen_name}]
+ Parameters
    + user_id (optional, number, `12345`) ... Set to `true` to remove instead of deactivate
    + screen_name (optional, text, `notario`) ... The screen name of the user for whom to return results for.

+ Response 200 (application/json)