Skip to main content
Back to Extensions Directory
coc.nvim fallback icon

coc-swagger

haishan

A coc plugin to improve the Swagger/OpenAPI authoring experience in vim

Installation CommandVim prompt
:CocInstall coc-swagger
GitHub owner
haishan
Version
v0.0.4
npm package
coc-swagger
Requirements
coc ^0.0.79
License
MIT
Repository
GitHub
npm latest published 2024-06-14Registry checked 2026-08-31Registry summary

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:

openapi.yaml
1openapi: 3.0.0
2info:
3 title: Example API
4 version: 1.0.0
5paths:
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
Read the complete README
  • A coc plugin to improve the Swagger/OpenAPI authoring experience in vim
Activation Events
  • onLanguage:yaml
  • onLanguage:json
  • onCommand:swagger.render
Developer Resources

Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.

Open Developer Guide

Version 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.