{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://www.decide.fyi/api/v1/cryptography/response.schema.json",
  "type": "object",
  "properties": {
    "schema_version": {
      "const": "1.0.0"
    },
    "dataset_version": {
      "type": "string"
    },
    "generated_at": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
    },
    "content_sha256": {
      "$ref": "#/definitions/digest"
    },
    "resource": {
      "type": "string",
      "pattern": "^(index|sources|scopes|coverage|changes|(?:algorithms|variants|constructions|programs|standards|authorities|protocols|claims|advisories)(?:/[a-z][a-z0-9-]*)?)$"
    },
    "data": {},
    "notice": {
      "type": "string"
    },
    "references": {
      "type": "object",
      "properties": {
        "sources": {
          "type": "array",
          "items": {
            "$ref": "dataset.schema.json#/definitions/source"
          }
        },
        "scopes": {
          "type": "array",
          "items": {
            "$ref": "dataset.schema.json#/definitions/scope"
          }
        },
        "authorities": {
          "type": "array",
          "items": {
            "$ref": "dataset.schema.json#/definitions/authority"
          }
        }
      },
      "required": [
        "sources",
        "scopes",
        "authorities"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "schema_version",
    "dataset_version",
    "generated_at",
    "content_sha256",
    "resource",
    "data",
    "notice"
  ],
  "additionalProperties": false,
  "definitions": {
    "digest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "counts": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer",
          "minimum": 0
        },
        "states": {
          "type": "object",
          "properties": {
            "verified": {
              "type": "integer",
              "minimum": 0
            },
            "partial": {
              "type": "integer",
              "minimum": 0
            },
            "unresolved": {
              "type": "integer",
              "minimum": 0
            },
            "blocked": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "verified",
            "partial",
            "unresolved",
            "blocked"
          ],
          "additionalProperties": false
        },
        "active_claims": {
          "type": "integer",
          "minimum": 0
        },
        "advisories": {
          "type": "integer",
          "minimum": 0
        },
        "sources": {
          "type": "integer",
          "minimum": 0
        },
        "independent_expert_reviews": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "total",
        "states",
        "active_claims",
        "advisories",
        "sources",
        "independent_expert_reviews"
      ],
      "additionalProperties": false
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^(algorithms|variants|protocols|constructions|programs)$"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "dataset.schema.json#/definitions/subject"
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^(algorithms|variants|protocols|constructions|programs)/"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "subject": {
                "$ref": "dataset.schema.json#/definitions/subject"
              },
              "variants": {
                "type": "array",
                "items": {
                  "$ref": "dataset.schema.json#/definitions/subject"
                }
              },
              "related_subjects": {
                "type": "array",
                "items": {
                  "$ref": "dataset.schema.json#/definitions/subject"
                }
              },
              "claims": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "revision",
                    "previous_revision",
                    "subject_id",
                    "authority_id",
                    "scope_id",
                    "use",
                    "kind",
                    "status",
                    "normative_force",
                    "summary",
                    "effective",
                    "conditions",
                    "evidence",
                    "confidence",
                    "publication_state",
                    "last_verified_at",
                    "review_method",
                    "review_interval_days",
                    "freshness"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "previous_revision": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subject_id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "authority_id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "scope_id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "use": {
                      "enum": [
                        "sign",
                        "verify",
                        "key_establishment",
                        "encrypt",
                        "decrypt",
                        "hashing",
                        "planning",
                        "procurement",
                        "digital_signatures",
                        "issue_certificate",
                        "protocol_support",
                        "legacy"
                      ]
                    },
                    "kind": {
                      "enum": [
                        "lifecycle_status",
                        "migration_milestone",
                        "parameter_requirement",
                        "implementation_support",
                        "standardization",
                        "replacement_guidance",
                        "theoretical_exposure"
                      ]
                    },
                    "status": {
                      "enum": [
                        "deprecated",
                        "disallowed",
                        "approved",
                        "recommended",
                        "legacy_only",
                        "specified",
                        "in_development",
                        "selected",
                        "required",
                        "default",
                        "phase_out_planned",
                        "unspecified",
                        "draft"
                      ]
                    },
                    "normative_force": {
                      "enum": [
                        "binding_law",
                        "binding_contract_or_scheme",
                        "mandatory_for_defined_scope",
                        "normative_standard",
                        "guidance",
                        "recommendation",
                        "proposal",
                        "informational",
                        "unknown"
                      ]
                    },
                    "summary": {
                      "type": "string",
                      "minLength": 1
                    },
                    "effective": {
                      "$ref": "dataset.schema.json#/definitions/effective"
                    },
                    "conditions": {
                      "$ref": "dataset.schema.json#/definitions/conditions"
                    },
                    "evidence": {
                      "type": "array",
                      "items": {
                        "$ref": "dataset.schema.json#/definitions/evidence"
                      },
                      "minItems": 1,
                      "uniqueItems": true
                    },
                    "confidence": {
                      "enum": [
                        "confirmed",
                        "disputed",
                        "unverified"
                      ]
                    },
                    "publication_state": {
                      "enum": [
                        "draft",
                        "published",
                        "withdrawn",
                        "archived"
                      ]
                    },
                    "last_verified_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "review_method": {
                      "anyOf": [
                        {
                          "enum": [
                            "automated_source_readback",
                            "maintainer_review",
                            "independent_technical_review"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "review_interval_days": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 90
                    },
                    "requirement": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "field",
                        "value",
                        "unit"
                      ],
                      "properties": {
                        "field": {
                          "type": "string",
                          "minLength": 1
                        },
                        "value": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "unit": {
                          "type": "string",
                          "minLength": 1
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "as_of": {
                          "type": "string",
                          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                        },
                        "state": {
                          "enum": [
                            "fresh",
                            "stale",
                            "unverified"
                          ]
                        },
                        "review_due": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "as_of",
                        "state",
                        "review_due"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              },
              "coverage_state": {
                "enum": [
                  "has_scoped_claims",
                  "not_established"
                ]
              }
            },
            "required": [
              "subject",
              "variants",
              "related_subjects",
              "claims",
              "coverage_state"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^sources$|^standards$"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "dataset.schema.json#/definitions/source"
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^scopes$"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "dataset.schema.json#/definitions/scope"
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^authorities$"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "jurisdiction": {
                  "type": "string",
                  "minLength": 1
                },
                "type": {
                  "enum": [
                    "standards_body",
                    "government_agency",
                    "executive",
                    "government_body",
                    "research_body",
                    "registry",
                    "implementer"
                  ]
                },
                "url": {
                  "type": "string",
                  "pattern": "^https://"
                },
                "scope_ids": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "id",
                "name",
                "jurisdiction",
                "type",
                "url",
                "scope_ids"
              ],
              "additionalProperties": false
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^standards/"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "standard": {
                "$ref": "dataset.schema.json#/definitions/source"
              },
              "editions": {
                "type": "array",
                "items": {
                  "$ref": "dataset.schema.json#/definitions/source"
                }
              },
              "claims": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "revision",
                    "previous_revision",
                    "subject_id",
                    "authority_id",
                    "scope_id",
                    "use",
                    "kind",
                    "status",
                    "normative_force",
                    "summary",
                    "effective",
                    "conditions",
                    "evidence",
                    "confidence",
                    "publication_state",
                    "last_verified_at",
                    "review_method",
                    "review_interval_days",
                    "freshness"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "previous_revision": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subject_id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "authority_id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "scope_id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "use": {
                      "enum": [
                        "sign",
                        "verify",
                        "key_establishment",
                        "encrypt",
                        "decrypt",
                        "hashing",
                        "planning",
                        "procurement",
                        "digital_signatures",
                        "issue_certificate",
                        "protocol_support",
                        "legacy"
                      ]
                    },
                    "kind": {
                      "enum": [
                        "lifecycle_status",
                        "migration_milestone",
                        "parameter_requirement",
                        "implementation_support",
                        "standardization",
                        "replacement_guidance",
                        "theoretical_exposure"
                      ]
                    },
                    "status": {
                      "enum": [
                        "deprecated",
                        "disallowed",
                        "approved",
                        "recommended",
                        "legacy_only",
                        "specified",
                        "in_development",
                        "selected",
                        "required",
                        "default",
                        "phase_out_planned",
                        "unspecified",
                        "draft"
                      ]
                    },
                    "normative_force": {
                      "enum": [
                        "binding_law",
                        "binding_contract_or_scheme",
                        "mandatory_for_defined_scope",
                        "normative_standard",
                        "guidance",
                        "recommendation",
                        "proposal",
                        "informational",
                        "unknown"
                      ]
                    },
                    "summary": {
                      "type": "string",
                      "minLength": 1
                    },
                    "effective": {
                      "$ref": "dataset.schema.json#/definitions/effective"
                    },
                    "conditions": {
                      "$ref": "dataset.schema.json#/definitions/conditions"
                    },
                    "evidence": {
                      "type": "array",
                      "items": {
                        "$ref": "dataset.schema.json#/definitions/evidence"
                      },
                      "minItems": 1,
                      "uniqueItems": true
                    },
                    "confidence": {
                      "enum": [
                        "confirmed",
                        "disputed",
                        "unverified"
                      ]
                    },
                    "publication_state": {
                      "enum": [
                        "draft",
                        "published",
                        "withdrawn",
                        "archived"
                      ]
                    },
                    "last_verified_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "review_method": {
                      "anyOf": [
                        {
                          "enum": [
                            "automated_source_readback",
                            "maintainer_review",
                            "independent_technical_review"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "review_interval_days": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 90
                    },
                    "requirement": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "field",
                        "value",
                        "unit"
                      ],
                      "properties": {
                        "field": {
                          "type": "string",
                          "minLength": 1
                        },
                        "value": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "unit": {
                          "type": "string",
                          "minLength": 1
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "as_of": {
                          "type": "string",
                          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                        },
                        "state": {
                          "enum": [
                            "fresh",
                            "stale",
                            "unverified"
                          ]
                        },
                        "review_due": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "as_of",
                        "state",
                        "review_due"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            },
            "required": [
              "standard",
              "editions",
              "claims"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^authorities/"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "authority": {
                "$ref": "dataset.schema.json#/definitions/authority"
              },
              "claims": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "revision",
                    "previous_revision",
                    "subject_id",
                    "authority_id",
                    "scope_id",
                    "use",
                    "kind",
                    "status",
                    "normative_force",
                    "summary",
                    "effective",
                    "conditions",
                    "evidence",
                    "confidence",
                    "publication_state",
                    "last_verified_at",
                    "review_method",
                    "review_interval_days",
                    "freshness"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "previous_revision": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subject_id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "authority_id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "scope_id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "use": {
                      "enum": [
                        "sign",
                        "verify",
                        "key_establishment",
                        "encrypt",
                        "decrypt",
                        "hashing",
                        "planning",
                        "procurement",
                        "digital_signatures",
                        "issue_certificate",
                        "protocol_support",
                        "legacy"
                      ]
                    },
                    "kind": {
                      "enum": [
                        "lifecycle_status",
                        "migration_milestone",
                        "parameter_requirement",
                        "implementation_support",
                        "standardization",
                        "replacement_guidance",
                        "theoretical_exposure"
                      ]
                    },
                    "status": {
                      "enum": [
                        "deprecated",
                        "disallowed",
                        "approved",
                        "recommended",
                        "legacy_only",
                        "specified",
                        "in_development",
                        "selected",
                        "required",
                        "default",
                        "phase_out_planned",
                        "unspecified",
                        "draft"
                      ]
                    },
                    "normative_force": {
                      "enum": [
                        "binding_law",
                        "binding_contract_or_scheme",
                        "mandatory_for_defined_scope",
                        "normative_standard",
                        "guidance",
                        "recommendation",
                        "proposal",
                        "informational",
                        "unknown"
                      ]
                    },
                    "summary": {
                      "type": "string",
                      "minLength": 1
                    },
                    "effective": {
                      "$ref": "dataset.schema.json#/definitions/effective"
                    },
                    "conditions": {
                      "$ref": "dataset.schema.json#/definitions/conditions"
                    },
                    "evidence": {
                      "type": "array",
                      "items": {
                        "$ref": "dataset.schema.json#/definitions/evidence"
                      },
                      "minItems": 1,
                      "uniqueItems": true
                    },
                    "confidence": {
                      "enum": [
                        "confirmed",
                        "disputed",
                        "unverified"
                      ]
                    },
                    "publication_state": {
                      "enum": [
                        "draft",
                        "published",
                        "withdrawn",
                        "archived"
                      ]
                    },
                    "last_verified_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "review_method": {
                      "anyOf": [
                        {
                          "enum": [
                            "automated_source_readback",
                            "maintainer_review",
                            "independent_technical_review"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "review_interval_days": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 90
                    },
                    "requirement": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "field",
                        "value",
                        "unit"
                      ],
                      "properties": {
                        "field": {
                          "type": "string",
                          "minLength": 1
                        },
                        "value": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "unit": {
                          "type": "string",
                          "minLength": 1
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "as_of": {
                          "type": "string",
                          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                        },
                        "state": {
                          "enum": [
                            "fresh",
                            "stale",
                            "unverified"
                          ]
                        },
                        "review_due": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "as_of",
                        "state",
                        "review_due"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            },
            "required": [
              "authority",
              "claims"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^claims$"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "revision",
                "previous_revision",
                "subject_id",
                "authority_id",
                "scope_id",
                "use",
                "kind",
                "status",
                "normative_force",
                "summary",
                "effective",
                "conditions",
                "evidence",
                "confidence",
                "publication_state",
                "last_verified_at",
                "review_method",
                "review_interval_days",
                "freshness"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                },
                "revision": {
                  "type": "integer",
                  "minimum": 1
                },
                "previous_revision": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "subject_id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                },
                "authority_id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                },
                "scope_id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                },
                "use": {
                  "enum": [
                    "sign",
                    "verify",
                    "key_establishment",
                    "encrypt",
                    "decrypt",
                    "hashing",
                    "planning",
                    "procurement",
                    "digital_signatures",
                    "issue_certificate",
                    "protocol_support",
                    "legacy"
                  ]
                },
                "kind": {
                  "enum": [
                    "lifecycle_status",
                    "migration_milestone",
                    "parameter_requirement",
                    "implementation_support",
                    "standardization",
                    "replacement_guidance",
                    "theoretical_exposure"
                  ]
                },
                "status": {
                  "enum": [
                    "deprecated",
                    "disallowed",
                    "approved",
                    "recommended",
                    "legacy_only",
                    "specified",
                    "in_development",
                    "selected",
                    "required",
                    "default",
                    "phase_out_planned",
                    "unspecified",
                    "draft"
                  ]
                },
                "normative_force": {
                  "enum": [
                    "binding_law",
                    "binding_contract_or_scheme",
                    "mandatory_for_defined_scope",
                    "normative_standard",
                    "guidance",
                    "recommendation",
                    "proposal",
                    "informational",
                    "unknown"
                  ]
                },
                "summary": {
                  "type": "string",
                  "minLength": 1
                },
                "effective": {
                  "$ref": "dataset.schema.json#/definitions/effective"
                },
                "conditions": {
                  "$ref": "dataset.schema.json#/definitions/conditions"
                },
                "evidence": {
                  "type": "array",
                  "items": {
                    "$ref": "dataset.schema.json#/definitions/evidence"
                  },
                  "minItems": 1,
                  "uniqueItems": true
                },
                "confidence": {
                  "enum": [
                    "confirmed",
                    "disputed",
                    "unverified"
                  ]
                },
                "publication_state": {
                  "enum": [
                    "draft",
                    "published",
                    "withdrawn",
                    "archived"
                  ]
                },
                "last_verified_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "review_method": {
                  "anyOf": [
                    {
                      "enum": [
                        "automated_source_readback",
                        "maintainer_review",
                        "independent_technical_review"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "review_interval_days": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 90
                },
                "requirement": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "field",
                    "value",
                    "unit"
                  ],
                  "properties": {
                    "field": {
                      "type": "string",
                      "minLength": 1
                    },
                    "value": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "unit": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "freshness": {
                  "type": "object",
                  "properties": {
                    "as_of": {
                      "type": "string",
                      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                    },
                    "state": {
                      "enum": [
                        "fresh",
                        "stale",
                        "unverified"
                      ]
                    },
                    "review_due": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "as_of",
                    "state",
                    "review_due"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^claims/"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "active_revision": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "revisions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "revision",
                    "previous_revision",
                    "subject_id",
                    "authority_id",
                    "scope_id",
                    "use",
                    "kind",
                    "status",
                    "normative_force",
                    "summary",
                    "effective",
                    "conditions",
                    "evidence",
                    "confidence",
                    "publication_state",
                    "last_verified_at",
                    "review_method",
                    "review_interval_days",
                    "freshness"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "revision": {
                      "type": "integer",
                      "minimum": 1
                    },
                    "previous_revision": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 1
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subject_id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "authority_id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "scope_id": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "use": {
                      "enum": [
                        "sign",
                        "verify",
                        "key_establishment",
                        "encrypt",
                        "decrypt",
                        "hashing",
                        "planning",
                        "procurement",
                        "digital_signatures",
                        "issue_certificate",
                        "protocol_support",
                        "legacy"
                      ]
                    },
                    "kind": {
                      "enum": [
                        "lifecycle_status",
                        "migration_milestone",
                        "parameter_requirement",
                        "implementation_support",
                        "standardization",
                        "replacement_guidance",
                        "theoretical_exposure"
                      ]
                    },
                    "status": {
                      "enum": [
                        "deprecated",
                        "disallowed",
                        "approved",
                        "recommended",
                        "legacy_only",
                        "specified",
                        "in_development",
                        "selected",
                        "required",
                        "default",
                        "phase_out_planned",
                        "unspecified",
                        "draft"
                      ]
                    },
                    "normative_force": {
                      "enum": [
                        "binding_law",
                        "binding_contract_or_scheme",
                        "mandatory_for_defined_scope",
                        "normative_standard",
                        "guidance",
                        "recommendation",
                        "proposal",
                        "informational",
                        "unknown"
                      ]
                    },
                    "summary": {
                      "type": "string",
                      "minLength": 1
                    },
                    "effective": {
                      "$ref": "dataset.schema.json#/definitions/effective"
                    },
                    "conditions": {
                      "$ref": "dataset.schema.json#/definitions/conditions"
                    },
                    "evidence": {
                      "type": "array",
                      "items": {
                        "$ref": "dataset.schema.json#/definitions/evidence"
                      },
                      "minItems": 1,
                      "uniqueItems": true
                    },
                    "confidence": {
                      "enum": [
                        "confirmed",
                        "disputed",
                        "unverified"
                      ]
                    },
                    "publication_state": {
                      "enum": [
                        "draft",
                        "published",
                        "withdrawn",
                        "archived"
                      ]
                    },
                    "last_verified_at": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "review_method": {
                      "anyOf": [
                        {
                          "enum": [
                            "automated_source_readback",
                            "maintainer_review",
                            "independent_technical_review"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "review_interval_days": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 90
                    },
                    "requirement": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "field",
                        "value",
                        "unit"
                      ],
                      "properties": {
                        "field": {
                          "type": "string",
                          "minLength": 1
                        },
                        "value": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "unit": {
                          "type": "string",
                          "minLength": 1
                        }
                      }
                    },
                    "freshness": {
                      "type": "object",
                      "properties": {
                        "as_of": {
                          "type": "string",
                          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                        },
                        "state": {
                          "enum": [
                            "fresh",
                            "stale",
                            "unverified"
                          ]
                        },
                        "review_due": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "as_of",
                        "state",
                        "review_due"
                      ],
                      "additionalProperties": false
                    }
                  }
                }
              }
            },
            "required": [
              "active_revision",
              "revisions"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^advisories$"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "title",
                "issuers",
                "issued",
                "scope",
                "summary",
                "affected_algorithms",
                "actions",
                "evidence",
                "last_verified_at",
                "review_interval_days",
                "review_method",
                "confidence",
                "publication_state",
                "freshness"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                },
                "title": {
                  "type": "string",
                  "minLength": 1
                },
                "issuers": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                  },
                  "minItems": 1,
                  "uniqueItems": true
                },
                "issued": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "scope": {
                  "type": "string",
                  "minLength": 1
                },
                "summary": {
                  "type": "string",
                  "minLength": 1
                },
                "affected_algorithms": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "status",
                    "ids"
                  ],
                  "properties": {
                    "status": {
                      "enum": [
                        "specified",
                        "unspecified"
                      ]
                    },
                    "ids": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                      },
                      "minItems": 0,
                      "uniqueItems": true
                    }
                  }
                },
                "actions": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  },
                  "minItems": 0,
                  "uniqueItems": true
                },
                "evidence": {
                  "type": "array",
                  "items": {
                    "$ref": "dataset.schema.json#/definitions/evidence"
                  },
                  "minItems": 1,
                  "uniqueItems": true
                },
                "last_verified_at": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "review_interval_days": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 90
                },
                "review_method": {
                  "anyOf": [
                    {
                      "enum": [
                        "automated_source_readback",
                        "maintainer_review",
                        "independent_technical_review"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "confidence": {
                  "enum": [
                    "confirmed",
                    "disputed",
                    "unverified"
                  ]
                },
                "publication_state": {
                  "enum": [
                    "draft",
                    "published",
                    "withdrawn",
                    "archived"
                  ]
                },
                "freshness": {
                  "type": "object",
                  "properties": {
                    "as_of": {
                      "type": "string",
                      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                    },
                    "state": {
                      "enum": [
                        "fresh",
                        "stale",
                        "unverified"
                      ]
                    },
                    "review_due": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "as_of",
                    "state",
                    "review_due"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^advisories/"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "title",
              "issuers",
              "issued",
              "scope",
              "summary",
              "affected_algorithms",
              "actions",
              "evidence",
              "last_verified_at",
              "review_interval_days",
              "review_method",
              "confidence",
              "publication_state",
              "freshness"
            ],
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
              },
              "title": {
                "type": "string",
                "minLength": 1
              },
              "issuers": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                },
                "minItems": 1,
                "uniqueItems": true
              },
              "issued": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "scope": {
                "type": "string",
                "minLength": 1
              },
              "summary": {
                "type": "string",
                "minLength": 1
              },
              "affected_algorithms": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "status",
                  "ids"
                ],
                "properties": {
                  "status": {
                    "enum": [
                      "specified",
                      "unspecified"
                    ]
                  },
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
                    },
                    "minItems": 0,
                    "uniqueItems": true
                  }
                }
              },
              "actions": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                },
                "minItems": 0,
                "uniqueItems": true
              },
              "evidence": {
                "type": "array",
                "items": {
                  "$ref": "dataset.schema.json#/definitions/evidence"
                },
                "minItems": 1,
                "uniqueItems": true
              },
              "last_verified_at": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "review_interval_days": {
                "type": "integer",
                "minimum": 1,
                "maximum": 90
              },
              "review_method": {
                "anyOf": [
                  {
                    "enum": [
                      "automated_source_readback",
                      "maintainer_review",
                      "independent_technical_review"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "confidence": {
                "enum": [
                  "confirmed",
                  "disputed",
                  "unverified"
                ]
              },
              "publication_state": {
                "enum": [
                  "draft",
                  "published",
                  "withdrawn",
                  "archived"
                ]
              },
              "freshness": {
                "type": "object",
                "properties": {
                  "as_of": {
                    "type": "string",
                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                  },
                  "state": {
                    "enum": [
                      "fresh",
                      "stale",
                      "unverified"
                    ]
                  },
                  "review_due": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "as_of",
                  "state",
                  "review_due"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^changes$"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "dataset.schema.json#/definitions/change"
            }
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^coverage$"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "summary": {
                "$ref": "#/definitions/counts"
              },
              "rows": {
                "type": "array",
                "items": {
                  "$ref": "dataset.schema.json#/definitions/research"
                }
              }
            },
            "required": [
              "summary",
              "rows"
            ],
            "additionalProperties": false
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "resource": {
            "pattern": "^index$"
          }
        }
      },
      "then": {
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "resources": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "schema": {
                "type": "string"
              },
              "envelope_schema": {
                "type": "string"
              },
              "snapshots": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "dataset_version": {
                      "type": "string"
                    },
                    "sha256": {
                      "$ref": "#/definitions/digest"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "dataset_version",
                    "sha256",
                    "url"
                  ],
                  "additionalProperties": false
                }
              },
              "counts": {
                "$ref": "#/definitions/counts"
              },
              "freshness_policy": {
                "type": "string"
              }
            },
            "required": [
              "resources",
              "schema",
              "envelope_schema",
              "snapshots",
              "counts",
              "freshness_policy"
            ],
            "additionalProperties": false
          }
        }
      }
    }
  ]
}
