source:
  schema:
      definitions:
          user:
              type: object
              additionalProperties: false
              properties:
                name: {type: string}
          user_with_bonus:
              type: object
              additionalProperties: false
              properties:
                name: {type: string}
                bonus: {type: string}

      type: object
      properties:
          profile: {$ref: "#/definitions/user" }

      $wild: {$ref: "#/definitions/user_with_bonus" }

      examples:
          - {profile: {name: "sally"}}
          - {"wild1": {name: "joe", bonus: "some"}}
      nonexamples:
          - {profile: {name: "joe", bonus: "some"}}
          - {"wild1": {name: "joe", bonus: "some", bonus_bonus: "blah"}}

  access:
      -   location:   "/"
          write:      true

expected: {"rules":{".write":"false",".read":"false","profile":{".write":"((((!newData.exists()||newData.hasChildren())&&(!newData.child('name').exists()||newData.child('name').isString()))))",".read":"false","name":{".write":"((((!newData.exists()||newData.isString()))))",".read":"false"},"$other":{".validate":"false"}},"$wild":{".write":"((((!newData.exists()||newData.hasChildren())&&(!newData.child('name').exists()||newData.child('name').isString())&&(!newData.child('bonus').exists()||newData.child('bonus').isString()))))",".read":"false","name":{".write":"((((!newData.exists()||newData.isString()))))",".read":"false"},"bonus":{".write":"((((!newData.exists()||newData.isString()))))",".read":"false"},"$other":{".validate":"false"}}}}
