raml-org / raml-js-parser

(deprecated) A RAML parser based on PyYAML written in CoffeScript and available for use as NodeJs module or in-browser.
195 stars 53 forks source link

Added trailing slash support to resourcePathName #162

Closed gmathieu closed 8 years ago

gmathieu commented 8 years ago

Any objections to this PR?

dmartinezg commented 8 years ago

Actually, I disagree with this fix, if you use a resource's path that ends in slash, as per defined in the spec, the resourcePathName should be null, right?

I know it does not make sense, but that is the side effect of using slashes at the end or a resource.

gmathieu commented 8 years ago

Is there another way to define endpoints trailing slashes and still be able to use the resourcePathName?

dmartinezg commented 8 years ago

There is no variable for the parent of a resource.

gmathieu commented 8 years ago

Would you happen to know if 1.0 addresses this?

gmathieu commented 8 years ago

I found a way to do this. Sorry for the trouble.

# this returned null
/resource/:
    get:
        ...

    /{id}:
        get:
            ...

# this works and seems cleaner
/resource:
    /:
        get:
            ...

    /{id}:
        get:
            ...