github enzonotario/vitepress-openapi v0.0.3-alpha.42

latest releases: v0.1.9, v0.1.8, v0.1.7...
11 months ago

   🚨 Breaking Changes

   🚀 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

Don't miss a new vitepress-openapi release

NewReleases is sending notifications on new releases.