apiaryio / api-blueprint

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

Uri used for multiple actions #336

Open jbrauchler opened 8 years ago

jbrauchler commented 8 years ago

Is there a way to make it so that if you have multiple actions with the same uri to document that but still have labels for each action that show up above in the documentation.

Something like this....

## /pizzas/{pizzaId}

### Customize a pizza [PUT]
+ details for put

### Delete pizza {DELETE]
+ details for delete
pksunkara commented 8 years ago

Did you want something like the following?

## Pizza [/pizzas/{id}]

+ Parameters
    + id - Id of the pizza

### Customize a Pizza [PUT]
...

### Delete a Pizza [DELETE]
...
jbrauchler commented 8 years ago

I know how to accomplish that, I was trying to make it so that each action within the api has its own label above it.

pksunkara commented 8 years ago

Are you looking for something like this?

## Customize Pizza [PUT /pizzas/{id}]
...

## Delete Pizza [DELETE /pizzas/{id}]
...
jbrauchler commented 8 years ago

Yes exactly but I attempted that, and it doesn't work because they have the same uri

pksunkara commented 8 years ago

@jbrauchler True, you would get a warning on that because they have the same url endpoint and thus should be merged into a single resource instead of 2 different actions according to good API design.

jbrauchler commented 8 years ago

Is there a way to get around that by chance?

pksunkara commented 8 years ago

AFAIK, no.

jbrauchler commented 8 years ago

Okay Thanks

kylef commented 5 years ago

@jbrauchler can you please elaborate on what you are refering to when you say "label above it".

The following example will allow you to add description for each action.

FORMAT: 1A

# Pizza API

## Pizza [/pizzas/{id}]

+ Parameters
    + id: abc

## Customise Pizza [PUT]

Description for customising a pizza

## Delete Pizza [DELETE]

Description for deleting a pizza

Rendered:

screenshot 2019-01-10 at 18 01 05