Aconex / drakov

Mock Server that implements the API Blueprint specification
MIT License
481 stars 115 forks source link

URL templates were ignored in Action section? #147

Open snakevil opened 7 years ago

snakevil commented 7 years ago

In some project, URL templates were used for some reason in Action sections.

However, those APIs were always responded with 'Cannot GET/POST ...' while mocking.

How to fix that? Thanks.

alex-pex commented 7 years ago

I may have the same problem. I tried to specify an action using a header and a combination of an HTTP method and URI Template, but it isn't understood by Drakov.

## Invoice [/{clientToken}/invoices/{invoiceId}]
...

### Get printable invoice [GET /{clientToken}/invoices/{invoiceId}/print]
...

I get [LOG] Setup Route: GET /:clientToken/invoices/:invoiceId Get printable invoice (notice that /print is missing in the url).

With the following doc:

## Invoice [/{clientToken}/invoices/{invoiceId}]
...

## /{clientToken}/invoices/{invoiceId}/print
### Get printable invoice [GET]
...

I get the expected result [LOG] Setup Route: GET /:clientToken/invoices/:invoiceId/print Get printable invoice.

The API Blueprint allows both notations, but Drakov don't. I could use the 2nd solution but Aglio doesn't produce the same rendering: it adds an extra doc section.