🚨 Breaking Changes
- OAPath: Remove
end-top
slot - by @enzonotario (5ab61)
🚀 Features
- openapi: Add getOpenApiInstance to manage between custom/injected/global specs - by @enzonotario (23a20)
View changes on GitHub
If using have configured the Theme to use a Global Spec, it's recommended to update your configuration to:
import DefaultTheme from 'vitepress/theme'
import type { Theme } from 'vitepress'
import { theme, useOpenapi } from 'vitepress-openapi'
import 'vitepress-openapi/dist/style.css'
import spec from '../../public/openapi.json' assert { type: 'json' }
export default {
extends: DefaultTheme,
async enhanceApp({ app, router, siteData }) {
// Set the OpenAPI specification.
const openapi = useOpenapi({ spec })
app.provide('openapi', openapi) // <--- provide openapi instance
// Use the theme.
theme.enhanceApp({ app })
}
} satisfies Theme
See more: https://vitepress-openapi.vercel.app/guide/getting-started.html#theme-configuration