Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyphen not allowed in expressions #134

Closed
tciuro opened this issue Jul 21, 2015 · 4 comments
Closed

Hyphen not allowed in expressions #134

tciuro opened this issue Jul 21, 2015 · 4 comments
Labels

Comments

@tciuro
Copy link

tciuro commented Jul 21, 2015

I have the following section:

## Some Section [/things/{id}/actions/{non-fatal|with-results}]

Terminal shows the following warning:

>> Line 141: URI template expression "non-fatal|with-build-results" contains hyphens.
Allowed characters for expressions are A-Z a-z 0-9 _ and percent encoded characters
(warning code 12)

Why can't an expression contain an hyphen? Replacing them with an underscore looks uglier:

## Some Section [/things/{id}/actions/{non_fatal|with_results}]

Is there a reason for this, or just an oversight? Thanks.

@danielgtaylor
Copy link
Owner

@tciuro the URI template RFC disallows certain characters. These must be %-encoded. You can try using non%2Dfatal instead, and Aglio 2.0+ should render the - properly.

@tciuro
Copy link
Author

tciuro commented Jul 21, 2015

@danielgtaylor it works... kind of:

  1. the hyphen encoded as %2D works well
  2. The following doesn't show properly well in agile 2.0 (it used to be displayed fine):
## Selection [/things/{id}/actions/{non%2Dfatal|with%2Dresults}]

Question: how would I specify the different parameters allows in a query string so aglio renders it properly?

@tciuro
Copy link
Author

tciuro commented Jul 21, 2015

Also, what happened to the method URI rendering? Before it was colored and not it's bold (rather ugly). Is there a setting I should specify to get the former behavior? Thanks.

@danielgtaylor
Copy link
Owner

@tciuro parameters defined in the URI template will only show if there is an appropriate parameter defined for the resource or action. For example:

# My resource [/things/{id}{?count}]
+ Parameters
  + id (required) - some description
  + count (number) - optional parameter count

It looks like there my be a bug in the filtering when %-encoded names are used, which I'll investigate. Thanks for pointing out that the URIs are now bold on some browsers - I'll fix that as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants