Component API Reference
This section provides comprehensive documentation for the main components provided by vitepress-openapi
.
Available Components
OASpec
- Renders a complete OpenAPI specificationOAOperation
- Renders a specific API operation
Quick Start
All components support both local and remote OpenAPI specifications:
vue
<script setup>
import spec from './openapi.json'
</script>
<OASpec :spec="spec" />
vue
<OASpec spec-url="https://api.example.com/openapi.json" />
Global Configuration
If you have configured the OpenAPI specification globally using the useOpenapi
composable in your .vitepress/theme/index.js
file, you can use components without passing the spec:
vue
<OASpec />
<OAOperation operation-id="getUserById" />