{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/livestockmarketprices-com/json-schema/livestockmarketprices-com-methodologies-response-schema.json",
  "title": "MethodologiesResponse",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/livestockmarketprices-com-openapi.json#/components/schemas/MethodologiesResponse",
  "type": "object",
  "required": [
    "data",
    "meta",
    "citation"
  ],
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MethodologyRecord"
      }
    },
    "meta": {
      "$ref": "#/$defs/Meta"
    },
    "citation": {
      "$ref": "#/$defs/Citation"
    }
  },
  "$defs": {
    "Citation": {
      "type": "object",
      "properties": {
        "publisher_name": {
          "type": "string",
          "const": "Livestock Market Prices"
        },
        "canonical_url": {
          "type": "string",
          "format": "uri"
        },
        "primary_sources": {
          "minItems": 1,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "publisher_name": {
                "type": "string",
                "minLength": 1
              },
              "report_url": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": [
              "publisher_name",
              "report_url"
            ],
            "additionalProperties": false
          }
        },
        "sale_dates": {
          "minItems": 1,
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          }
        },
        "retrieved_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "dataset_revision": {
          "type": "string",
          "minLength": 1
        },
        "methodology_version": {
          "type": "string",
          "minLength": 1
        },
        "statistic_type": {
          "type": "string",
          "enum": [
            "reported_range",
            "reported_average",
            "reported_weighted_average",
            "publisher_top_of_market_range",
            "derived_midpoint",
            "derived_valuation"
          ]
        },
        "attribution_text": {
          "type": "string",
          "minLength": 1
        },
        "rights_url": {
          "type": "string",
          "format": "uri"
        },
        "use_requirements": {
          "type": "object",
          "properties": {
            "source_attribution_required": {
              "type": "boolean",
              "const": true
            },
            "source_link_required": {
              "type": "boolean",
              "const": true
            },
            "claim_as_original_data_prohibited": {
              "type": "boolean",
              "const": true
            },
            "terms_url": {
              "type": "string",
              "const": "https://livestockmarketprices.com/terms#terms-sources"
            }
          },
          "required": [
            "source_attribution_required",
            "source_link_required",
            "claim_as_original_data_prohibited",
            "terms_url"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "publisher_name",
        "canonical_url",
        "primary_sources",
        "sale_dates",
        "retrieved_at",
        "dataset_revision",
        "methodology_version",
        "statistic_type",
        "attribution_text",
        "rights_url",
        "use_requirements"
      ],
      "additionalProperties": false
    },
    "Meta": {
      "type": "object",
      "required": [
        "api_version",
        "dataset_revision",
        "methodology_version",
        "applied_filters",
        "next_cursor",
        "generated_at"
      ],
      "additionalProperties": false,
      "properties": {
        "api_version": {
          "type": "string",
          "const": "1.3.0-alpha.1"
        },
        "dataset_revision": {
          "type": "string"
        },
        "methodology_version": {
          "type": "string"
        },
        "applied_filters": {
          "type": "object",
          "additionalProperties": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              }
            ]
          }
        },
        "next_cursor": {
          "type": [
            "string",
            "null"
          ]
        },
        "generated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "MethodologyRecord": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "version",
        "name",
        "definition",
        "canonical_url",
        "status",
        "effective_at"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "kind": {
          "type": "string",
          "enum": [
            "publication",
            "regional_reference",
            "valuation",
            "haul",
            "sell_or_hold",
            "index"
          ]
        },
        "version": {
          "type": "string",
          "minLength": 1
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "definition": {
          "type": "string",
          "minLength": 1
        },
        "canonical_url": {
          "type": "string",
          "format": "uri"
        },
        "status": {
          "type": "string",
          "const": "active"
        },
        "effective_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}