New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nuxt-openapi-docs-module

Package Overview
Dependencies
Maintainers
1
Versions
213
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-openapi-docs-module

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

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51
decreased by-82.29%
Maintainers
1
Weekly downloads
 
Created
Source

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

OpenApiDocs Nuxt Module

This module provides a simple way to display OpenAPI documentation in a Nuxt.js 2 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

alt text alt text alt text

Example

Show

Installation

npm install nuxt-openapi-docs-module

Usage Add the nuxt-openapi-docs-module to your Nuxt.js application by adding it to the modules section in your nuxt.config.js file:

module.exports = {
modules: [
'nuxt-openapi-docs-module',
],
// ...
}

This will automatically include the necessary components and set up the routes for your OpenAPI documentation.

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',
            locales: {en: 'English'},
            files: function(ctx) {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.
  • locales: object with locales, {en: 'English'}.
  • files: function with files list in OpenApiDocs folder, files: function(ctx) {return { 'News-API': 'News API'}}.
  • params: function with files list in OpenApiDocs folder, params: function(ctx) {return [{ in: 'queryString', name: 'key', value: '1111'}]}.

Folder Structure

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

docs/
    openapi/
        api1.yaml
        Components

This module provides several reusable Nuxt.js components to render your OpenAPI documentation:

  • OpenApiDocs: the main component used to render the OpenAPI documentation.
  • OpenApiHeader: the component used to render the header section of the OpenAPI documentation.
  • OpenApiInfo: the component used to render the OpenAPI specification information.
  • OpenApiComponents: the component used to render the OpenAPI components.
  • OpenApiRoute: the component used to render a single OpenAPI route. You can customize these components by modifying the corresponding .vue files in the components/ folder.

locales: moduleOptions.locales ?? {en: 'English'}, files: moduleOptions.files ?? function (ctx) { return {} },

FAQs

Package last updated on 21 Mar 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc