Convertidor de OpenAPI v2 a v3
Guía
Convertidor de OpenAPI v2 a v3
Paste a Swagger 2.0 specification and get a valid OpenAPI 3.0.3 version back in either JSON or YAML. The converter applies the official structural mapping rules — moving definitions under components/schemas, collapsing host, basePathy schemes en servers, splitting consumes y produces into per-operation content maps, and reshaping form parameters and security definitions — so your spec works with modern OpenAPI tooling.
Cómo Usar
- Paste your Swagger 2.0 spec into the input box. JSON and YAML are both accepted; the format is auto-detected.
- Pick an output format: keep the input format, or force JSON or YAML.
- Deja Patch missing required fields on to auto-fill mandatory v3 fields like
info.title,info.version, and missing response descriptions when the v2 source omits them. - Read the conversion summary and any warnings shown above the output, then copy or download the resulting OpenAPI 3.0.3 spec.
Características
- JSON and YAML in, JSON or YAML out — pick the format you prefer, or mirror the input.
- Structural mapping —
definitions→components/schemas,securityDefinitions→components/securitySchemes,parameters/responsesare lifted undercomponents, and every$refpointer is rewritten to match. - Servers from host, basePath, schemes — combined into the v3
serversarray, with HTTPS preferred when multiple schemes are listed. - Content negotiation —
consumesyproducesare translated into per-operationrequestBody.contentyresponses[*].contentmaps. - Body and form parameters —
in: bodybecomes a v3requestBodyyin: formDatafields are grouped into amultipart/form-dataoapplication/x-www-form-urlencodedrequest body schema. - Security flow upgrade — OAuth2
flowvalues are remapped onto the v3flowsobject (implicit,password,clientCredentials,authorizationCode). - Patch mode — when enabled, fills in missing required fields so the output passes a v3 validator instead of failing on minor source defects.
- Conversion summary & warnings — counts of paths, schemas, and security schemes converted, plus warnings for anything that could not be mapped one-to-one.
- Funciona completamente en tu navegador — your spec never leaves the page.
Preguntas frecuentes
-
What changed structurally between Swagger 2.0 and OpenAPI 3.0?
OpenAPI 3.0 reorganized reusable pieces under a single
componentsobject:definitionsbecamecomponents/schemas,parametersbecamecomponents/parameters,responsesbecamecomponents/responsesysecurityDefinitionsbecamecomponents/securitySchemes. The transport surface also changed:host,basePathyschemeswere merged into aserversarray of full base URLs, while the implicitconsumesyproducesarrays were replaced with explicitcontentmaps keyed by media type on each request body and response. -
Why did request bodies need a new shape in OpenAPI 3.0?
In Swagger 2.0 a request body was just another parameter with
in: body, and form fields were parameters within: formData. That collapsed two different concerns (path/query/header parameters versus the request payload) into one list and made content-type negotiation awkward. OpenAPI 3.0 split them: parameters are only for path, query, header, and cookie; the payload moves to a top-levelrequestBodycon uncontentmap. This lets you describe a single endpoint that acceptsapplication/json,multipart/form-datayapplication/x-www-form-urlencodedwith different schemas for each. -
Are Swagger 2.0 and OpenAPI 3.0 wire-compatible?
No. They are description-format versions, not API protocol versions, so a converted spec does not change how your service responds at runtime — but tooling (generators, validators, mock servers, UI viewers) must understand the version you publish. OpenAPI 3.0 introduced features that have no v2 equivalent, including
oneOf/anyOf/not, callbacks, links, and richer security flows. Going forward (v3 → v2) is therefore lossy in general, while going backward (v2 → v3) is largely mechanical because v2 is a strict subset of v3's expressiveness. -
What does
$refresolution mean in this context?A
$refis a JSON Reference pointer such as#/definitions/User. Conversion has to rewrite every pointer because the target path changes:#/definitions/Userse convierte en#/components/schemas/User,#/parameters/AuthHeaderse convierte en#/components/parameters/AuthHeader, and so on. The pointers themselves are not resolved (the document still references by location), but they must be rewritten in lock-step with the structural move so the resulting v3 spec stays internally consistent.
Instalar extensiones
Agregue herramientas IO a su navegador favorito para obtener acceso instantáneo y búsquedas más rápidas
恵 ¡El marcador ha llegado!
Marcador es una forma divertida de llevar un registro de tus juegos, todos los datos se almacenan en tu navegador. ¡Próximamente habrá más funciones!
Herramientas clave
Ver todo Los recién llegados
Ver todoActualizar: Nuestro última herramienta se agregó el 18 de junio de 2026
