{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "recordType", "authorityRootId", "issuerId", "issuerClass", "issuerName", "responseId", "organizationId", "legalName", "jurisdiction", "registrationReference", "entityStatus", "issuedAtUtc", "observedAtUtc", "expiresAtUtc", "queryReference", "rawResponsePath", "rawResponseSha256", "responsePayloadSha256", "signedPayloadSha256", "signatureBase64"],
  "properties": {
    "schemaVersion": {"const": "1.0.0"},
    "recordType": {"const": "legal-entity-registry-response"},
    "authorityRootId": {"type": "string", "pattern": "^legal-registry-root:[0-9a-f]{64}$"},
    "issuerId": {"type": "string", "pattern": "^legal-registry-issuer:[0-9a-f]{64}$"},
    "issuerClass": {"enum": ["government-registry", "regulated-corporate-registry-provider"]},
    "issuerName": {"type": "string", "minLength": 3, "maxLength": 256},
    "responseId": {"type": "string", "pattern": "^legal-registry-response:[0-9a-f]{64}$"},
    "organizationId": {"type": "string", "pattern": "^organization:[0-9a-f]{64}$"},
    "legalName": {"type": "string", "minLength": 3, "maxLength": 256},
    "jurisdiction": {"type": "string", "minLength": 3, "maxLength": 128},
    "registrationReference": {"type": "string", "minLength": 5, "maxLength": 128},
    "entityStatus": {"const": "active"},
    "issuedAtUtc": {"type": "string", "format": "date-time"},
    "observedAtUtc": {"type": "string", "format": "date-time"},
    "expiresAtUtc": {"type": "string", "format": "date-time"},
    "queryReference": {"type": "string", "minLength": 8, "maxLength": 512},
    "rawResponsePath": {"type": "string", "minLength": 1, "maxLength": 4096},
    "rawResponseSha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "responsePayloadSha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "signedPayloadSha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "signatureBase64": {"type": "string", "pattern": "^[A-Za-z0-9+/]{86}==$"}
  }
}
