{
  "id": 21721483,
  "title": "3 Breaking Differences Between OpenAPI 3.0 and 3.1 That Trip Up TypeScript & Zod Codegen",
  "url": "https://urgent.news/2026/11/25/3-breaking-differences-between-openapi-3-0-and-3-1-that-trip-up",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-25T02:34:50.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/dev_in_the_fog/3-breaking-differences-between-openapi-30-and-31-that-trip-up-typescript-zod-codegen-4akn"
  },
  "original_language": "en",
  "account": "Upgrading FastAPI or Springdoc to emit OpenAPI 3.1.0 often results in silent breaking changes for TypeScript and Zod generators. Fields may be typed as unknown, or runtime validation may reject valid null payloads. This occurs because OpenAPI 3.1 directly aligns with JSON Schema Draft 2020-12, leading to three schema constructs changing shape.\n\nFirst, the nullable: true option was replaced by the type arrays format in OpenAPI 3.1. Instead of { \"type\": \"string\", \"nullable\": true }, OpenAPI 3.1 uses { \"type\": [\"string\", \"null\"] } (or anyOf). Older 3.0-only generators fail to recognize this array form and omit .nullable() in generated Zod schemas.\n\nSecond, exclusiveMinimum and exclusiveMaximum have changed from boolean to numeric values in OpenAPI 3.1. In 3.0, minimum: 0 paired with exclusiveMinimum: true. In contrast, 3.1 directly incorporates the numeric bound with exclusiveMinimum: 0. Validators anticipating boolean inputs may disregard the bound or generate erroneous NaN checks.\n\nFinally, sibling keywords next to $ref have been permitted in OpenAPI 3.1. Unlike 3.0, which ignored properties adjacent to $ref, 3.1 allows description and annotations alongside $ref. This change breaks naive reference resolvers, as these properties are now part of the schema structure.\n\nFor developers seeking a zero-dependency solution, a MIT-licensed CLI tool called openapi-zod-lint has been created. Additionally, browser converters for zero-upload use are available: Open-Source CLI (openapi-zod-lint, MIT) at https://github.com/JangYS0/openapi-zod-lint, Browser OpenAPI Converter (0B upload) at https://global-utils.com/en/openapi-converter, JSON to Zod Converter at https://global-utils.com/en/json-to-zod, and JSON to TypeScript Converter at https://global-utils.com/en/json-to-ts.",
  "summary": "Upgrading FastAPI or Springdoc to emit OpenAPI 3.1.0 often breaks existing TypeScript and Zod generators silently—fields start typing as unknown , or runtime validation rejects valid null payloads. Because OpenAPI 3.1 aligned directly with JSON Schema Draft 2020-12, three schema constructs changed shape. 1. nullable: true Was Replaced by Type Arrays OpenAPI 3.0 used { \"type\": \"string\",…",
  "key_points": [
    "OpenAPI 3.1 replaces nullable: true with type arrays format",
    "ExclusiveMinimum and exclusiveMaximum become numeric values in OpenAPI 3.1",
    "$ref siblings allowed in OpenAPI 3.1, breaking naive reference resolvers"
  ],
  "editors_take": "The shift toward JSON Schema alignment forces developers to update their code generation toolchains to prevent silent type errors and broken runtime validation during API upgrades.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}