{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agstack/json-schema/agstack-patched-farm-parcel-schema.json",
  "title": "PatchedFarmParcel",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agstack-farmparcels-api-openapi.yml#/components/schemas/PatchedFarmParcel",
  "type": "object",
  "properties": {
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/StatusEnum"
        }
      ],
      "minimum": -2147483648,
      "maximum": 2147483647
    },
    "deleted_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "readOnly": true
    },
    "identifier": {
      "type": "string",
      "maxLength": 255
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "validFrom": {
      "type": "string",
      "format": "date-time"
    },
    "validTo": {
      "type": "string",
      "format": "date-time"
    },
    "area": {
      "type": "string",
      "format": "decimal",
      "pattern": "^-?\\d{0,13}(?:\\.\\d{0,2})?$"
    },
    "hasIrrigationFlow": {
      "type": [
        "string",
        "null"
      ],
      "format": "decimal",
      "pattern": "^-?\\d{0,13}(?:\\.\\d{0,2})?$"
    },
    "category": {
      "type": "string"
    },
    "inRegion": {
      "type": [
        "string",
        "null"
      ]
    },
    "hasToponym": {
      "type": [
        "string",
        "null"
      ]
    },
    "isNitroArea": {
      "type": "boolean"
    },
    "isNatura2000Area": {
      "type": "boolean"
    },
    "isPdopgArea": {
      "type": "boolean"
    },
    "isIrrigated": {
      "type": "boolean"
    },
    "isCultivatedInLevels": {
      "type": "boolean"
    },
    "isGroundSlope": {
      "type": "boolean"
    },
    "depiction": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "maxLength": 500
    },
    "hasGeometry": {
      "$ref": "#/$defs/GeometrySerializerField"
    },
    "location": {
      "$ref": "#/$defs/LocationSerializerField"
    },
    "hasAgriCrop": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "readOnly": true
    },
    "farm": {
      "type": "string",
      "format": "uuid"
    }
  },
  "$defs": {
    "GeometrySerializerField": {
      "type": "object",
      "properties": {
        "asWKT": {
          "type": "string"
        }
      },
      "required": [
        "asWKT"
      ]
    },
    "LocationSerializerField": {
      "type": "object",
      "properties": {
        "lat": {
          "type": "string",
          "format": "decimal",
          "pattern": "^-?\\d{0,3}(?:\\.\\d{0,14})?$"
        },
        "long": {
          "type": "string",
          "format": "decimal",
          "pattern": "^-?\\d{0,3}(?:\\.\\d{0,14})?$"
        }
      },
      "required": [
        "lat",
        "long"
      ]
    },
    "StatusEnum": {
      "enum": [
        0,
        1,
        2
      ],
      "type": "integer",
      "description": "* `0` - Inactive\n* `1` - Active\n* `2` - Deleted"
    }
  }
}