Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Its undefined whether resource level traits should be applied to nested resources #69

Open
eliaslevy opened this issue Aug 5, 2014 · 4 comments

Comments

@eliaslevy
Copy link

The spec defines resource level traits, stating they should be applied to all methods within the resource:

A trait may also be applied to a resource by using the is key, which is equivalent to applying the trait to all methods for that resource, whether declared explicitly in the resource definition or inherited from a resource type.

But the spec is silent on whether these traits should also be inherited by nested resources.

@comptly
Copy link
Contributor

comptly commented Aug 7, 2014

Conversation continued over on the RAML forums: http://forums.raml.org/t/resource-level-trait-inheritance/396/4

Takeaway is that since nesting resources does not imply an inheritance chain, it would be nice to be explicit about it.

@usarid
Copy link
Contributor

usarid commented Aug 12, 2014

Since the spec doesn't say there is inheritance, there isn't any inheritance. We might indeed clarify that in the spec, but honestly if we were to explicitly clarify all the things that could have been but are not, we might never finish... ;-)

@eliaslevy
Copy link
Author

Traits are inherited from a resource to its methods. While the spec is silent on whether these resource traits are inherited by nested resources, I don't think is farfetched for someone implementing a parser and code generator to wonder whether nested resource should also inherit these.

@usarid
Copy link
Contributor

usarid commented Aug 17, 2014

Resource level traits are indeed applied to ask the resource's methods,
because the RAML spec says so explicitly. Nonetheless, we will be
clarifying that in the spec.

Thanks,
Uri
On Aug 15, 2014 11:35 AM, "eliaslevy" notifications@github.com wrote:

Traits are inherited from a resource to its methods. While the spec is
silent on whether these resource traits are inherited by nested resources,
I don't think is farfetched for someone implementing a parser and code
generator to wonder whether nested resource should also inherit these.


Reply to this email directly or view it on GitHub
#69 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

4 participants