{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/farmos/json-schema/farmos-plan-request-schema.json",
  "title": "PlanRequest",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/farmos-plans-api-openapi.yml#/components/schemas/PlanRequest",
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "$ref": "#/$defs/PlanData"
    }
  },
  "$defs": {
    "JsonApiLinks": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string",
          "format": "uri"
        },
        "related": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "PlanAttributes": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Plan name"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "archived"
          ]
        },
        "notes": {
          "type": "object",
          "properties": {
            "value": {
              "type": "string"
            },
            "format": {
              "type": "string"
            }
          }
        },
        "created": {
          "type": "integer",
          "readOnly": true
        },
        "changed": {
          "type": "integer",
          "readOnly": true
        }
      }
    },
    "PlanData": {
      "type": "object",
      "required": [
        "type",
        "attributes"
      ],
      "properties": {
        "type": {
          "type": "string"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "attributes": {
          "$ref": "#/$defs/PlanAttributes"
        },
        "links": {
          "$ref": "#/$defs/JsonApiLinks"
        }
      }
    }
  }
}