Swagger 2 → OpenAPI 3 (2026)
Migrate your Swagger 2.0 spec to OpenAPI 3.0.3 in one click. Handles host/basePath → servers, body params → requestBody, definitions → components.schemas, and securityDefinitions → securitySchemes.
openapi: 3.0.3
info:
title: Pet Store
version: 1.0.0
servers:
- url: https://api.example.com/v1
paths:
/pets:
get:
operationId: listPets
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Pet'
parameters: []
post:
operationId: createPet
parameters: []
responses:
'201':
description: Created
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
components:
schemas:
Pet:
type: object
required:
- id
- name
properties:
id:
type: integer
name:
type: string
What changes between Swagger 2 and OpenAPI 3
host,basePath,schemes→servers: [{ url }]parameters: [in: body]→requestBodyparameters: [in: formData]→requestBodywithmultipart/form-datadefinitions→components.schemassecurityDefinitions→components.securitySchemes$ref: #/definitions/X→$ref: #/components/schemas/Xconsumes/producesbecome explicit per-operation content types- Non-body parameters get a
schemawrapper instead oftypeat the top level
After migration
- Run the OpenAPI Validator to confirm the output is structurally valid.
- Run the OpenAPI Linter to catch new documentation-quality issues (operationIds, descriptions, error responses).
- Manually review any OAuth2 security schemes — they need flow-by-flow updates.
- Test SDK generation with your generator of choice (openapi-generator, openapi-typescript) — the v3 output is the modern target for all of them.
- Update your CI to validate against OpenAPI 3 schemas going forward.
When the converter is enough vs not
For most Swagger 2.0 specs (CRUD APIs, common auth patterns), the converter produces a working OpenAPI 3 document in one click. For specs with heavy custom extensions, complex OAuth flows, or deep nested parameter shapes, manually review the output. The converter is the 95% — the last 5% is engineering.