raml-java-parser icon indicating copy to clipboard operation
raml-java-parser copied to clipboard

Identifying named type references

Open KevinMitchell opened this issue 7 years ago • 0 comments

Suppose I define the following type:

types:
  Foo:
    enum: [X]
  FooArray: Foo[]
  Test:
    properties:
      a: Foo
      b:
        enum: [X]
      c: Foo[]
      d: FooArray
      e:
        type: array
        items:
          enum: [X]

And I'm navigating a RAML model and come across an object of type Test. When I traverse the properties of this object how can I know when a type declaration td has an inlined type or a reference to a named type? If I look at td.type() I can get a clue, as I see types such as Foo, string, Foo[], FooArray and array respectively. But I don't really want to have to parse the response from the call to type() just to determine whether I'm referring to a named type, a primitive one, or an inlined one. But looking at the JavaDoc I couldn't see an alternative. Is there a better approach?

Aha! Link: https://mulesoft-roadmap.aha.io/features/APIRAML-100

KevinMitchell avatar Feb 26 '17 10:02 KevinMitchell