Hi Max,

Where did you refer from about the ** covers "/"? I couldn't find a clear 
definition in RFC 6570.
Specifically, I am using Google Cloud Endpoints and a path "/**" covers all 
paths including "/", but I would like to find a clear definition on it.
If you can post a link here it would be great.

Thanks,
Yunzhu


On Friday, October 24, 2014 at 6:40:13 PM UTC-4, Max Lincoln wrote:
>
> Just for clarity, the ** means that it could contain a "/" or other 
> reserved characters, right? So you want it to match "/foo/bar/baz", not 
> just "/foo/bar".
>
> If you just need to match a single word without reserved URI characters 
> than "/foo/{some_variable}" would work.
>
> The spec doesn't clearly mention it, but the working group was modeling 
> path templating after RFC 6570 
> <https://www.google.com/url?q=https%3A%2F%2Ftools.ietf.org%2Fhtml%2Frfc6570&sa=D&sntz=1&usg=AFQjCNFuKEzvhz3frfOgHzdhyXe1SKa3Gw>
>  
> URI templates, and what you're talking about is basically the distinction
> between "level 1" and "level 2" support (out of 4 levels).
>
> The syntax difference is:
> Level 1 (Simple String Expansion): /foo/{path}
> Level 2 (Reserved Expansion):       /foo/{+path}
>
> If you were expanding "/bar/baz" the level 1 template would either raise 
> an error or turn it into "%2Fbar%2Fbaz" while the level 2 template would 
> plug the value into the URL without altering the slashes.
> Similarly, if you were trying to match a URL to an API operation then 
> level 1 would match "/foo/bar" but not "/foo/bar/baz" while level 2 would 
> match either.
>
> I'm a proponent of eventually supporting at least level 2 and hopefully 
> all levels of RFC 6570, but the tools need time to catch up and people 
> needed time to consider the techniques
> and consequences of advanced templates. In particular (re: level 2) Tony's 
> concern was:
>   > in level 2 expansion, supporting substitution in path parameters may 
> lead to indeterminate matching.  That is, it can create situations where 
> the operation being performed is ambiguous or subject to overly complicated 
> matching.
>
> Ron: I think the spec should mention RFC 6570 and clarify if support is 
> level 1 only or level 1 & 2.
>
>
> On Fri, Oct 24, 2014 at 5:56 PM, Ed Parris <[email protected] 
> <javascript:>> wrote:
>
>>
>> I currently have a single REST endpoint mapped to a variety of paths 
>> https://localhost/resurce/foo/**. The ** part of the URL is specific to 
>> the resource and defined elsewhere in our API documentation. I'm wondering 
>> if the "Try it" portion of the Swagger UI can be configured to allow users 
>> to type in that part of the URL. We're using swagger-springmvc + the 
>> swagger-core annotations. 
>>
>> Any suggestions?
>>
>> Thanks,
>> Ed
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to