{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agstack/json-schema/agstack-patched-farm-animal-schema.json",
  "title": "PatchedFarmAnimal",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agstack-farmanimals-api-openapi.yml#/components/schemas/PatchedFarmAnimal",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "readOnly": true
    },
    "nationalID": {
      "type": "string"
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 100
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "hasAgriParcel": {
      "type": "string",
      "format": "uuid"
    },
    "sex": {
      "allOf": [
        {
          "$ref": "#/$defs/SexEnum"
        }
      ],
      "minimum": -2147483648,
      "maximum": 2147483647
    },
    "isCastrated": {
      "type": "boolean"
    },
    "species": {
      "type": "string",
      "maxLength": 255
    },
    "breed": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 255
    },
    "birthdate": {
      "type": "string",
      "format": "date-time"
    },
    "isMemberOfAnimalGroup": {
      "$ref": "#/$defs/FarmAnimalGroupSerializerField"
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/StatusEnum"
        }
      ],
      "minimum": -2147483648,
      "maximum": 2147483647
    },
    "invalidatedAtTime": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "dateCreated": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "dateModified": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    }
  },
  "$defs": {
    "FarmAnimalGroupSerializerField": {
      "type": "object",
      "properties": {
        "hasName": {
          "type": "string"
        }
      }
    },
    "SexEnum": {
      "enum": [
        0,
        1,
        2
      ],
      "type": "integer",
      "description": "* `0` - N/A\n* `1` - Female\n* `2` - Male"
    },
    "StatusEnum": {
      "enum": [
        0,
        1,
        2
      ],
      "type": "integer",
      "description": "* `0` - Inactive\n* `1` - Active\n* `2` - Deleted"
    }
  }
}