{
  "lexicon": 1,
  "id": "com.fujocoded.guestbook.defs",
  "defs": {
    "guestbookSummaryView": {
      "type": "object",
      "required": ["atUri", "owner"],
      "properties": {
        "atUri": { "type": "string", "format": "at-uri" },
        "owner": {
          "type": "ref",
          "ref": "#profileView"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 8096000,
          "maxGraphemes": 4096000
        },
        "submissionsCount": {
          "type": "integer"
        },
        "hiddenSubmissionsCount": {
          "type": "integer",
          "description": "If the requesting user is the owner of the guestbook, we also return information about hidden submissions."
        }
      }
    },
    "guestbookView": {
      "type": "object",
      "required": ["atUri", "owner", "submissions"],
      "properties": {
        "atUri": { "type": "string", "format": "at-uri" },
        "owner": {
          "type": "ref",
          "ref": "#profileView"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 8096000,
          "maxGraphemes": 4096000
        },
        "submissions": {
          "type": "array",
          "items": {
            "type": "ref",
            "ref": "#submissionView"
          }
        }
      }
    },
    "submissionView": {
      "type": "object",
      "required": ["atUri", "author", "createdAt"],
      "properties": {
        "atUri": { "type": "string", "format": "at-uri" },
        "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 8096000,
          "maxGraphemes": 4096000
        },
        "createdAt": {
          "type": "string",
          "format": "datetime"
        },
        "author": {
          "type": "ref",
          "ref": "#profileView"
        },
        "hidden": {
          "type": "boolean",
          "default": false,
          "description": "If the requesting user is the owner of the guestbook, we also return hidden submissions."
        }
      }
    },
    "profileView": {
      "type": "object",
      "required": ["did"],
      "properties": {
        "did": {
          "type": "string",
          "format": "did"
        },
        "handle": { "type": "string", "format": "handle" },
        "avatar": { "type": "string", "format": "uri" }
      }
    }
  }
}

