Import from OpenAPI / Swagger

Bulk-import all your API endpoints from an OpenAPI 3.x or Swagger 2.0 spec file — JSON or YAML.

The OpenAPI importer reads your spec file and creates a fully configured request for every endpoint — method, URL, path params, query params, request body schema, and auth.

OpenAPI 3.0.xOpenAPI 3.1.xSwagger 2.0JSONYAML

How to import

  1. 1

    Navigate to Request Builder

    Select Request Builder from the left sidebar inside your workspace.

  2. 2

    Click Import → OpenAPI / Swagger

    Choose your import method: upload a file, paste a public URL, or paste the spec content directly.

  3. 3

    Review and confirm

    The system checks the uploaded spec and displays its name, version, and validity status.

  4. 4

    Generate collections

    Clicking Import prompts Optraflow to create a collection with one request per endpoint, using bodies derived from the schema.

  5. 5

    Validate endpoints

    Clicking an endpoint from the collection list populates all details in the request section, allowing users to review it by executing the endpoint.

Example spec

yaml·openapi.yaml
openapi: "3.0.3"
info:
  title: Example API
  version: "1.0"
servers:
  - url: https://api.example.com/v1
paths:
  /users/{id}:
    get:
      summary: Get user by ID
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
      responses:
        "200":
          description: Successful response

What gets generated

For each endpoint: the correct HTTP method, a populated URL with path params, sample request body from the schema, expected status code assertions, and authentication headers from the securitySchemes block.

Best practices

  1. Keep specs updated — re-import whenever your API changes to keep tests in sync.
  2. Review generated requests — always verify auto-generated bodies before running.
  3. Add custom assertions — enhance generated tests with specific field validations.
  4. Use environments — configure different base URLs for dev, staging, and prod.

Troubleshooting

IssueSolution
Import failsValidate your spec at editor.swagger.io before importing
Missing endpointsCheck that endpoints have the correct tags and are not marked deprecated
Wrong base URLUpdate the base URL in Environment settings
Auth not appliedConfigure the securitySchemes block in your spec, or set auth manually after import