OpenAPI v2 to v3 Converter
Convert a Swagger 2.0 (OpenAPI v2) spec into OpenAPI 3.x — host/basePath/schemes become servers, definitions become components.schemas with every $ref rewritten, body/formData parameters become requestBody, and produces/consumes become per-response/per-request content maps. Accepts and emits YAML or JSON, and runs entirely in your browser.
Input
Options
Output
Summary
| Metric | Value |
|---|---|
| No data yet | |
Issues
| Severity | Path | Message |
|---|---|---|
| No data yet | ||
Guides
The OpenAPI v2 to v3 Converter turns a Swagger 2.0 spec into OpenAPI 3.0.3 — the format most modern tooling (Swagger UI, Redoc, code generators, API gateways) now expects. Paste your spec as YAML or JSON and get back a converted document, a summary of what changed, and a list of anything that needed attention.
What it converts
host+basePath+schemes→servers[].host: api.example.com,basePath: /v1,schemes: [https]becomesservers: [{ url: "https://api.example.com/v1" }], one entry per scheme.definitions→components.schemas. Every schema keyword is carried over, including Swagger-only ones:x-nullablebecomesnullable, and atype: fileschema becomes{ type: string, format: binary }.- Every
$refis rewritten, anywhere in the document — not just at the top level.#/definitions/Petbecomes#/components/schemas/Pet, and the same applies to#/parameters/and#/responses/refs, however deeply nested inside array items,allOf, or response schemas. - Body and form parameters →
requestBody. A parameter within: bodybecomesrequestBody.content[mime].schema, keyed by the operation'sconsumeslist.formDataparameters are collapsed into a single object schema, usingmultipart/form-dataautomatically when atype: filefield is present. produces/consumes→ per-response and per-requestcontentmaps, one entry per declared MIME type.securityDefinitions→components.securitySchemes.basicbecomes{ type: http, scheme: basic };apiKeycarries over as-is;oauth2maps Swagger's four flow names (implicit,password,application,accessCode) onto OpenAPI 3'sflowsobject (application→clientCredentials,accessCode→authorizationCode).collectionFormat→style/explodeon array parameters (csv→ form style,multi→ exploded form,ssv/pipes→ space/pipe-delimited).
Patch mode
Turn on Patch missing required fields to have the tool fill gaps that OpenAPI 3 requires but Swagger 2.0 didn't always enforce — a missing info.title, info.version, or response description gets a placeholder value, logged as an informational note. Turn it off to see the same gaps reported as errors instead, with the conversion still completed best-effort.
What's intentionally left alone
An unrecognized securityDefinitions type is copied through unchanged rather than guessed at. A body or form parameter inside Swagger's top-level reusable parameters map is skipped with a warning, since OpenAPI 3 doesn't allow a body to be a reusable parameter — it needs to move into each operation's requestBody by hand. Schema-level discriminator and xml keywords pass through as-is, since their exact shape is highly spec-specific.
Output format
Choose Same as Input, YAML, or JSON for the output — the tool detects whether you pasted YAML or JSON automatically, so you can convert between the two at the same time as converting the spec version.
Is my spec uploaded anywhere?
No — parsing and conversion run entirely in your browser. Nothing is sent to a server.