danielgtaylor / aglio

An API Blueprint renderer with theme support that outputs static HTML
4.75k stars 480 forks source link

URL params not rendered #354

Closed MattBlack85 closed 5 years ago

MattBlack85 commented 6 years ago

Hi people, I'm having a strange issue with URL params: in the apib template I have such a definition: ## New activation link [/newactivationlink/{email}]

while after being converted to html I just see: GET /newactivationlink/

This happens with all the URIs, does anybody have any idea why URL params aren't rendered?

jjatria commented 5 years ago

You are probably missing the Parameters section under the action. This tripped me up as well: all URI parameters must be specified in the Parameters section or they will be discarded.

# Foo [/{id}]

+ Parameters

    + id: `example` (string) - A description

+ Request

    ...
falkorichter commented 5 years ago

I have the same issue here:

## End a ride [POST /api/v1/bicycles/{bike_id}/ride/end]

+ Request (application/json)

    + Parameters:

        + bike_id: `db4fb110-7527-43f3-8d40-c3b7897270e5` (string) - The UUID of the bike

does not render the bike_id in the url:

Screenshot 2019-06-27 14 49 40
jjatria commented 5 years ago

Move the Parameters section up one level (so it's at the same level as Request).

You can see in the docs that the URI parameters are a child of the resource, not the request:

## End a ride [POST /api/v1/bicycles/{bike_id}/ride/end]

+ Parameters:

    + bike_id: `db4fb110-7527-43f3-8d40-c3b7897270e5` (string) - The UUID of the bike

+ Request (application/json)

...
Gasol commented 5 years ago

Please refer to answer by @jjatria