Migrating from OpenAPI 3.0 to 3.1
JSON Schema 2020-12 alignment, nullable arrays, and top-level webhooks under ADP-040.
Breaking syntax shifts in 3.1
Update these fields when changing the top-level version to 3.1.0.
| Feature | OpenAPI 3.0.x | OpenAPI 3.1.0 | Rule |
|---|---|---|---|
| Nullable types | nullable: true | type: ["string", "null"] | ADP-038 |
| Exclusive minimum | exclusiveMinimum: true + minimum | exclusiveMinimum: 0 | ADP-034 |
| Constants | Single-item enum | const: "v1" | ADP-032 |
| Async webhook events | Ad-hoc callbacks or markdown docs | Top-level webhooks: map | ADP-040 |
| Ownership metadata | info.contact, info.license | Adds info.summary + SPDX identifier | ADP-033 |
Top-level webhook declaration
openapi: 3.1.0
webhooks:
orderPaid:
post:
operationId: onOrderPaid
summary: Emitted when order settlement finishesValidate 3.0 and 3.1 side by side
api_validator.py validates both OpenAPI 3.0.x and 3.1.0 specs in JSON or YAML via the Browser Validator.