Closed bpowell65536 closed 8 years ago
96.93%
Branch #92 has no coverage reports uploaded yet.
Powered by Codecov. Updated on successful CI builds.
Question: is resourcePathName supposed to be the last bit of the path, (eg /{id}
) or the "full" path (eg /users/{id}
)?
@econchick The RAML 0.8 spec says:
In resource type definitions, there are two reserved parameter names: resourcePath and resourcePathName. The processing application MUST set the values of these reserved parameters to the inheriting resource's path (for example, "/users") and the part of the path following the rightmost "/" (for example, "users"), respectively."
To answer your question: It looks like resourcePathName
is supposed to be the last part of the path, but without any leading '/' character (i.e. path.split("/")[-1]
). The full path (including all the '/' characters) is provided as well, as the resourcePath
parameter.
@bpowell65536 I did read that, but it's unclear in the spec's example if /users
is a root-level defined resource or a child resource, if that makes sense.
The example is ambiguous in that regard, but given that resourcePathName
is
the part of the path following the rightmost "/"
does it matter if the resource is a root-level resource or a child resource? The example says "/users" resolves to "users", but wouldn't "/root/users" also resolve to "users"?
Nope, you're right - I am just an idiot :D
Before I merge this, could you rebase on v0.2.0-dev to fix the merge conflicts?
@econchick Great, I was hoping I hadn't really screwed up my reading of the spec there :P I'll rebase this from v0.2.0-dev now.
Thanks!
The parameters section of the RAML 0.8 spec states that the
<<resourcePathName>>
reserved parameter should be populated with the section of the resource path after the right-most '/' character. Currentlyramlfications
populates the<<resourcePathName>>
parameter with the section of the resource path after the left-most '/' character. This change corrects this behaviour.