vitepress-openapi-docs

Interactive OpenAPI documentation for VitePress. Lightweight, Vue-native, composable in markdown.
3,376 6
Install
npm install vitepress-openapi-docs
Latest Version:1.8.1
Vue:3
License:MIT
Last Updated:Oct 3, 2026
Links: GitHub  ·  npm
Maintainer: rodindev

vitepress-openapi-docs

Interactive OpenAPI documentation for VitePress. Lightweight, Vue-native, composable in markdown.

Documentation

Install

npm i vitepress-openapi-docs vue-api-playground

Configure

// docs/.vitepress/config.ts
import { defineConfig } from 'vitepress'
import { openApiDocs } from 'vitepress-openapi-docs/vitepress'

export default defineConfig({
  extends: await openApiDocs({
    specs: [{ name: 'api', spec: 'docs/openapi/api.yaml', prefix: '/api' }],
  }),
})
// docs/.vitepress/theme/index.ts
import { h } from 'vue'
import DefaultTheme from 'vitepress/theme'
import { enhanceAppWithOpenApi, OperationJumper } from 'vitepress-openapi-docs'
import specs, { defaults, prefixes } from 'virtual:vitepress-openapi-docs/specs'
import changelogs from 'virtual:vitepress-openapi-docs/changelogs'
import 'vue-api-playground/styles'
import 'vitepress-openapi-docs/styles'

export default {
  extends: DefaultTheme,
  Layout() {
    return h(DefaultTheme.Layout, null, {
      'layout-top': () => h(OperationJumper),
    })
  },
  enhanceApp({ app }) {
    enhanceAppWithOpenApi({ app, specs, changelogs, defaults, prefixes })
  },
}

changelogs, defaults, and prefixes are optional - omit them if you don't use <OpenApiChangelog>, custom defaults, or multi-spec prefixes.

Use in markdown

<OpenApiEndpoint id="api.users.list" />

<OpenApiSpec name="api" />

<OpenApiSchema name="User" spec-name="api" />

<OpenApiChangelog name="api" />

Per-operation, per-schema, and per-spec-changelog pages are auto-generated. Hand-written landing pages sit alongside at the same URL prefix.

Requirements

  • Node.js >= 20
  • Vue >= 3.3
  • VitePress >= 1.0
  • vue-api-playground >= 2.5

License

MIT

Related Packages

@comet-cli/plugin-documentation

Plugin for generating API documentation

6,405 0
@koumoul/vue-openapi

Display API documentation that follow the OpenAPI 3.0 Specification

1,110 94
@scalar/swagger-editor

an editor which is tailored to write OpenAPI spec

58,866 16,316
vue-api-playground

Interactive API playground component for Vue 3. Plug-and-play with VitePress or...

2,915 4
openapi-fetch

Fast, type-safe fetch client for your OpenAPI schema. Only 6 kb (min). Works wit...

226,490,942 8,405

Version History

Version Released Vue License
1.8.1 ^3.5.0 MIT
1.8.0 ^3.5.0 MIT
1.7.1 ^3.3.0 MIT
1.7.0 ^3.3.0 MIT
1.6.0 ^3.3.0 MIT