{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/passportcraft-com/json-schema/passportcraft-com-category-schema-schema.json",
  "title": "CategorySchema",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/passportcraft-com-openapi.json#/components/schemas/CategorySchema",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "const": "category_schema"
    },
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "category": {
      "type": "string"
    },
    "display_name": {
      "type": "string"
    },
    "schema_version": {
      "type": "string"
    },
    "battery_kinds": {
      "type": "object",
      "properties": {
        "rule": {
          "type": "string"
        },
        "kinds": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string"
              },
              "category": {
                "type": "string",
                "enum": [
                  "battery",
                  "battery-information"
                ]
              },
              "condition": {
                "type": "string"
              }
            },
            "required": [
              "value",
              "category",
              "condition"
            ],
            "additionalProperties": {}
          }
        }
      },
      "required": [
        "rule",
        "kinds"
      ],
      "additionalProperties": {}
    },
    "field_groups": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "field_group"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "object",
          "id",
          "label"
        ],
        "additionalProperties": {}
      }
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "field"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "number",
              "select",
              "multiselect",
              "date",
              "month",
              "url",
              "array",
              "pictogram"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "per_battery": {
            "type": "string",
            "enum": [
              "override",
              "only"
            ]
          },
          "battery_access_tier": {
            "type": "string",
            "enum": [
              "public",
              "restricted",
              "authority"
            ]
          },
          "battery_required": {
            "type": "boolean"
          },
          "required_when": {
            "type": "object",
            "properties": {
              "field": {
                "type": "string"
              },
              "one_of": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "field",
              "one_of"
            ],
            "additionalProperties": {}
          },
          "required_unless": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "one_of": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "only_when": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string"
                    },
                    "one_of": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "field",
                    "one_of"
                  ],
                  "additionalProperties": {}
                }
              },
              "required": [
                "field",
                "one_of"
              ],
              "additionalProperties": {}
            }
          },
          "required_from": {
            "type": "string"
          },
          "withheld_from_public": {
            "type": "string"
          },
          "access_tier": {
            "type": "string",
            "enum": [
              "public",
              "restricted",
              "authority"
            ]
          },
          "group": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "placeholder": {
            "type": "string"
          },
          "hint": {
            "type": "string"
          },
          "help_url": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "unit_field": {
            "type": "string"
          },
          "default_unit": {
            "type": "string"
          },
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "item_type": {
            "type": "string",
            "const": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": [
                "value",
                "label"
              ],
              "additionalProperties": {}
            }
          },
          "document_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "certification",
                "image",
                "document",
                "conformity_declaration"
              ]
            }
          },
          "document_id_key": {
            "type": "string"
          },
          "requirement": {
            "type": "string",
            "enum": [
              "required",
              "recommended",
              "optional"
            ]
          },
          "functional_basis": {
            "type": "string"
          },
          "regulatory_basis": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "regulation": {
                  "type": "string"
                },
                "reference": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "in_force",
                    "in_force_conditional",
                    "applies_later",
                    "anticipated",
                    "voluntary"
                  ]
                },
                "jurisdiction": {
                  "type": "string"
                },
                "applies_when": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                },
                "status_changing": {
                  "type": "boolean"
                }
              },
              "required": [
                "regulation",
                "reference",
                "status"
              ],
              "additionalProperties": {}
            }
          }
        },
        "required": [
          "object",
          "name",
          "type",
          "required",
          "access_tier",
          "group",
          "label",
          "description"
        ],
        "additionalProperties": {}
      }
    },
    "per_battery_fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "const": "field"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "number",
              "select",
              "multiselect",
              "date",
              "month",
              "url",
              "array",
              "pictogram"
            ]
          },
          "required": {
            "type": "boolean"
          },
          "per_battery": {
            "type": "string",
            "enum": [
              "override",
              "only"
            ]
          },
          "battery_access_tier": {
            "type": "string",
            "enum": [
              "public",
              "restricted",
              "authority"
            ]
          },
          "battery_required": {
            "type": "boolean"
          },
          "required_when": {
            "type": "object",
            "properties": {
              "field": {
                "type": "string"
              },
              "one_of": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "field",
              "one_of"
            ],
            "additionalProperties": {}
          },
          "required_unless": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string"
                },
                "one_of": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "only_when": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string"
                    },
                    "one_of": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "field",
                    "one_of"
                  ],
                  "additionalProperties": {}
                }
              },
              "required": [
                "field",
                "one_of"
              ],
              "additionalProperties": {}
            }
          },
          "required_from": {
            "type": "string"
          },
          "withheld_from_public": {
            "type": "string"
          },
          "access_tier": {
            "type": "string",
            "enum": [
              "public",
              "restricted",
              "authority"
            ]
          },
          "group": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "placeholder": {
            "type": "string"
          },
          "hint": {
            "type": "string"
          },
          "help_url": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "unit_field": {
            "type": "string"
          },
          "default_unit": {
            "type": "string"
          },
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "item_type": {
            "type": "string",
            "const": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": [
                "value",
                "label"
              ],
              "additionalProperties": {}
            }
          },
          "document_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "certification",
                "image",
                "document",
                "conformity_declaration"
              ]
            }
          },
          "document_id_key": {
            "type": "string"
          },
          "requirement": {
            "type": "string",
            "enum": [
              "required",
              "recommended",
              "optional"
            ]
          },
          "functional_basis": {
            "type": "string"
          },
          "regulatory_basis": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "regulation": {
                  "type": "string"
                },
                "reference": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "in_force",
                    "in_force_conditional",
                    "applies_later",
                    "anticipated",
                    "voluntary"
                  ]
                },
                "jurisdiction": {
                  "type": "string"
                },
                "applies_when": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                },
                "status_changing": {
                  "type": "boolean"
                }
              },
              "required": [
                "regulation",
                "reference",
                "status"
              ],
              "additionalProperties": {}
            }
          }
        },
        "required": [
          "object",
          "name",
          "type",
          "required",
          "access_tier",
          "group",
          "label",
          "description"
        ],
        "additionalProperties": {}
      }
    }
  },
  "required": [
    "object",
    "id",
    "name",
    "category",
    "display_name",
    "schema_version",
    "field_groups",
    "fields",
    "per_battery_fields"
  ],
  "additionalProperties": {}
}