Open pmackay opened 8 years ago
:+1: Resource is a thing you want to control with methods like PUT, GET, etc. so for one path there should be one ResourceNode with occasionally more than one method, IMHO.
What about if there are different traits for a method? or security schemes? descriptions? display names? In some form, each method + endpoint will have to be its own object.
I didn't knew that methods can be altered that much. But yeah I think it's a good idea to do objects for methods.
Perhaps rather than changing the API, another property could be added to the Root API, something like api.endpoints
that returns either a list of strings, or a list of (a new kind of) objects. I'll think on this as I start to implement RAML 1.0 spec, and leave this open for any more comments.
Alright, that sounds nice! Thank you!
Perhaps rather than changing the API, another property could be added to the Root API,
I'd like the behavour of api.resources
to change though, so it only returns a list of the resources or URLs, not a list of URL+Method pairs. Thats a significant behaviour change even if the method name doesnt change.
@pmackay that is a significant behavior change, something I'd not be willing to introduce in a 0.x release. How would api.endpoints
not address your concern though?
If api.endpoints
was a list of just the URL endpoints it would help, but personally I think its a questionable fix because that's really what api.resources
should return IMHO. So is it digging a slightly deeper hole? But it would help :)
I've noticed that ResourceNodes include the URI of the resource and the method (GET, POST, etc). Should a ResourceNode just represent the URI and it would have 1 or more associated methods? Most descriptions of resources in REST that I can see suggest a resource is represented by its URI and the methods are operations that can be done to that resource.
I am generating some docs where I want to group methods by resource but this issue created a problem that requires a workaround.