Skip to content

Importing OpenAPI / Swagger

This is Restorm’s most complete import. Three versions are recognised: Swagger 2.0, OpenAPI 3.0 and OpenAPI 3.1.

File ▸ Import (Ctrl+I), then a swagger.json / openapi.json file, or the specification’s URL directly.

If the URL answers 401 or 403, Restorm offers to attach an authentication and retry, without leaving the import modal.

The tree produced by an OpenAPI import in the sidebar pane — one folder per tag (pet, store, user) — next to the environment folder's home sub-tab

Element of the specificationWhat Restorm makes of it
servers (or host + basePath + schemes)The environment’s base URL, with server variables resolved
tagsOne folder per tag, plus an Other folder for the rest
Each operationAn HTTP request, method and path included
ParametersPath, query and header parameters, typed (string, number, date time, enumeration, secret…)
requestBodyThe body, in its content type
examplesThe body pre-filled with the example supplied
components / definitionsThe API documentation: models, descriptions
enumEnumerations reusable as a value type
ResponsesDocumented per content type

$refs are resolved, including across components.

The components / definitions row deserves emphasis: the import is not limited to requests, it keeps the API’s whole documentation — descriptions, models, security schemes, examples, enumerations. It is browsable in the Docs tab of the environment folder produced by the import as well as in each request’s own, and it re-syncs from the source. See Accessing and updating an imported API’s documentation.

The Docs tab of the environment folder produced by the import, with the API's documentation and its table of contents

The security schemes declared are translated into pre-wired headers or parameters, with the matching environment variable created for you:

SchemeWhat Restorm sets up
apiKey in a header or in the queryA pair named after the scheme, value {{<schema>}}
http + basicAuthorization: Basic {{<schema>_credentials}}
http + bearer, oauth2, openIdConnectAuthorization: Bearer {{<schema>_token}}

All that is left is to fill in the variable — or to replace it with an authentication route to benefit from automatic renewal.

OpenAPI and Swagger are among the re-syncable formats: the folder’s Refresh button fetches the source and Restorm applies the delta — new operations added, vanished operations marked deprecated rather than deleted, your edits kept. See Updating from the source.