membrane / soa-model

Toolkit and Java API for WSDL, WADL and XML Schema.
http://www.membrane-soa.org/soa-model/
Apache License 2.0
93 stars 73 forks source link

Resource.getFullPath() should only append a '/' to the path if it doesn't start with a slash #147

Closed helpermethod closed 11 years ago

helpermethod commented 11 years ago

If the path of a resource starts with a / the full path is constructed wrong:

Example:

base = 'http://sandbox.openapi.etsy.com/v2/private' path = '/consoles'

Results in 'http://sandbox.openapi.etsy.com/v2/private//consoles'

Example WADL: https://github.com/apigee/wadl-library/blob/master/etsy/etsy-wadl.xml

Is:

public String getFullPath() {
    parent.fullPath + "/${path}"
}

Should be:

public String getFullPath() {
    parent.fullPath + (path.startsWith('/') ? path: "/$path")
}