#289 · Developer Tool

OpenAPI 3.0 to 3.1 Converter

Apply a conservative OpenAPI 3.0 to 3.1 migration to a JSON document. The converter updates the version marker, adds the 2020-12 JSON Schema dialect when absent, rewrites nullable schemas into type unions or an anyOf branch, and changes exclusive numeric limits from boolean flags to numeric values. It walks nested arrays and objects, so schema fragments inside components, parameters, request bodies, and responses receive the same treatment.

Developer Input

OpenAPI JSON
Ad space

How to use this developer tool

  1. Paste a JSON-formatted API document or load the included sample.
  2. Check that the document shape matches the label above the editor.
  3. Select “Convert to OpenAPI 3.1” or press Ctrl/Cmd + Enter.
  4. Review the summary and download the copy-ready result.

What this developer tool does

The converter handles mechanical keywords whose 3.1 representation can be derived without guessing API intent.

nullable: true becomes a null type union when type is present, or an anyOf null branch otherwise. Boolean exclusiveMinimum and exclusiveMaximum consume their matching numeric limit.

The original document is not modified in place; the output is a new formatted JSON document.

Example

The Sample button loads a small specification chosen for this operation. Running it produces the same structured fields shown in the output panel.

{
  "openapi": "3.0.3",
  "info": {
    "title": "Nullable API",
    "version": "1"
  },
  "components": {
    "schemas": {
      "User": {
        "type": "object",
        "nullable": true,
        "properties": {
          "nickname": {
            "type": "string",
            "nullable": true
          },
          "choice": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          }
        }
      }
    }
  },
  "paths": {}
}

Use cases

  • Review an API contract during a pull request.
  • Prepare documentation or deterministic test fixtures.
  • Find migration work before changing generators or clients.
  • Export a focused report without sharing the source document.

Tips for reliable output

  • Bundle remote references before running the page.
  • Keep operation IDs stable across published versions.
  • Prefer explicit examples for domain-specific values.
  • Validate the complete document after applying generated output.
  • Commit the original specification before a conversion.

Processing details

A deep copy is traversed once. The converter counts each keyword rewrite and leaves unknown extension fields untouched.

This is not a complete semantic migration. It does not rewrite every discriminator, example, reference-sibling, or webhook design decision; validate the output with a full OpenAPI 3.1 validator.

Frequently asked questions

Does this page accept YAML OpenAPI files?

No. This browser-only implementation accepts JSON so parsing behavior stays predictable without loading an external YAML library. Convert YAML to JSON first.

Are external $ref URLs resolved?

No. Local JSON Pointer references are handled where the operation needs them, but remote references are not fetched.

Does the result replace a full OpenAPI validator?

No. OpenAPI 3.0 to 3.1 Converter performs its documented transformation or audit. Use a standards-aware validator before publishing a specification.

Is the specification uploaded to a server?

No. Processing runs in the current browser tab. The page does not send the pasted document to an API.

Can I download the result?

Yes. Run the tool, then use Download for the primary output or the JSON and CSV buttons when those structured exports are available.

Input contract

ItemRequirement
FormatJSON object
ExecutionLocal browser
Remote refsNot fetched

API & GraphQL Tools

Browse contract inspection, conversion, request, response, and schema utilities.

Open category hub