#taken from access.md
functions:
  - red():   auth.username == 'red'
  - black(): auth.username == 'black'

schema:
  type: object
  properties:
    chld1:
      type: object
      constraint: red()
      properties:
        grnd1:
          type: string
          constraint: red() || black()
        grnd2:
          type: string
          constraint: true
    chld2:
      type: object
      properties:
        grnd3:
          type: string
          constraint: black()
        grnd4:
          type: string
          constraint: red() || black()

  examples:
    - {chld1: {grnd1: "a", grnd2: "b"}, chld2: {grnd3: "c", grnd4: "d"}}
  nonexamples:
    - {chld1: {grnd1: true, grnd2: "b"}, chld2: {grnd3: "c", grnd4: "d"}} #boolean instead of string

access:
  - location: "/chld1"
    write: red()

  - location: "/"
    write: black()
