{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/doorloop/json-schema/doorloop-note-schema.json",
  "title": "note",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/doorloop-notes-api-openapi.yml#/components/schemas/note",
  "x-stoplight": {
    "id": "g3gxurg6g7l2i"
  },
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/mongoId"
    },
    "title": {
      "type": "string",
      "maxLength": 255
    },
    "body": {
      "type": "string",
      "maxLength": 10000
    },
    "tags": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/mongoId"
      }
    },
    "linkedResource": {
      "$ref": "#/$defs/noteLinkedResource"
    },
    "createdAt": {
      "description": "Read Only",
      "type": "number"
    },
    "createdBy": {
      "type": "string",
      "description": "Read Only"
    }
  },
  "required": [
    "title",
    "linkedResource"
  ],
  "$defs": {
    "mongoId": {
      "type": "string",
      "title": "mongoId",
      "x-stoplight": {
        "id": "40j7qlmpihfdj"
      },
      "pattern": "/^[a-f\\d]{24}$/i"
    },
    "noteLinkedResource": {
      "title": "noteLinkedResource",
      "x-stoplight": {
        "id": "tdd2wdxg0yyjm"
      },
      "type": "object",
      "properties": {
        "resourceId": {
          "$ref": "#/$defs/mongoId"
        },
        "resourceType": {
          "type": "string",
          "enum": [
            "TENANT",
            "OWNER",
            "VENDOR",
            "PROPERTY",
            "UNIT",
            "LEASE",
            "LEASE_DRAFT",
            "TASK",
            "RENTAL_APPLICATION"
          ]
        }
      },
      "required": [
        "resourceId",
        "resourceType"
      ]
    }
  }
}