{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.peptideschool.org/data/peptide-calculator-test-vectors-v1.0.0.schema.json",
  "title": "PeptideSchool Calculator Test Vectors",
  "type": "object",
  "required": [
    "dataset_id",
    "version",
    "canonical_page",
    "license",
    "scope",
    "numeric_tolerance",
    "method",
    "vectors",
    "citation"
  ],
  "properties": {
    "dataset_id": { "const": "peptideschool-calculator-test-vectors" },
    "version": { "const": "1.0.0" },
    "title": { "type": "string", "minLength": 1 },
    "description": { "type": "string", "minLength": 1 },
    "canonical_page": { "const": "https://www.peptideschool.org/peptide-calculator-test-vectors" },
    "published_at": { "type": "string", "format": "date" },
    "updated_at": { "type": "string", "format": "date" },
    "language": { "const": "en-US" },
    "license": {
      "type": "object",
      "required": ["name", "spdx", "url"],
      "properties": {
        "name": { "type": "string" },
        "spdx": { "const": "CC-BY-4.0" },
        "url": { "const": "https://creativecommons.org/licenses/by/4.0/" }
      },
      "additionalProperties": false
    },
    "scope": { "type": "object" },
    "numeric_tolerance": { "type": "object" },
    "method": { "type": "object" },
    "vectors": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "required": ["vector_id", "case_type", "purpose", "input", "expected"],
        "properties": {
          "vector_id": { "type": "string", "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$" },
          "case_type": { "enum": ["valid", "invalid"] },
          "purpose": { "type": "string", "minLength": 1 },
          "input": {
            "type": "object",
            "required": [
              "vial_amount",
              "vial_unit",
              "water_ml",
              "requested_amount",
              "requested_unit",
              "measuring_capacity_ml"
            ],
            "properties": {
              "vial_amount": { "type": "number" },
              "vial_unit": { "enum": ["mg", "ui"] },
              "water_ml": { "type": "number" },
              "requested_amount": { "type": "number" },
              "requested_unit": { "enum": ["mg", "mcg", "ui"] },
              "measuring_capacity_ml": { "type": "number" }
            },
            "additionalProperties": false
          },
          "expected": {
            "type": "object",
            "required": [
              "concentration_value",
              "concentration_unit",
              "output_volume_ml",
              "u100_scale_equivalent",
              "quantities_per_container",
              "exceeds_measuring_capacity",
              "error_code",
              "error_message"
            ],
            "properties": {
              "concentration_value": { "type": "number" },
              "concentration_unit": { "type": ["string", "null"] },
              "output_volume_ml": { "type": "number" },
              "u100_scale_equivalent": { "type": "number" },
              "quantities_per_container": { "type": "number" },
              "exceeds_measuring_capacity": { "type": "boolean" },
              "error_code": { "type": ["string", "null"] },
              "error_message": { "type": ["string", "null"] }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      }
    },
    "citation": { "type": "string", "minLength": 1 }
  },
  "additionalProperties": false
}
