{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gunspec-io/json-schema/gunspec-io-adoption-map-schema.json",
  "title": "AdoptionMap",
  "description": "Military and law-enforcement adoption of a firearm, grouped by country.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gunspec-io-firearm-analysis-api-openapi.yml#/components/schemas/AdoptionMap",
  "type": "object",
  "properties": {
    "firearmId": {
      "type": "string",
      "description": "Slug of the firearm this row belongs to."
    },
    "firearmName": {
      "type": "string",
      "description": "Display name of the firearm the map is for."
    },
    "countries": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 3166-1 alpha-2 code of the country. Null where the operator country is unrecorded."
          },
          "users": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Display name, as the maker writes it."
                },
                "type": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Kind of operator: one of `military`, `law_enforcement`, `civilian`, `paramilitary`, `special_forces`, `private_security`, `training`."
                },
                "year": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "Year that operator adopted it. Null where the date is unrecorded."
                },
                "designation": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Military or standards designation for the load, e.g. `M882`."
                }
              }
            },
            "description": "The organisations in that country recorded as operating the firearm."
          }
        }
      },
      "description": "Every country recorded as having adopted it."
    }
  },
  "required": [
    "firearmId",
    "firearmName",
    "countries"
  ]
}