add example and support with OpenAPI 3.2
Allow the CLI to preview and deploy OpenAPI documents with version 3.2
Add a related example in examples/valid repo, and dedicated tests.
Error message will change when unexpected version is deployed:
Error: Unsupported API specification (OpenAPI 4.2.0) Please try again with an OpenAPI 2.0, 3.0, 3.1, 3.2 or AsyncAPI 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 file.
Note/Question:
I don't know how to access to oas-schemas/schemas/v3.2/schema.json (do we need to upgrade to dependency?, there is currently an error), so I favored the same schema 'oas-schemas/schemas/v3.1/schema.json' for now.
oas-schemas/schemas/v3.2/schema.json (do we need to upgrade to dependency?, there is currently an error),
There's no maintained package in npm with the schemas so it's indeed « relou ».
I'd say we should download the latest schemas from the openapi spec website and put them in the CLI. So we can require them locally, here are the latest revisions for each OAS version:
- 3.2: https://spec.openapis.org/oas/3.2/schema/2025-09-17
- 3.1: https://spec.openapis.org/oas/3.1/schema/2025-09-15
- 3.0: https://spec.openapis.org/oas/3.0/schema/2024-10-18
- 2.0: https://spec.openapis.org/oas/2.0/schema/2017-08-27
Let's put them in a directory in the CLI and require them in the definition.ts file.
following https://github.com/bump-sh/cli/pull/767#issuecomment-3497527567
cc @paulRbr
I reworked the PR following your suggestion, in second commit.
Now, all OAS schemas are stored locally, in file src/core/schemas/oas-schemas/v*/schema.json
They can easily be loaded from src/definition.ts.
All tests are green, and I can successfully deploy an OpenAPI 3.2 document via the cli:
./bin/run.js preview examples/valid/openapi.v3.2.yml (node:33944) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time (Use
node --trace-warnings ...to show where the warning was created) Your preview is visible at: https://bump.sh/preview/68778303-e03e-426e-84b5-ee98b32db518 (Expires at 2025-11-20T14:51:45+01:00)
- Let's render a preview on Bump.sh... done
But there is this warning ' ExperimentalWarning: Importing JSON modules ', and I don't find out how to properly import these JSON files... do you have an idea?
I reworked the PR following your suggestion, in second commit.
Thanks! Can you remove the old dependency of oas-schemas from the package.json please?
Thanks for this 4 hands PR, I click on 'approve' for the last commits where dependency 'oas-schemas' is removed, and exported json type is clarified.
LGTM