title: How to refer to enclosing type definition recursively in OpenAPI / Swagger?
body: <p>I'm writing an OpenAPI definition in Swagger Editor.</p>
  
  <p>One of my type definitions contains an array containing child elements of the same type as the parent. I.e. something like this:</p>
  
  <pre class="lang-yaml prettyprint-override"><code>definitions:
    TreeNode:
      type: object
      properties:
        name:
          type: string
          description: The name of the tree node.
        children:
          type: array
          items:
            $ref: '#/definitions/TreeNode'
  </code></pre>
  
  <p>However, Swagger Editor doesn't pick up the recursive reference in the <code>children</code> array, which is simply shown as an array of "undefined" elements.</p>
  
  <p>Does anybody have an idea on how to do this?`</p>