{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ultimaps-com/json-schema/ultimaps-com-dry-run-response-schema.json",
  "title": "DryRunResponse",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ultimaps-com-openapi.json#/components/schemas/DryRunResponse",
  "type": "object",
  "required": [
    "dryRun",
    "mapId",
    "regionMatching"
  ],
  "properties": {
    "dryRun": {
      "type": "boolean",
      "const": true
    },
    "mapId": {
      "type": "string"
    },
    "choropleth": {
      "type": [
        "object",
        "null"
      ],
      "description": "The resolved visualization plan. Present in choropleth mode, null otherwise. Under `type: auto` this is what the detection picked. `classes` is the effective count, since tied data collapses duplicate edges even for explicit requests.\n",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "gradient",
            "steps",
            "groups"
          ]
        },
        "method": {
          "type": "string",
          "enum": [
            "quantile",
            "equalInterval",
            "jenks",
            "pretty"
          ]
        },
        "classes": {
          "type": "integer"
        },
        "palette": {
          "type": "string"
        },
        "midpoint": {
          "type": "number",
          "description": "The value the neutral color sits on, present when the palette is centered: the requested `midpoint`, or 0 for diverging data around zero. A diverging palette on one-sided data without a `midpoint` has none.\n"
        },
        "reason": {
          "type": "string",
          "description": "Why this type was picked, e.g. \"Highly skewed data - steps show distribution better\"."
        },
        "breaks": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "The class edges actually drawn (`classes + 1` values, fewer if tied data collapsed edges).\n"
        },
        "format": {
          "$ref": "#/$defs/FormatSpec",
          "description": "The RESOLVED number format: the FormatSpec after preset expansion, auto inference and the `kind`/`unit` hints. It is what every label, tick and value label prints with.\n"
        },
        "regionsWithoutData": {
          "type": "integer",
          "description": "Regions of the map with no value, drawn in the no-data fill. Above 0, send `choropleth.noData: true` so the legend explains them.\n"
        }
      }
    },
    "legend": {
      "type": [
        "array",
        "object",
        "null"
      ],
      "description": "Exactly the legend the render would draw. Its shape follows the resolved type. groups/steps choropleths and categories return an array of `{label, color}` (steps labels are the class boundaries, groups labels are ranges). A gradient returns `{points: [min, mid|null, max], stops: [hex…]}`, the continuous scale's domain and preview colors. With `choropleth.noData` the No data row is the last item (a gradient adds it as `noData: {label, color}`). Null for regions-only requests.\n"
    },
    "warnings": {
      "type": "array",
      "description": "Non-fatal request adjustments (same objects as the `X-Ultimaps-Warnings` header on image responses).\n",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "$ref": "#/$defs/WarningCode"
          },
          "message": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "description": "`labels_overlap` only: region labels still overlapping."
          },
          "shortened": {
            "type": "integer",
            "description": "`labels_overlap` only: labels shortened."
          },
          "keys": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`labels_overlap` only: first overlapping region keys (up to 10), in map order."
          }
        }
      }
    },
    "regionMatching": {
      "$ref": "#/$defs/RegionMatching"
    }
  },
  "$defs": {
    "FormatSpec": {
      "type": "object",
      "additionalProperties": false,
      "description": "Structured number format (Intl-backed; en-US unless `locale` is set). Field exclusivity: `preset` and `d3` are each mutually exclusive with every other field except `locale`, `decimals` and `significantDigits` are mutually exclusive, and `currency` requires `style: \"currency\"`. Examples: `{\"decimals\": 0, \"suffix\": \" km²\"}` gives \"1,234 km²\", `{\"compact\": true, \"decimals\": 1, \"trim\": true}` gives \"39.5M\", `{\"style\": \"percent\", \"decimals\": 1}` turns 0.423 into \"42.3%\".\n",
      "properties": {
        "preset": {
          "type": "string",
          "enum": [
            "auto",
            "plain",
            "compact",
            "percent",
            "currency"
          ],
          "description": "Alias for the bare-string preset form."
        },
        "style": {
          "type": "string",
          "enum": [
            "decimal",
            "percent",
            "currency"
          ],
          "default": "decimal",
          "description": "\"percent\" MULTIPLIES BY 100. The input is a fraction (0.42 prints as \"42%\"). Data already in percent points should use `suffix: \"%\"` instead.\n"
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Za-z]{3}$",
          "default": "USD",
          "description": "ISO-4217 code, rendered with its Intl symbol (\"€\", \"CA$\"). Only valid with style \"currency\".\n"
        },
        "compact": {
          "type": "boolean",
          "description": "Compact notation: K/M/B/T (never SI \"G\")."
        },
        "decimals": {
          "type": "integer",
          "minimum": 0,
          "maximum": 6,
          "description": "Fraction digits. Min equals max, for uniform labels, unless `trim` is set."
        },
        "significantDigits": {
          "type": "integer",
          "minimum": 1,
          "maximum": 6
        },
        "trim": {
          "type": "boolean",
          "description": "Strip trailing zeros."
        },
        "grouping": {
          "type": "boolean",
          "default": true,
          "description": "Thousands separators."
        },
        "sign": {
          "type": "string",
          "enum": [
            "auto",
            "always",
            "exceptZero"
          ],
          "default": "auto",
          "description": "Maps 1:1 to Intl signDisplay. \"exceptZero\" is the usual choice for diverging legends.\n"
        },
        "prefix": {
          "type": "string",
          "maxLength": 12,
          "description": "Literal, inserted AFTER any leading sign (\"-€1,234\", never \"€-1,234\").\n"
        },
        "suffix": {
          "type": "string",
          "maxLength": 20,
          "description": "Literal, e.g. \" per km²\"."
        },
        "d3": {
          "type": "string",
          "maxLength": 20,
          "description": "Escape hatch: a raw d3-format spec. Invalid grammar is a 400.\n"
        },
        "locale": {
          "type": "string",
          "enum": [
            "en-US",
            "de-DE",
            "fr-FR",
            "es-ES",
            "it-IT",
            "pt-BR",
            "de-CH",
            "en-IN",
            "nl-NL",
            "pl-PL",
            "sv-SE"
          ],
          "default": "en-US",
          "description": "Number style: separators, currency placement and compact suffixes. `{\"decimals\": 1, \"locale\": \"de-DE\"}` turns 1234567.5 into \"1.234.567,5\"; with `compact: true` it gives \"1,2 Mio.\". Combines with `preset` and `d3`; on its own (`{\"locale\": \"de-DE\"}`) it is the automatic format in that number style.\n"
        }
      }
    },
    "RegionMatching": {
      "type": "object",
      "required": [
        "matchedKeys",
        "corrected",
        "unmatched"
      ],
      "properties": {
        "matchedKeys": {
          "type": "integer",
          "description": "Input keys that resolved, summed across the request's choropleth/categories/regions blocks and the style.labels.hide list. A region referenced by two keys counts twice (the later value wins). This counts keys, not distinct regions.\n"
        },
        "corrected": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "input": {
                "type": "string"
              },
              "matchedTo": {
                "type": "string",
                "description": "The published `key` of the region the input was corrected to."
              },
              "title": {
                "type": "string"
              },
              "via": {
                "type": "string"
              }
            }
          }
        },
        "unmatched": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "input": {
                "type": "string"
              },
              "suggestions": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Closest regions as `\"Title (key)\"`, or just the title on maps whose key is the title.\n"
              }
            }
          }
        }
      }
    },
    "WarningCode": {
      "type": "string",
      "description": "Non-fatal request adjustment. Additive-only: codes may be appended, never renamed or removed.",
      "enum": [
        "legend_position_coerced",
        "percent_values_look_scaled",
        "legend_overflow",
        "layer_unavailable",
        "labels_unavailable",
        "midpoint_ignored",
        "nodata_low_contrast",
        "legend_heading_dropped",
        "labels_overlap",
        "label_lists_ignored"
      ]
    }
  }
}