Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>vscode-openapi-viewerNew to Visual Studio Code? Get it now.
vscode-openapi-viewer

vscode-openapi-viewer

Andrew Butson

arbs.io
|
43,121 installs
| (7) | Free
| Sponsor
Live, interactive preview of OpenAPI 3.2, 3.1, 3.0 and Swagger 2.0 specifications in JSON or YAML
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

OpenAPI Viewer for VS Code

Marketplace version Installs Rating Build License: MIT

Quality Gate Security Rating Reliability Rating Maintainability Rating

Preview OpenAPI and Swagger documents right next to the file you're editing. Open a spec, click the preview button, and you get interactive API documentation that updates as you type. You can browse operations, inspect schemas and send test requests without leaving VS Code.

OpenAPI 3.2, 3.1, 3.0 and Swagger 2.0 are supported, in JSON or YAML.

Preview of an OpenAPI 3.2 document showing nested tags, a QUERY operation and a custom COPY method

Features

  • Live preview. The preview refreshes shortly after you stop typing. If the file is briefly invalid mid-edit, the last good version stays on screen until it parses again.
  • OpenAPI 3.2. Tag display names and nested tags, the QUERY method, custom methods through additionalOperations, querystring parameters, streaming responses (itemSchema), dataValue examples and the OAuth 2.0 device authorization flow all render properly.
  • Try requests. Pick a server, set up authentication and send a request from the preview, with generated client code for curl and common languages.
  • Follows your theme. Colours and fonts come from the active VS Code theme, including light, dark and high contrast.
  • Private by default. With the default renderer the preview loads nothing from the internet. Telemetry, hosted fonts, request proxies and AI features are all switched off.
  • Two renderers. Scalar is the default. RapiDoc, the renderer used before version 2.0, is still available if you prefer it.

Getting started

  1. Install vscode-openapi-viewer from the Visual Studio Marketplace, or run:

    code --install-extension AndrewButson.vscode-openapi-viewer
    
  2. Open an OpenAPI or Swagger file (.json, .yaml or .yml).

  3. Click the OpenAPI icon in the editor title bar, or run openapi: Show API Specification from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).

The preview opens beside your editor. The icon only appears when the file has a top-level openapi or swagger field.

Supported specifications

Specification Scalar (default) RapiDoc
OpenAPI 3.2 Yes Partly. Features new in 3.2 are not shown
OpenAPI 3.1 Yes Yes
OpenAPI 3.0 Yes Yes
Swagger 2.0 Yes Yes

If you want to see what 3.2 looks like in the preview, open samples/json/openapi-3.2-features.json.

Settings

Setting Default What it does
openapi.preview.renderer scalar Choose scalar or rapidoc. OpenAPI 3.2 features need scalar.
openapi.preview.markdownLineBreaks false Show single line breaks in description text as line breaks. By default descriptions follow CommonMark, as the OpenAPI Specification requires, where a single newline is shown as a space. Turn this on if your descriptions are written with GitHub-style line breaks.

Sending test requests

Requests are sent straight from the preview to your API. Nothing goes through a proxy, so the API sees the request exactly as you built it. The preview runs inside a VS Code webview, so the usual browser rules apply. Your API has to allow cross-origin requests (CORS) for the response to be readable. If a request fails with a network error, check the API's CORS configuration first.

Known limitations

  • References to other files (for example $ref: ./schemas/pet.yaml) are not followed yet. References inside the same document work.
  • There is one preview panel at a time. Opening the preview from another file switches the panel to that file.
  • The preview button is hidden for read-only editors such as diff views.

Building from source

You'll need Node.js 22.13 or later and Yarn (the repo pins its own version through .yarn/releases).

yarn install
yarn lint
yarn typecheck
yarn package     # builds the .vsix

Press F5 in VS Code to start an Extension Development Host with the extension loaded. The samples folder has specs to test against, including a few broken ones.

The renderers are vendored in assets/. To move to a newer Scalar release, run node scripts/vendor-scalar.mjs <version>. The script checks the package integrity against the npm registry before writing the bundle.

Contributing

Bug reports and feature requests are welcome in GitHub issues. A small spec that reproduces the problem makes a bug far easier to track down. Pull requests are very welcome too. This is a personal project and my time is limited, so I can't always get to every bug myself.

If the extension is useful to you, a rating on the Marketplace helps other people find it. You can also sponsor the project on GitHub.

Credits

The preview is rendered by Scalar API Reference and RapiDoc. Both are MIT licensed, and their licences ship with the extension in assets/.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft