Recursive reference


#1

Can someone please help with this.

contents of workItem.raml

#%RAML 1.0 DataType
type: object
properties: 
  Description:
    type: string
  reference:
    type: string
  weight:
    type: number
  workItmes;
    type: workItem[]

trying to define a property which have an array of type defined in the type being defined. So in turn each of item in workItems will have workItem and array of workItems.


#2

I would most probably use libraries here.

#%RAML 1.0 Library

types:
  workItem: 
    type: object
    properties: 
      Description:
        type: string
      reference:
        type: string
      weight:
        type: number
      workItmes:
        type: workItem[]

#3

Thanks. It was really helpful.