{"_id":"@openapi-spec/downgrader","_rev":"5-d528c9a6baac7e99812f90b341da6231","name":"@openapi-spec/downgrader","dist-tags":{"latest":"0.4.0"},"versions":{"0.0.0":{"name":"@openapi-spec/downgrader","version":"0.0.0","keywords":["converter","downgrade","oas","openapi","openapi-3.0","openapi-3.1","openapi-3.2","openapi-spec","specification","swagger","typescript"],"license":"MIT","_id":"@openapi-spec/downgrader@0.0.0","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"homepage":"https://github.com/middleapi/openapi-spec","dist":{"shasum":"0527ba0509b97fb3ddb1e74ff7978d32ba51a7f1","tarball":"https://registry.npmjs.org/@openapi-spec/downgrader/-/downgrader-0.0.0.tgz","fileCount":13,"integrity":"sha512-aMtAJFSs6lCEXrtUJ1vr/9KDU2KEJ7tHFjrvY7df4C0cpo2G5gYnb3n33csp5nb/H+BHVMmTMUBa6PFZcGG7Ew==","signatures":[{"sig":"MEQCICWXpyIjflvnJ74K/vEnddePyGiuGDsKLwHu4ZGrOLFtAiAms7SdCZmkagj6Nx1PlaPCvzOpQxq0S5TE41DkyDYDBw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60293},"type":"module","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"},"./package.json":"./package.json","./v3.1-to-v3.0":{"types":"./dist/v3.1-to-v3.0.d.mts","import":"./dist/v3.1-to-v3.0.mjs","default":"./dist/v3.1-to-v3.0.mjs"},"./v3.2-to-v3.1":{"types":"./dist/v3.2-to-v3.1.d.mts","import":"./dist/v3.2-to-v3.1.mjs","default":"./dist/v3.2-to-v3.1.mjs"}},"funding":["https://github.com/sponsors/dinwwwh","https://opencollective.com/middleapi"],"scripts":{"type:check":"tsc -b"},"_npmUser":{"name":"dinwwwh","email":"dinwwwh@gmail.com"},"repository":{"url":"git+https://github.com/middleapi/openapi-spec.git","type":"git","directory":"packages/downgrader"},"description":"Downgrade OpenAPI specifications one minor version at a time: 3.2 to 3.1 and 3.1 to 3.0, for whole documents or individual schemas","directories":{},"sideEffects":false,"dependencies":{"@openapi-spec/types":"^0.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/downgrader_0.0.0_1788771427036_0.6866865971168796","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@openapi-spec/downgrader","version":"0.1.0","keywords":["converter","downgrade","oas","openapi","openapi-3.0","openapi-3.1","openapi-3.2","openapi-spec","specification","swagger","typescript"],"license":"MIT","_id":"@openapi-spec/downgrader@0.1.0","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"homepage":"https://github.com/middleapi/openapi-spec","dist":{"shasum":"ddfef2e360be30c089bb830b8d4409fb9dabe54d","tarball":"https://registry.npmjs.org/@openapi-spec/downgrader/-/downgrader-0.1.0.tgz","fileCount":13,"integrity":"sha512-za2h8wGa4BFy2+AiKJHutt8BS2ua7Fw7vgNMmAtLyFbreozWHkXRVBRVA86sczyLY1ZN9Gw4rITygs90ehztQg==","signatures":[{"sig":"MEUCICPEkLgbgt4HzUfbKfrS38bqPW6PrP/fqNMg1rYZu6+nAiEAusBq1B1LwAF5K413INWGzalEUvtoADVXLuoxMKtI9+Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openapi-spec%2fdowngrader@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":60293},"type":"module","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"},"./package.json":"./package.json","./v3.1-to-v3.0":{"types":"./dist/v3.1-to-v3.0.d.mts","import":"./dist/v3.1-to-v3.0.mjs","default":"./dist/v3.1-to-v3.0.mjs"},"./v3.2-to-v3.1":{"types":"./dist/v3.2-to-v3.1.d.mts","import":"./dist/v3.2-to-v3.1.mjs","default":"./dist/v3.2-to-v3.1.mjs"}},"funding":["https://github.com/sponsors/dinwwwh","https://opencollective.com/middleapi"],"scripts":{"type:check":"tsc -b"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0bc2bf75-01d4-4c3a-84da-c53690c53f05"}},"repository":{"url":"git+https://github.com/middleapi/openapi-spec.git","type":"git","directory":"packages/downgrader"},"description":"Downgrade OpenAPI specifications one minor version at a time: 3.2 to 3.1 and 3.1 to 3.0, for whole documents or individual schemas","directories":{},"sideEffects":false,"dependencies":{"@openapi-spec/types":"^0.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/downgrader_0.1.0_1788772017421_0.12246351384387122","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@openapi-spec/downgrader","version":"0.2.0","keywords":["converter","downgrade","oas","openapi","openapi-3.0","openapi-3.1","openapi-3.2","openapi-spec","specification","swagger","typescript"],"license":"MIT","_id":"@openapi-spec/downgrader@0.2.0","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"homepage":"https://github.com/middleapi/openapi-spec","dist":{"shasum":"76dc3b63626e106286c5dcaf6e7731ebffbdfcc9","tarball":"https://registry.npmjs.org/@openapi-spec/downgrader/-/downgrader-0.2.0.tgz","fileCount":13,"integrity":"sha512-BhiGYsLTy0CbG9BMW1mXkx8AMjdlKjSqxseb1DTcDsO3jwV3SSww8xtMA2V6OzspLn6jybBorFBuYHcED/a2Gg==","signatures":[{"sig":"MEYCIQCU2Ne6h0D0zQJsuFlIyv7L1UPWMZGCRvOMs5SKrMvjDgIhAKYAxS26DFfzfdHBolbN4D5cC1mJWNygf7x9pATadkzp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIG9WXt+UOO2/wNp+FHuS9MyLYVo3pIqYo+U+YOcMyytRAiBkTH+EChKMk9yA0d+XgCe6tiVnc0EjoJoUtdB7bPaxow==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openapi-spec%2fdowngrader@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":70881},"type":"module","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"},"./package.json":"./package.json","./v3.1-to-v3.0":{"types":"./dist/v3.1-to-v3.0.d.mts","import":"./dist/v3.1-to-v3.0.mjs","default":"./dist/v3.1-to-v3.0.mjs"},"./v3.2-to-v3.1":{"types":"./dist/v3.2-to-v3.1.d.mts","import":"./dist/v3.2-to-v3.1.mjs","default":"./dist/v3.2-to-v3.1.mjs"}},"funding":["https://github.com/sponsors/dinwwwh","https://opencollective.com/middleapi"],"scripts":{"type:check":"tsc -b"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"0bc2bf75-01d4-4c3a-84da-c53690c53f05"}},"repository":{"url":"git+https://github.com/middleapi/openapi-spec.git","type":"git","directory":"packages/downgrader"},"description":"Downgrade OpenAPI specifications one minor version at a time: 3.2 to 3.1 and 3.1 to 3.0, for whole documents or individual schemas","directories":{},"sideEffects":false,"dependencies":{"@openapi-spec/types":"^0.2.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/downgrader_0.2.0_1790754079272_0.889812657304599","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@openapi-spec/downgrader","version":"0.3.0","keywords":["converter","downgrade","oas","openapi","openapi-3.0","openapi-3.1","openapi-3.2","openapi-spec","specification","swagger","typescript"],"license":"MIT","_id":"@openapi-spec/downgrader@0.3.0","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"homepage":"https://github.com/middleapi/openapi-spec","dist":{"shasum":"b1c68a1a327fab18e0b9c4ae9aa9eca5b4cb0ea7","tarball":"https://registry.npmjs.org/@openapi-spec/downgrader/-/downgrader-0.3.0.tgz","fileCount":13,"integrity":"sha512-y4+CkV8chSbRKmR64+uGr0IjDjNUOQIdNMpCbSiD2JCc0a0HouUTXvgt+FO8/ktfaMaNz3ypqq4PmVfB3twx3w==","signatures":[{"sig":"MEQCIHfeMRKmC0lAkooo46BZoddINezVZSfE2aIXXlgYyF5PAiBk90Vy6wVRKyWWgSjz6x+8LxwqBpOjdUq6sngM0STDVw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIFyRaTwgEWf16uy01+RBEWvALsG2GbdZc7YfisiMkfRFAiEA0rLKMaW97G1CV2/PDIGIyuyyK3PZ1i9DU535wCQJImM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openapi-spec%2fdowngrader@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":82113},"type":"module","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"},"./package.json":"./package.json","./v3.1-to-v3.0":{"types":"./dist/v3.1-to-v3.0.d.mts","import":"./dist/v3.1-to-v3.0.mjs","default":"./dist/v3.1-to-v3.0.mjs"},"./v3.2-to-v3.1":{"types":"./dist/v3.2-to-v3.1.d.mts","import":"./dist/v3.2-to-v3.1.mjs","default":"./dist/v3.2-to-v3.1.mjs"}},"funding":["https://github.com/sponsors/dinwwwh","https://opencollective.com/middleapi"],"scripts":{"type:check":"tsc -b"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"0bc2bf75-01d4-4c3a-84da-c53690c53f05"}},"repository":{"url":"git+https://github.com/middleapi/openapi-spec.git","type":"git","directory":"packages/downgrader"},"description":"Downgrade OpenAPI specifications one minor version at a time: 3.2 to 3.1 and 3.1 to 3.0, for whole documents or individual schemas","directories":{},"sideEffects":false,"dependencies":{"@openapi-spec/types":"^0.3.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/downgrader_0.3.0_1791011148895_0.5666524398248154","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"_id":"@openapi-spec/downgrader@0.4.0","dist":{"shasum":"6eabada09f1ee5683ed1280788d77e91340424f9","tarball":"https://registry.npmjs.org/@openapi-spec/downgrader/-/downgrader-0.4.0.tgz","fileCount":10,"integrity":"sha512-hrOjK64HADGGG56RvmJ8z+CenNqTEAI0Ped1aG1oeY9CNDMZRhILatygmtcCtudVUNfbJU1CmnuzpeXujQH/rg==","signatures":[{"sig":"MEUCIQC4hYdADI6qXzf5wVnSL7yk3sHIea3eJdZJp8HtFoNM2wIgZnjDn8fg4KauAeIf/wqxyiQ5ZcjelhBRLFyMSr2NzCI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDI0t1MzDjak3oeinouDy+2vNb2RGSnsWwKjV72lHle3AiEA+WgV66khEF/GikASy2hFEL7clsO5zSEJ3imO2UMyitU="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@openapi-spec%2fdowngrader@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":161045},"name":"@openapi-spec/downgrader","type":"module","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","default":"./dist/index.mjs"},"./package.json":"./package.json","./v3.1-to-v3.0":{"types":"./dist/v3.1-to-v3.0.d.mts","import":"./dist/v3.1-to-v3.0.mjs","default":"./dist/v3.1-to-v3.0.mjs"},"./v3.2-to-v3.1":{"types":"./dist/v3.2-to-v3.1.d.mts","import":"./dist/v3.2-to-v3.1.mjs","default":"./dist/v3.2-to-v3.1.mjs"}},"funding":["https://github.com/sponsors/dinwwwh","https://opencollective.com/middleapi"],"license":"MIT","scripts":{},"unbuild":{"declaration":"node16"},"version":"0.4.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"0bc2bf75-01d4-4c3a-84da-c53690c53f05"}},"homepage":"https://github.com/middleapi/openapi-spec","keywords":["converter","downgrade","oas","openapi","openapi-3.0","openapi-3.1","openapi-3.2","openapi-spec","specification","swagger","typescript"],"repository":{"url":"git+https://github.com/middleapi/openapi-spec.git","type":"git","directory":"packages/downgrader"},"description":"Downgrade OpenAPI specifications one minor version at a time: 3.2 to 3.1 and 3.1 to 3.0, for whole documents or individual schemas","directories":{},"maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"sideEffects":false,"dependencies":{"@openapi-spec/types":"^0.4.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/downgrader_0.4.0_1793103551024_0.5196299095616363"}}},"time":{"created":"2026-09-07T08:57:06.755Z","modified":"2026-10-27T12:19:11.747Z","0.0.0":"2026-09-07T08:57:07.168Z","0.1.0":"2026-09-07T09:06:57.546Z","0.2.0":"2026-09-30T07:41:19.353Z","0.3.0":"2026-10-03T07:05:48.985Z","0.4.0":"2026-10-27T12:19:11.120Z"},"license":"MIT","homepage":"https://github.com/middleapi/openapi-spec","keywords":["converter","downgrade","oas","openapi","openapi-3.0","openapi-3.1","openapi-3.2","openapi-spec","specification","swagger","typescript"],"repository":{"url":"git+https://github.com/middleapi/openapi-spec.git","type":"git","directory":"packages/downgrader"},"description":"Downgrade OpenAPI specifications one minor version at a time: 3.2 to 3.1 and 3.1 to 3.0, for whole documents or individual schemas","maintainers":[{"name":"dinwwwh","email":"dinwwwh@gmail.com"}],"readme":"<h1 align=\"center\">OpenAPI Spec</h1>\n\n<div align=\"center\">\n  <a href=\"https://codecov.io/gh/middleapi/openapi-spec\">\n    <img alt=\"codecov\" src=\"https://codecov.io/gh/middleapi/openapi-spec/branch/main/graph/badge.svg\">\n  </a>\n  <a href=\"https://www.npmjs.com/package/@openapi-spec/downgrader\">\n    <img alt=\"weekly downloads\" src=\"https://img.shields.io/npm/dw/%40openapi-spec%2Fdowngrader?logo=npm\" />\n  </a>\n  <a href=\"https://app.codspeed.io/middleapi/openapi-spec?utm_source=badge\">\n    <img src=\"https://img.shields.io/endpoint?url=https://codspeed.io/badge.json\" alt=\"CodSpeed\" />\n  </a>\n  <a href=\"https://github.com/middleapi/openapi-spec/blob/main/LICENSE\">\n    <img alt=\"MIT License\" src=\"https://img.shields.io/github/license/middleapi/openapi-spec?logo=open-source-initiative\" />\n  </a>\n  <a href=\"https://discord.gg/TXEbwRBvQn\">\n    <img alt=\"Discord\" src=\"https://img.shields.io/discord/1308966753044398161?color=7389D8&label&logo=discord&logoColor=ffffff\" />\n  </a>\n  <a href=\"https://deepwiki.com/middleapi/openapi-spec\">\n    <img alt=\"Ask DeepWiki\" src=\"https://img.shields.io/badge/Ask-DeepWiki-blue\" />\n  </a>\n</div>\n\n`@openapi-spec/downgrader` downgrades [OpenAPI Specification](https://spec.openapis.org/) documents and Schema Objects one minor version at a time, 3.2 to 3.1 and 3.1 to 3.0, for tools that only support an older version, such as code generators, gateways, and validators. It is how [oRPC](https://orpc.dev) generates 3.1 and 3.0 documents.\n\nDowngrading loses detail, never meaning. Each step below lists what it converts and its limitations.\n\n## Usage\n\n```ts\nimport {\n  downgradeSchemaV31ToV30,\n  downgradeSchemaV32ToV31,\n  downgradeSpecV31ToV30,\n  downgradeSpecV32ToV31,\n} from '@openapi-spec/downgrader'\n\nconst v31 = downgradeSpecV32ToV31(v32Document)\nconst v30 = downgradeSpecV31ToV30(v31Document)\n\n// There is no direct 3.2 to 3.0 converter on purpose. Compose the steps:\nconst downgraded = downgradeSpecV31ToV30(downgradeSpecV32ToV31(v32Document))\n\n// Schema Objects convert on their own:\ndowngradeSchemaV31ToV30({ type: ['string', 'null'] })\n// { type: 'string', nullable: true }\n```\n\n| Function                  | Input               | Output                                  |\n| ------------------------- | ------------------- | --------------------------------------- |\n| `downgradeSpecV32ToV31`   | 3.2 `OpenAPIObject` | 3.1 `OpenAPIObject`                     |\n| `downgradeSchemaV32ToV31` | 3.2 `SchemaObject`  | 3.1 `SchemaObject`                      |\n| `downgradeSpecV31ToV30`   | 3.1 `OpenAPIObject` | 3.0 `OpenAPIObject`                     |\n| `downgradeSchemaV31ToV30` | 3.1 `SchemaObject`  | 3.0 `SchemaObject` or `ReferenceObject` |\n\nEach step can also be imported on its own from `@openapi-spec/downgrader/v3.2-to-v3.1` or `@openapi-spec/downgrader/v3.1-to-v3.0`. All types come from [`@openapi-spec/types`](https://github.com/middleapi/openapi-spec/blob/main/packages/types/README.md).\n\nThe output `openapi` is the latest patch release, `3.1.2` from `downgradeSpecV32ToV31` and `3.0.4` from `downgradeSpecV31ToV30`. Set it afterwards for another patch release, as oRPC does.\n\nThe input is never changed, and the output shares no plain objects or arrays with it. Input is read as JSON would see it: an object counts whatever realm it comes from or null prototype it has, as in a document oRPC returns, and a key holding `undefined`, as spreading options often leaves, counts as missing. Other values, such as a `Date`, are kept as they are.\n\nExternal `$ref`s are left as written, except in a 3.2 `content` map, where 3.1 allows none and the entry is removed. The files they point at are not converted, so bundle a multi-file document into one first.\n\n## 3.2 → 3.1\n\n### Spec (`downgradeSpecV32ToV31`)\n\nSchema Objects inside the document convert as in [Schema](#schema-downgradeschemav32tov31).\n\n| 3.2                                                                                                                                                                                                             | In 3.1                                                                                                  |\n| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |\n| [`$self`][3.2-self]                                                                                                                                                                                             | Removed. 3.1 resolves against the retrieval URL.                                                        |\n| [`jsonSchemaDialect`][3.2-json-schema-dialect] naming the 3.2 dialect                                                                                                                                           | The 3.1 dialect.                                                                                        |\n| [`components.mediaTypes`][3.2-components-media-types]                                                                                                                                                           | Removed. `$ref`s to them in `content` are replaced by their targets.                                    |\n| Server [`name`][3.2-server-name]                                                                                                                                                                                | Removed.                                                                                                |\n| Tag [`summary`][3.2-tag-summary], [`parent`][3.2-tag-parent], and [`kind`][3.2-tag-kind]                                                                                                                        | Removed. A summary becomes the `description` when that is missing.                                      |\n| Path Item [`query`][3.2-path-item-query] and [`additionalOperations`][3.2-path-item-additional-operations]                                                                                                      | Removed. 3.1 has only the eight fixed methods.                                                          |\n| [`in: \"querystring\"`][3.2-parameter-locations] parameters                                                                                                                                                       | Removed, with the `$ref`s to them.                                                                      |\n| [`allowReserved`][3.2-parameter-allow-reserved] outside `in: \"query\"`                                                                                                                                           | Removed. 3.1 applies it only to query parameters.                                                       |\n| [`style: \"cookie\"`][3.2-style-values]                                                                                                                                                                           | Removed, leaving the `form` default.                                                                    |\n| Parameter [`example`][3.2-parameter-example] and [`examples`][3.2-parameter-examples] beside `content`                                                                                                          | Removed. 3.1 allows them only beside `schema`. The media types keep their own examples.                 |\n| Parameter `style`, `explode`, and `allowReserved` beside `content`, which neither version allows                                                                                                                | Removed.                                                                                                |\n| Media Type [`description`][3.2-schema]                                                                                                                                                                          | Removed.                                                                                                |\n| Media Type [`itemSchema`][3.2-media-type-item-schema]                                                                                                                                                           | Alone, `schema: { type: \"array\", items: … }`. Beside `schema`, which describes the whole body, removed. |\n| Media Type [`prefixEncoding`][3.2-media-type-prefix-encoding] and [`itemEncoding`][3.2-media-type-item-encoding], and Encoding Object [`encoding`][3.2-encoding-encoding], `prefixEncoding`, and `itemEncoding` | Removed. 3.1 matches multipart parts only by property name, and does not nest encodings.                |\n| Response [`summary`][3.2-response-summary]                                                                                                                                                                      | Removed. It becomes the `description` that 3.1 requires when that is missing.                           |\n| Example [`dataValue`][3.2-example-data-value] and [`serializedValue`][3.2-example-serialized-value]                                                                                                             | Removed. Without `value` or `externalValue`, `dataValue`, or else `serializedValue`, fills `value`.     |\n| OAuth [`deviceAuthorization`][3.2-oauth-flows-device-authorization] flow                                                                                                                                        | Removed.                                                                                                |\n| Security Scheme [`oauth2MetadataUrl`][3.2-security-scheme-oauth2-metadata-url] and [`deprecated`][3.2-security-scheme-deprecated]                                                                               | Removed.                                                                                                |\n\n[3.2-self]: https://spec.openapis.org/oas/v3.2.1.html#oas-self\n[3.2-json-schema-dialect]: https://spec.openapis.org/oas/v3.2.1.html#oas-json-schema-dialect\n[3.2-components-media-types]: https://spec.openapis.org/oas/v3.2.1.html#components-media-types\n[3.2-server-name]: https://spec.openapis.org/oas/v3.2.1.html#server-name\n[3.2-tag-summary]: https://spec.openapis.org/oas/v3.2.1.html#tag-summary\n[3.2-tag-parent]: https://spec.openapis.org/oas/v3.2.1.html#tag-parent\n[3.2-tag-kind]: https://spec.openapis.org/oas/v3.2.1.html#tag-kind\n[3.2-path-item-query]: https://spec.openapis.org/oas/v3.2.1.html#path-item-query\n[3.2-path-item-additional-operations]: https://spec.openapis.org/oas/v3.2.1.html#path-item-additional-operations\n[3.2-parameter-locations]: https://spec.openapis.org/oas/v3.2.1.html#parameter-locations\n[3.2-parameter-allow-reserved]: https://spec.openapis.org/oas/v3.2.1.html#parameter-allow-reserved\n[3.2-style-values]: https://spec.openapis.org/oas/v3.2.1.html#style-values\n[3.2-parameter-example]: https://spec.openapis.org/oas/v3.2.1.html#parameter-example\n[3.2-parameter-examples]: https://spec.openapis.org/oas/v3.2.1.html#parameter-examples\n[3.2-schema]: https://spec.openapis.org/oas/3.2/schema/2025-09-17\n[3.2-media-type-item-schema]: https://spec.openapis.org/oas/v3.2.1.html#media-type-item-schema\n[3.2-media-type-prefix-encoding]: https://spec.openapis.org/oas/v3.2.1.html#media-type-prefix-encoding\n[3.2-media-type-item-encoding]: https://spec.openapis.org/oas/v3.2.1.html#media-type-item-encoding\n[3.2-encoding-encoding]: https://spec.openapis.org/oas/v3.2.1.html#encoding-encoding\n[3.2-response-summary]: https://spec.openapis.org/oas/v3.2.1.html#response-summary\n[3.2-example-data-value]: https://spec.openapis.org/oas/v3.2.1.html#example-data-value\n[3.2-example-serialized-value]: https://spec.openapis.org/oas/v3.2.1.html#example-serialized-value\n[3.2-oauth-flows-device-authorization]: https://spec.openapis.org/oas/v3.2.1.html#oauth-flows-device-authorization\n[3.2-security-scheme-oauth2-metadata-url]: https://spec.openapis.org/oas/v3.2.1.html#security-scheme-oauth2-metadata-url\n[3.2-security-scheme-deprecated]: https://spec.openapis.org/oas/v3.2.1.html#security-scheme-deprecated\n\n#### Limitations\n\n- Other `$ref`s into a removed part, such as a schema `$ref` into `components.mediaTypes`, and Links or discriminator `mapping` values that point at a removed operation, are left as written and dangle.\n- A `content` `$ref` that does not resolve is removed, which can leave a parameter or header without the one entry it needs.\n- Security requirements that name a scheme by URI, and `$self`-relative references, pass through unchanged.\n\n### Schema (`downgradeSchemaV32ToV31`)\n\nBoth versions build on JSON Schema 2020-12, so everything not listed here passes through.\n\n| 3.2                                                                 | In 3.1                                                                                                                  |\n| ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |\n| XML [`nodeType`][3.2-xml-node-type]                                 | `\"attribute\"` becomes `attribute: true`, and `\"element\"` on an array becomes `wrapped: true`. Other values are removed. |\n| Discriminator [`defaultMapping`][3.2-discriminator-default-mapping] | Removed.                                                                                                                |\n\n[3.2-xml-node-type]: https://spec.openapis.org/oas/v3.2.1.html#xml-node-type\n[3.2-discriminator-default-mapping]: https://spec.openapis.org/oas/v3.2.1.html#discriminator-default-mapping\n\n#### Limitations\n\n- A `$schema` naming the 3.2 dialect passes through unchanged.\n- Older drafts are not supported. Subschemas under keywords that only draft-07 or 2019-09 define, such as `definitions`, pass through unconverted.\n\n## 3.1 → 3.0\n\n### Spec (`downgradeSpecV31ToV30`)\n\nSchema Objects inside the document convert as in [Schema](#schema-downgradeschemav31tov30).\n\n| 3.1                                                                                                | In 3.0                                                                                                                                                                        |\n| -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [`jsonSchemaDialect`][3.1-json-schema-dialect]                                                     | Removed. 3.0 has one fixed schema dialect.                                                                                                                                    |\n| [`webhooks`][3.1-webhooks]                                                                         | Removed. `$ref`s into them are replaced by their targets.                                                                                                                     |\n| [`components.pathItems`][3.1-components-path-items]                                                | Removed. A Path Item `$ref` to one is merged: the target's fields fill in those the referencing Path Item lacks. Other `$ref`s into them are replaced by their targets.       |\n| A missing [`paths`][3.1-paths] or Operation [`responses`][3.1-operation-responses]                 | Added, as `{}` and as a `default` response, since 3.0 requires them.                                                                                                          |\n| Info [`summary`][3.1-info-summary] and License [`identifier`][3.1-license-identifier]              | Removed. An Info summary becomes the `description` when that is missing.                                                                                                      |\n| Reference Object [`summary`][3.1-reference-summary] and [`description`][3.1-reference-description] | Removed. A 3.0 Reference Object holds only `$ref`.                                                                                                                            |\n| [`mutualTLS`][3.1-security-scheme-type] security schemes                                           | Removed, with the `$ref`s to them and their names in security requirements. A requirement or `security` list left empty is removed too, since an empty one means no security. |\n| [Security requirement][3.1-security-requirement] scopes on `apiKey` and `http` schemes             | `[]`. 3.0 allows scopes only for OAuth2 and OpenID Connect.                                                                                                                   |\n\n[3.1-json-schema-dialect]: https://spec.openapis.org/oas/v3.1.2.html#oas-json-schema-dialect\n[3.1-webhooks]: https://spec.openapis.org/oas/v3.1.2.html#oas-webhooks\n[3.1-components-path-items]: https://spec.openapis.org/oas/v3.1.2.html#components-path-items\n[3.1-paths]: https://spec.openapis.org/oas/v3.1.2.html#oas-paths\n[3.1-operation-responses]: https://spec.openapis.org/oas/v3.1.2.html#operation-responses\n[3.1-info-summary]: https://spec.openapis.org/oas/v3.1.2.html#info-summary\n[3.1-license-identifier]: https://spec.openapis.org/oas/v3.1.2.html#license-identifier\n[3.1-reference-summary]: https://spec.openapis.org/oas/v3.1.2.html#reference-summary\n[3.1-reference-description]: https://spec.openapis.org/oas/v3.1.2.html#reference-description\n[3.1-security-scheme-type]: https://spec.openapis.org/oas/v3.1.2.html#security-scheme-type\n[3.1-security-requirement]: https://spec.openapis.org/oas/v3.1.2.html#security-requirement-object\n\n#### Limitations\n\n- A target replacing several `$ref`s stands in at each of them as the same object, so a Path Item referenced twice repeats its `operationId`s, and a YAML dump writes an alias. Where a target refers back to one it is being copied into, that inner reference becomes `{}`, or is removed where `{}` is not a valid value.\n- `$ref`s into removed parts are recognized by their `#/webhooks/` or `#/components/pathItems/` prefix as written, not percent-encoded.\n- Links and discriminator `mapping` values that point into a removed part, and Links that name a webhook operation by `operationId`, are left as written.\n- Encoding Objects pass through, although 3.0 serializes `multipart` parts by other defaults: it ignores `style`, `explode`, and `allowReserved` there, and gives an untyped part no `application/octet-stream` default.\n- A `security` list whose alternatives all use only mutual TLS is removed. On an operation it then falls back to the document's `security`, and on the document it leaves none, so no security is required.\n\n### Schema (`downgradeSchemaV31ToV30`)\n\nAccepts the default OAS dialect, which adds `discriminator`, `xml`, `externalDocs`, and `example` to JSON Schema 2020-12. Every schema is read as 2020-12, whatever `$schema` or `jsonSchemaDialect` names.\n\n| 3.1                                                                                                                                                                                                                                                                                | In 3.0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [`type`][js-type] with `\"null\"`                                                                                                                                                                                                                                                    | `nullable: true` beside the other type. `type: \"null\"` alone becomes `type: \"string\", nullable: true, enum: [null]`, since 3.0 allows `nullable` only beside `type`, and code generators drop a bare `enum: [null]`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |\n| [`type`][js-type] with several types                                                                                                                                                                                                                                               | `anyOf` with one branch per type, which takes `items` for `\"array\"`. `\"null\"` gets its own branch, written as for `type: \"null\"` alone, since code generators ignore `nullable` inside an `anyOf` branch.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n| An [`anyOf`][js-any-of] of `{ type: \"null\" }` and one other branch, as Zod writes a nullable object, array, integer, enum, unknown, or `$ref`, Zod and Valibot a nullable nullish one with such a pair as the other branch, and Effect a nullish one with `{ type: \"null\" }` twice | That branch with `nullable: true` in place of the `anyOf` when it has a single `type`, since code generators read the pair as a union. A branch with a `$ref`, an `enum`, `allOf`, `anyOf`, `oneOf`, or `not` stays, since `nullable` would not let null through those, and so does one that holds a `type` where the schema around it holds one, or another keyword that schema holds with another value, or holds `properties` or `additionalProperties` where that schema holds the other, since `additionalProperties` reads the `properties` beside it. The pair becomes a `oneOf` when that branch has a `type` and no `nullable`, or is a `$ref` to such a schema, alone or with siblings such as the `description` Zod writes beside a described reference, since null then matches one branch only, and NSwag reads that as nullable but the `anyOf` as an empty class. A `$ref` to a schema whose `type` already holds `\"null\"`, as GitHub writes, takes the place of the `anyOf` when nothing else sits beside it, as 3.0 writes a nullable reference. A branch that accepts every value, such as `{}`, which Zod writes for a nullable unknown and Pydantic for `Optional[Any]`, removes the `anyOf`, since the pair then accepts every value too, and code generators read it as a union with a string or as a type they never define. Its annotations, such as the `description` Zod writes there for a described unknown, take its place, unless the schema around it has one of them with another value. A null branch whose other keywords repeat the schema around it, as ArkType writes the description of a described nullable value into every branch, counts as `{ type: \"null\" }`. |\n| A [`oneOf`][js-one-of] of `{ type: \"null\" }` and one other branch, as typia and Litestar write a nullable value                                                                                                                                                                    | That branch with `nullable: true` in place of the `oneOf`, under the same conditions as the `anyOf` pair above but only with a single null branch and a branch without `nullable`, since null then matches one branch only. Otherwise the `oneOf` stays.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| An [`anyOf`][js-any-of] of scalar types, or of them and `\"array\"`, as ArkType, Valibot and Pydantic write a union of them and Effect a number, and a [`type`][js-type] list of them, as Zod writes it and ASP.NET Core a number that may come as a string                          | A `oneOf` in place of the `anyOf` when each branch has a scalar or `\"array\"` `type` of its own and is not `nullable`, they do not name both `\"integer\"` and `\"number\"`, and no `enum` or `oneOf` sits beside them, since no value then matches two branches, with null in it once where Effect writes it twice for a nullish number. Such a `oneOf` with nothing beside it but annotations, as a nullable union of them becomes, joins the branches around it, and its annotations, such as the `description` Zod writes there for a described union, move to the schema around it, unless that schema or another such branch has one of them with another value. NSwag reads that `oneOf` as the first branch, and the OpenAPI Generator TypeScript client as a union, but the `anyOf` as an empty class. A schema a `$ref` points to keeps the `anyOf`, since NSwag gives a property a type it never defines when an `allOf` holds a `$ref` to a `oneOf`, as a `$ref` with siblings becomes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |\n| [`const`][js-const]                                                                                                                                                                                                                                                                | `enum` with its one value, and the `type` of that value when it has none, since code generators drop or leave untyped a bare `enum`. `const: null` becomes the same schema as `type: \"null\"`. A union whose branches all become enums of one `type`, as OpenSearch writes a documented enum, gets that `type` beside it too, since NSwag otherwise reads it as an empty class or as a type it never defines. When those enums hold nothing else, as Zod, Valibot, TypeBox and GitHub write a union of literals, or only keywords the schema around them holds with the same value, as ArkType writes a described one, they become one `enum`, beside any null branch, since code generators read the union as a string or as a union of one-value types. Beside branches of other types, as Zod, ArkType and Valibot write a union of string literals and `number`, and utoipa the unit variants of a Rust enum, the enums of each type become one, and a union of scalars then becomes a `oneOf`. A `oneOf` whose branches share a value stays.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |\n| An [`enum`][js-enum] with no `type`, as ArkType writes a union of literals                                                                                                                                                                                                         | The `type` its values share, when they share one, since code generators drop or leave untyped a bare `enum`, or read its integers as numbers.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| Numeric [`exclusiveMinimum`][js-exclusive-minimum] and [`exclusiveMaximum`][js-exclusive-maximum]                                                                                                                                                                                  | `minimum` or `maximum` with a boolean `exclusiveMinimum` or `exclusiveMaximum`, unless `minimum` or `maximum` is stricter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\n| [`examples`][js-examples]                                                                                                                                                                                                                                                          | The first entry fills `example` when that is missing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |\n| [`prefixItems`][js-prefix-items]                                                                                                                                                                                                                                                   | `items` matching any of the tuple's item schemas, and those of the items after them unless `items: false` or `maxItems` allows none, or `{}` when one of them accepts every value. That `anyOf` merges like the ones above, as for the key and value of a Zod `Map` entry. `items: false` becomes `maxItems`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |\n| [`contentEncoding`][js-content-encoding] and [`contentMediaType`][js-content-media-type]                                                                                                                                                                                           | `format: \"byte\"` for `base64`, and `format: \"binary\"` for `binary` or a media type without an encoding or a `contentSchema`, which marks structured text. It replaces a `format` that only repeats the encoding, such as Zod's `format: \"base64\"`. Without a `type`, the schema gains `type: \"string\"`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| An [`anyOf`][js-any-of] with a branch that holds only `contentMediaType`, as Zod writes for a file with several media types                                                                                                                                                        | Removed, since that branch matches every value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\n| A [`$ref`][js-ref] with siblings                                                                                                                                                                                                                                                   | `allOf: [{ $ref }]` beside the siblings, which 3.0 would ignore.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |\n| [`$defs`][js-defs], and `definitions`, its draft-07 name                                                                                                                                                                                                                           | Removed. Each `$ref` into it is replaced by its converted target, where a reference back into a target being inlined becomes `{}`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |\n| A [`discriminator`][3.0-schema-discriminator] over `$ref`s into `$defs`, as Pydantic and msgspec write a tagged union                                                                                                                                                              | Removed. A discriminator picks only among named components, not the targets that replace those `$ref`s, and its `mapping` into them would dangle, which validators that follow it, such as openapi-schema-validator, reject.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |\n| Boolean subschemas                                                                                                                                                                                                                                                                 | `{}` for `true` and `{ not: {} }` for `false`, except in `additionalProperties`, which allows booleans.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| [`patternProperties`][js-pattern-properties]                                                                                                                                                                                                                                       | Removed. `additionalProperties` becomes `true`, as a schema or `false` there would reject the properties `patternProperties` allowed, and code generators read a missing one as closed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| [`$schema`][js-schema], [`$vocabulary`][js-vocabulary], [`$id`][js-id], [`$anchor`][js-anchor], [`$dynamicRef`, `$dynamicAnchor`][js-dynamic], [`$comment`][js-comment], and [`contentSchema`][js-content-schema]                                                                  | Removed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| [`if`][js-if], [`then`][js-then], [`else`][js-else], [`dependentSchemas`][js-dependent-schemas], and [`dependentRequired`][js-dependent-required]                                                                                                                                  | Removed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| [`contains`][js-contains], [`minContains`][js-min-contains], [`maxContains`][js-max-contains], and [`propertyNames`][js-property-names]                                                                                                                                            | Removed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| [`propertyNames`][js-property-names] holding only an `enum` or `const`, or a `$ref` to one, as Zod and Valibot write record keys, with no `properties`, `patternProperties`, or `unevaluatedProperties` beside it                                                                  | A property for each name, sharing the `additionalProperties` schema, and `additionalProperties: false`. A `$ref` into that schema is replaced by its target. A `title` or `description` beside the names is dropped.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |\n| [`unevaluatedProperties`][js-unevaluated-properties]                                                                                                                                                                                                                               | `additionalProperties`, when nothing beside it but `properties` evaluates properties. Otherwise removed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| ","readmeFilename":""}