-
Notifications
You must be signed in to change notification settings - Fork 368
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
Should named parameters with hyphens work? #63
Comments
Though I don't see it in the readme, the only supported tokens are those in the JavaScript "\w" set, mainly because the patterns were originally designed in Express 4 for use in JavaScript variables and properties. I don't have an opinion on supporting the dash, only would note that it would be a breaking change in behavior (think of the route "/:lang-:country/*"). |
Thanks for responding. I'll let @theganyo read up on this since he was the original reporter and we'll go from there. |
@whitlockjc Doug beat me to it, and this should be added to the README, but it's not supported and likely won't be. As a side note, I don't know how you're technically handling Swagger documents and path syntax, but for RAML I implemented a custom path matcher implementation and eventually a router (since RAML does validation on URI parameters). It's likely you don't need to do that - Swagger is only Level 1 Template URIs right? (@dougwilson, this might be interesting going to back when you mentioned having a router that supported the RFC for template URIs). I couldn't find where you were actually handling the path stuff to create middleware, so this is just a brain dump of information. Side note: I was reading through https://github.com/apigee-127/swagger-tools/blob/408e252345578716bd52b607948e287a2eb196c2/middleware/swagger-metadata.js#L327-L330 and I think it's a bug? The |
I'm not sure why you couldn't support As for the potential bug in swagger-tools' Thanks a lot for looking into this. |
Just replied to the linked topic, but for ease I'll quote it here:
For non-Swagger related tools, if you follow support for the RFC, then you probably wouldn't want to add support for it. |
Should
/some/:object-id
be supported? I do not get an error when parsing a path like this but the generated regular expression never matches paths I would expect to like/some/1
or/some/name
. Before I assume it's an error, I wanted to ask.This originally came up in apigee-127/swagger-tools/issues/289.
The text was updated successfully, but these errors were encountered: