{
  "slug": "swagger2-to-openapi3",
  "name": "gizza-ai/swagger2-to-openapi3",
  "version": "0.1.0",
  "title": "Swagger 2.0 to OpenAPI 3.0 Converter — gizza.ai",
  "description": "Convert Swagger 2.0 specs to OpenAPI 3.0 in your browser — JSON or YAML in, JSON or YAML out, with servers, components, requestBody, and $refs rewritten.",
  "tags": [
    "swagger 2.0 to openapi 3.0",
    "swagger to openapi converter",
    "openapi 2 to 3",
    "convert swagger to openapi",
    "swagger2openapi",
    "openapi upgrade",
    "api spec converter",
    "yaml to json openapi"
  ],
  "category": "utilities",
  "urls": {
    "page": "https://gizza.ai/tools/swagger2-to-openapi3/",
    "markdown": "https://gizza.ai/tools/swagger2-to-openapi3/index.md",
    "descriptor": "https://gizza.ai/tools/swagger2-to-openapi3/tool.json",
    "deep_link_example": "https://gizza.ai/tools/swagger2-to-openapi3/?spec=swagger%3A%20%222.0%22%0Ainfo%3A%0A%20%20title%3A%20Pet%20Store%0A%20%20version%3A%201.0.0%0Apaths%3A%20%7B%7D&input_format=auto&output_format=json&target_version=3.0.3&indent=2&patch=true"
  },
  "cli": "gizza tool swagger2-to-openapi3 'swagger: \"2.0\"\ninfo:\n  title: Pet Store\n  version: 1.0.0\npaths: {}'",
  "tool": {
    "description": "Upgrade a Swagger 2.0 (OpenAPI 2.0) API specification into an equivalent OpenAPI 3.0 document. Accepts JSON or YAML (input_format='auto' by default) and emits JSON (output_format='json') or YAML. Transforms swagger->openapi version, host/basePath/schemes into a servers array, definitions into components.schemas, in:body/in:formData parameters into a requestBody (with consumes/produces folded into content media types), non-body parameters into schema-wrapped 3.0 parameters, securityDefinitions into components.securitySchemes (basic->http, oauth2 flow renames), response schemas into content, and retargets every $ref. Choose target_version (default 3.0.3) and JSON indent; patch=true (default) fills the fields 3.0 requires that 2.0 may omit.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "indent": {
          "default": 2,
          "description": "Number of spaces to indent JSON output, 0-10. Use 0 for minified single-line JSON. Ignored for YAML output. Default 2.",
          "maximum": 10,
          "minimum": 0,
          "type": "integer"
        },
        "input_format": {
          "default": "auto",
          "description": "How to parse the input. 'auto' (default) tries JSON then YAML; force 'json' or 'yaml' to control error messages.",
          "enum": [
            "auto",
            "json",
            "yaml"
          ],
          "type": "string"
        },
        "output_format": {
          "default": "json",
          "description": "Format of the converted OpenAPI 3.0 document: 'json' (default) or 'yaml'.",
          "enum": [
            "json",
            "yaml"
          ],
          "type": "string"
        },
        "patch": {
          "default": true,
          "description": "When true (default), fill in the fields OpenAPI 3.0 requires but Swagger 2.0 may omit (a missing info.title/info.version, missing response descriptions) so the result validates. When false, only structural changes are made.",
          "type": "boolean"
        },
        "spec": {
          "description": "The Swagger 2.0 (OpenAPI 2.0) document to upgrade, as JSON or YAML text.",
          "type": "string"
        },
        "target_version": {
          "default": "3.0.3",
          "description": "Which OpenAPI 3.0.x version string to stamp into the 'openapi' field. Default '3.0.3' (the latest 3.0 patch).",
          "enum": [
            "3.0.3",
            "3.0.2",
            "3.0.1",
            "3.0.0"
          ],
          "type": "string"
        }
      },
      "required": [
        "spec"
      ],
      "type": "object"
    }
  }
}