Skip to content
HALOWERK

Codewerk

swagger2 to openapi3

Converts Swagger 2.0 to OpenAPI 3.0.0 with swagger2openapi 7.0.8 (servers from schemes/host/basePath, body/formData parameters to requestBody, definitions to components, securityDefinitions to securitySchemes). For target 3.1 it applies the upgrade steps of the OpenAPI Initiative migration guide and lists each change with its JSON pointer. Input and output are validated against the official OpenAPI JSON Schemas. External $refs are rejected, nothing is fetched.

POST https://code.halowerk.com/v1/swagger2-to-openapi3

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
specSee schemaYesThe API description as a JSON object or as a JSON/YAML string (max. 2 MB). External $ref values are rejected.
targetstringNoTarget version: 3.1 (3.1.0) or 3.0 (3.0.0 as produced by swagger2openapi).
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "spec"
  ],
  "properties": {
    "spec": {
      "description": "The API description as a JSON object or as a JSON/YAML string (max. 2 MB). External $ref values are rejected.",
      "anyOf": [
        {
          "type": "object"
        },
        {
          "type": "string",
          "minLength": 2,
          "maxLength": 2000000
        }
      ]
    },
    "target": {
      "type": "string",
      "enum": [
        "3.1",
        "3.0"
      ],
      "default": "3.1",
      "description": "Target version: 3.1 (3.1.0) or 3.0 (3.0.0 as produced by swagger2openapi)."
    }
  }
}

Open original schema

Published input example

{
  "target": "3.1",
  "spec": {
    "swagger": "2.0",
    "info": {
      "title": "Pets",
      "version": "1.0"
    },
    "host": "halowerk.com",
    "basePath": "/v1",
    "schemes": [
      "https"
    ],
    "paths": {
      "/pets": {
        "get": {
          "produces": [
            "application/json"
          ],
          "responses": {
            "200": {
              "description": "ok",
              "schema": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’