petrochenko-pavel-a / raml-js-parser2-issues

0 stars 0 forks source link

Make explicit the collapsing of consecutive slashes due to a trailing slash in the base URI #41

Closed VasiliyLysokobylko closed 8 years ago

VasiliyLysokobylko commented 8 years ago

When the base URI ends in one or more slashes (/), those trailing slashes are to be omitted in constructing the absolute paths for the resources using that base URI.

For example, in

baseUri: http://api.test.com/common/
/users:
  /groups:

the absolute paths for the two resources are http://api.test.com/common/users and http://api.test.com/common/users/groups.

In a more complicated examples with consecutive slashes in multiple places, note that only trailing slashes in the base URI are collapsed:

baseUri: //api.test.com//common//
/:
  /users/:
    /groups//:

leads to the following 3 resource absolute paths: //api.test.com//common/, //api.test.com//common//users/ and //api.test.com//common//users//groups//.

Various clients and servers may choose to handle these in different ways, but from an HTTP and RAML perspective, these are the resource paths.

VasiliyLysokobylko commented 8 years ago

https://github.com/raml-org/raml-spec/issues/256