{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/assignar/json-schema/assignar-asset-classes-schema.json",
  "title": "AssetClasses",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/assignar-asset-classes-api-openapi.yml#/components/schemas/AssetClasses",
  "type": "array",
  "items": {
    "$ref": "#/$defs/AssetClassDetail"
  },
  "$defs": {
    "AssetClass": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "code": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "AssetClassDetail": {
      "description": "An asset class as returned by the `/asset-classes` collection. Extends the `AssetClass` summary — the four fields the `assetClass` relation selects when embedded in an asset or a site diary entry — with the audit columns and their hydrated user objects.",
      "allOf": [
        {
          "$ref": "#/$defs/AssetClass"
        },
        {
          "type": "object",
          "properties": {
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "System managed. Defaults to the time of creation.",
              "readOnly": true
            },
            "created_by_id": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Identifier of the user who created the asset class. Not set by `POST /asset-classes` — the public API does not stamp it — so it is null for classes created through this API.",
              "readOnly": true
            },
            "modified_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "System managed. Updated by the database on every write, and null until the asset class is first updated.",
              "readOnly": true
            },
            "modified_by_id": {
              "type": [
                "integer",
                "null"
              ],
              "description": "Identifier of the user who last modified the asset class. Not set by `PUT /asset-classes/{assetClassId}` — the public API does not stamp it.",
              "readOnly": true
            },
            "createdBy": {
              "allOf": [
                {
                  "$ref": "#/$defs/UserReference"
                }
              ],
              "description": "The user named by `created_by_id`, hydrated by default with no `relations` query parameter. When `created_by_id` is null the object is still present with every field set to null, rather than the object itself being null.",
              "readOnly": true
            },
            "modifiedBy": {
              "allOf": [
                {
                  "$ref": "#/$defs/UserReference"
                }
              ],
              "description": "The user named by `modified_by_id`, hydrated by default with no `relations` query parameter. When `modified_by_id` is null the object is still present with every field set to null, rather than the object itself being null.",
              "readOnly": true
            }
          }
        }
      ]
    },
    "UserReference": {
      "type": "object",
      "properties": {
        "user_id": {
          "type": "integer"
        },
        "username": {
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      }
    }
  }
}