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

I don't see 'uses' in Api or Library, or ... Why? #44

Open
sichvoge opened this issue Apr 14, 2016 · 1 comment
Open

I don't see 'uses' in Api or Library, or ... Why? #44

sichvoge opened this issue Apr 14, 2016 · 1 comment
Labels

Comments

@sichvoge
Copy link
Contributor

No description provided.

@KonstantinSviridov
Copy link
Contributor

It appears that general approach to uses can not be described by the spec in elegant way. Formally, uses is a property of Api, Library and fragment.

As everything can appear as fragment you have to possibilities of invloving uses into the spec:

  • Let all types have uses property.
  • For each type create a subtype with uses property

The first approach in not hundred percent correct as uses does not have sense for ordinary usages of most types.
The second approach overloads the spec.

Me and @petrochenko-pavel-a decided to allow all AST nodes provide their declaring fragment (API, Overlay, Library can also be viewed as fragment) represented by the Fragment interface:

interface Fragment{
  //List of libraries used by the fragment
  uses():UsesEntry[];

  //AST node representing the fragment
  node():BasicNode;
}

This approach allows access to RAML spec' uses from each node of AST tree. You can check it the newest Java interfaces I sent you.

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

No branches or pull requests

2 participants