---
$schema: http://json-schema.org/draft-07/schema#
definitions:
  ref1:
    type: array
    items:
      $ref: '#/definitions/ref2'
  ref2:
    type: string
    minLength: 1
  ref3:
    type: integer
  dupe_name:
    type: integer
  i_have_nested_refs:
    type: object
    properties:
      my_key1:
        $ref: '#/definitions/ref1'
      my_key2:
        $ref: '#/definitions/ref1'
  # actually a person, as in https://json-schema.org/understanding-json-schema/structuring.html
  i_have_a_recursive_ref:
    type: object
    properties:
      name:
        type: string
      children:
        type: array
        items:
          $ref: '#/definitions/i_have_a_recursive_ref'
        default: []
  i_have_a_ref_to_another_file:
    type: object
    properties:
      name:
        $ref: more-bundle2.yaml#/definitions/my_name
      address:
        $ref: more-bundle2.yaml#/definitions/my_address
      secrets:
        $ref: '#/definitions/ref1'
  i_am_a_ref:
    $ref: '#/definitions/ref1'
  i_am_a_ref_level_1:
    $ref: '#/definitions/i_am_a_ref_level_2'
  i_am_a_ref_level_2:
    $ref: '#/definitions/ref3'
  i_am_a_ref_to_another_file:
    $ref: more-bundle2.yaml#/definitions/i_have_a_ref_to_the_first_filename
  i_am_a_ref_with_the_same_name:
    $ref: more-bundle2.yaml#/definitions/i_am_a_ref_with_the_same_name
  i_have_refs_with_the_same_name:
    type: object
    properties:
      me:
        $ref: '#/definitions/i_am_a_ref_with_the_same_name'
  i_contain_refs_to_same_named_definitions:
    type: object
    properties:
      foo:
        $ref: '#/definitions/dupe_name'
      bar:
        $ref: more-bundle2.yaml#/definitions/dupe_name
  i_have_a_ref_with_the_same_name:
    type: object
    properties:
      name:
        type: string
      children:
        type: array
        items:
          $ref: more-bundle2.yaml#/definitions/i_have_a_ref_with_the_same_name
        default: []
