coc-swagger
haishanA coc plugin to improve the Swagger/OpenAPI authoring experience in vim
A practical first workflow
Use coc-swagger to preview a Swagger/OpenAPI specification from the editor. Begin with a small saved specification so you can distinguish a preview problem from an error in a large API definition. Use your JSON or YAML language extension for editing assistance as needed.
Preview one documented endpoint
Install with :CocInstall coc-swagger, then save this self-contained OpenAPI document as openapi.yaml:
| 1 | openapi: 3.0.0 |
| 2 | info: |
| 3 | title: Example API |
| 4 | version: 1.0.0 |
| 5 | paths: |
| 6 | /health: |
| 7 | get: |
| 8 | summary: Check service health |
| 9 | responses: |
| 10 | '200': |
| 11 | description: Service is healthy |
With that buffer active, run :CocCommand swagger.render. Look for a browser preview containing Example API and the GET /health operation. This defines a document, not a running /health endpoint; rendering it does not verify a backend response.
If the command is unavailable, check :CocList extensions and the extension activation log. If a preview opens but cannot display the specification, first retry this small example, check YAML indentation and inspect :CocOpenLog. Once it renders, reintroduce your real paths and references in small steps to locate the failing part.
The preview opens a local web service. When the editor runs over SSH, the editor host and your desktop browser are different environments; diagnose browser reachability separately from whether the YAML parses. Do not assume the extension publishes documentation to a public URL.
Command and activation settings checked in coc-swagger 0.0.4; preview behavior follows its upstream implementation. The sample is an expected-result workflow, not a recorded backend API test.
Site-authored guidance reviewed on 2026-09-11. Content sources and maintainers · Choose extension responsibilities
Published Package Summary
Install
:CocInstall coc-swagger
Usage
" when you are editing a Swagger/OpenAPI specification file
:CocCommand swagger.render
" tip: add a (slightly) short command
command -nargs=0 Swagger :CocCommand swagger.render
- A coc plugin to improve the Swagger/OpenAPI authoring experience in vim
- onLanguage:yaml
- onLanguage:json
- onCommand:swagger.render
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion History
This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.
Contributed Commands
All contributes.commands entries from the published package manifest for coc-swagger@0.0.4.
| Command (:CocCommand) | Description |
|---|---|
| swagger.render | Render the Swagger/OpenAPI spec |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable coc-swagger extension"
}