Socket
Socket
Sign inDemoInstall

nuxt-openapi-docs-module

Package Overview
Dependencies
17
Maintainers
1
Versions
201
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nuxt-openapi-docs-module

A module for Nuxt.js to generate pages from OpenAPI specifications


Version published
Weekly downloads
24
decreased by-47.83%
Maintainers
1
Install size
66.3 MB
Created
Weekly downloads
 

Changelog

Source

[5.2.3] - 2024-04-10

Changed

  • parser refactor
  • update deps

Added

  • lodash CVE-2021-23337

Removed

Readme

Source

npm version npm downloads NPM license npm type definitions donate GitHub Repo stars

OpenApiDocs Nuxt Module

logo

This module provides a simple way to display OpenAPI documentation in a Nuxt.js 2 & 3 application. It allows you to define an OpenAPI specification file and renders it using a set of reusable Vue.js components.

work with static and server target

Package Version Information

VersionSupported Nuxt Version
3.02.x and 3.x
4.02.x and 3.x
5.03.x
5.2> 3.7

for nuxt 3 need add vite.config.ts

import { defineConfig } from "vite";

export default defineConfig({
  build: {
    rollupOptions: {
      external: ["vue/server-renderer"],
    },
  },
});

white image white image 2 black image mobile image

Quick Setup

  1. Add nuxt-openapi-docs-module dependency to your project
npx nuxi@latest module add nuxt-openapi-docs-module
  1. Add nuxt-openapi-docs-module to the modules section of nuxt.config.ts

nuxt 3

export default defineNuxtConfig({
  modules: [
    'nuxt-openapi-docs-module'
  ]
})

nuxt 2

module.exports = {
  modules: [
    'nuxt-openapi-docs-module',
  ],
}
  1. create docs/openapi folder in root project dir(not src) or change path - folder parameter

  2. You can use Vue Devtools "Routes" section to see new routes.

Configuration

You can customize the behavior of the module by providing options in the nuxt.config.js file.

module.exports = {
modules: [
    [
        'nuxt-openapi-docs-module',
        {
            folder: './docs/openapi',
            name: 'OpenApiDocs',
            files: function() {return { 'News-API': 'News API'}},
        }
    ],
],
// ...
}
  • folder (default: ./docs/openapi): the folder where your OpenAPI specification files are located.
  • name (default: OpenApiDocs): the name of the main component used to render the OpenAPI documentation.
  • path: the component url for docs.
  • files: function with files list in OpenApiDocs folder, files: function() {return { 'News-API': 'News API'}}.
  • debug: print debug information to console, Default: false
  • list: Toggling the list of documents, Default: false
  • locales: array wit enabled locales, Default: ['en'] Support: ['en', 'fr', 'de', 'ru', 'ch', 'es', 'hi', 'ar', 'zh', 'pt']
  • logo: svg logo in string
  • footer: doc footer

Folder Structure

The default folder structure for your OpenAPI specification files should look like this:

docs/
    openapi/
        api1.yaml
        api2.yaml

Localization

wiki

Plugin

wiki

Development

wiki

Custom pages

wiki

Keywords

FAQs

Last updated on 10 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc