{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agstack/json-schema/agstack-spraying-recommendation-observation-schema.json",
  "title": "SprayingRecommendationObservation",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agstack-sprayingrecommendation-api-openapi.yml#/components/schemas/SprayingRecommendationObservation",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "readOnly": true
    },
    "activityType": {
      "type": "string",
      "format": "uuid"
    },
    "title": {
      "type": "string",
      "maxLength": 200
    },
    "details": {
      "type": [
        "string",
        "null"
      ]
    },
    "phenomenonTime": {
      "type": "string",
      "format": "date-time"
    },
    "hasEndDatetime": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "madeBySensor": {
      "allOf": [
        {
          "$ref": "#/$defs/MadeBySensorField"
        }
      ]
    },
    "hasAgriParcel": {
      "type": "string",
      "format": "uuid"
    },
    "hasArea": {
      "type": "string",
      "format": "decimal",
      "pattern": "^-?\\d{0,13}(?:\\.\\d{0,2})?$"
    },
    "hasResult": {
      "$ref": "#/$defs/GenericQuantityValueField"
    },
    "observedProperty": {
      "type": "string"
    },
    "usesPesticide": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    }
  },
  "required": [
    "activityType",
    "hasAgriParcel",
    "hasArea",
    "hasResult",
    "id",
    "observedProperty",
    "phenomenonTime",
    "usesPesticide"
  ],
  "$defs": {
    "GenericQuantityValueField": {
      "type": "object",
      "properties": {
        "unit": {
          "type": [
            "string",
            "null"
          ]
        },
        "hasValue": {
          "type": "string"
        }
      },
      "required": [
        "hasValue"
      ]
    },
    "MadeBySensorField": {
      "type": "object",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name"
      ]
    }
  }
}