{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/sewerai/main/json-schema/sewerai-note-schema.json",
  "title": "Note",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sewerai-note-api-openapi.yml#/components/schemas/Note",
  "required": [
    "inspection_sid"
  ],
  "type": "object",
  "properties": {
    "sid": {
      "title": "Sid",
      "type": "string",
      "format": "uuid",
      "readOnly": true
    },
    "created": {
      "title": "Created",
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "created_by": {
      "title": "Created by",
      "type": "string",
      "readOnly": true
    },
    "deleted": {
      "title": "Archived",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true
    },
    "comment_set": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Comment"
      },
      "readOnly": true
    },
    "status": {
      "title": "Status",
      "type": "string",
      "enum": [
        "failed",
        "needs_correction",
        "open",
        "passed"
      ]
    },
    "inspection_sid": {
      "title": "Inspection sid",
      "type": "string",
      "maxLength": 64,
      "minLength": 1
    },
    "video": {
      "title": "Video",
      "type": "string",
      "readOnly": true,
      "minLength": 1
    },
    "text": {
      "title": "Text",
      "type": [
        "string",
        "null"
      ]
    },
    "viewed_by": {
      "title": "Viewed by",
      "type": "object",
      "readOnly": true
    },
    "viewed_by_user_sid": {
      "title": "Viewed by user sid",
      "type": "string",
      "maxLength": 64,
      "minLength": 1
    },
    "url": {
      "title": "Url",
      "type": "string",
      "format": "uri",
      "readOnly": true
    },
    "inspection": {
      "title": "Inspection",
      "type": "string",
      "readOnly": true
    },
    "is_editable": {
      "title": "Is editable",
      "type": "string",
      "readOnly": true
    },
    "escalation_count": {
      "title": "Escalation count",
      "type": "integer",
      "readOnly": true
    }
  },
  "$defs": {
    "Comment": {
      "required": [
        "note_sid"
      ],
      "type": "object",
      "properties": {
        "sid": {
          "title": "Sid",
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "created": {
          "title": "Created",
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "created_by_username": {
          "title": "Created by username",
          "type": "string",
          "readOnly": true,
          "minLength": 1
        },
        "deleted": {
          "title": "Archived",
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "readOnly": true
        },
        "picture": {
          "title": "Picture",
          "type": "string",
          "readOnly": true
        },
        "text": {
          "title": "Text",
          "type": [
            "string",
            "null"
          ]
        },
        "note_sid": {
          "title": "Note sid",
          "type": "string",
          "maxLength": 64,
          "minLength": 1
        },
        "url": {
          "title": "Url",
          "type": "string",
          "format": "uri",
          "readOnly": true
        },
        "tagged_users": {
          "title": "Tagged users",
          "type": "string",
          "readOnly": true
        },
        "is_editable": {
          "title": "Is editable",
          "type": "string",
          "readOnly": true
        }
      }
    }
  }
}