danielgtaylor / danielgtaylor/aglio

Request parameters breaking when examples and copy has underscores

Open
#170 8 comments 5 reactions 0 assignees View on GitHub
bug upstream
Dominant language
CoffeeScript
Stars
4.7k
Forks
471
PR merge metrics
No merged PRs in 30d

Description

I've noticed an issue when there are underscores as part of the params in the resources.

Here's an example:

```
## Resource Title [/resource/{id}/info{?status,order_by,sort,page,per_page}]

+ Parameters
+ id: 64 (required, string) - user id or 'me'
+ status: paid (optional, string) - transaction status, one of pending, validated, paid, denied
+ order_by: transaction_date (optional, enum) - one of transaction_date, some_name, amount, user_status, status
+ sort: asc (optional, enum) - one of asc, desc
+ page: 1 (optional, integer) - pagination parameter
+ per_page: 5 (optional, integer) - pagination parameter
```

When running aglio against the above, I get the error:

```
>> Line 867: parameter 'order_by: transaction_date' not specified in 'Resource Title' its '/resource/{id}/info{?status,order_by,sort,page,per_page}' URI template (warning code 8)
```

But if I remove all the underscores from the "order_by" params and replace it with:

```
+ order_by: transactiondate (optional, enum) - one of transactiondate, somename, amount, userstatus, status
```

Then it works!
I think the parser is breaking on underscores as parameters.

Anyone else come across this before?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.