Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kong/portal-vue-mini-spec-renderer

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kong/portal-vue-mini-spec-renderer

A Kong UI mini component for displaying API specs

  • 0.0.1-beta.1
  • beta
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

@kong/portal-vue-mini-spec-renderer

A Kong UI mini component for displaying API specs

Features

  • Render spec styled object arrays
  • Support both table of contents and list summary views

Requirements

  • vue must be initialized in the host application

Usage

Install

Install the component in your host application

yarn add @kong/portal-vue-mini-spec-renderer

Register

You can register portal-vue-mini-spec-renderer globally or locally.

// Global registration
import { createApp } from 'vue'
import VueMiniSpecRenderer from '@kong/portal-vue-mini-spec-renderer'
import '@kong/portal-vue-mini-spec-renderer/dist/style.css'

const app = createApp(App)

app.use(VueMiniSpecRenderer)

<!-- Local registration -->
<template>
  <VueMiniSpecRenderer />
</template>

<script setup lang="ts">
import VueMiniSpecRenderer from '@kong/portal-vue-mini-spec-renderer'
import '@kong/portal-vue-mini-spec-renderer/dist/style.css'
</script>

Props

spec

  • type: Object[]
  • required: true

Specification object array. Required. The objects should conform to the following interface.

{
  path: string
  method: string
  operationId: string | null
  tags: string[]
  summary: string | null
  deprecated: boolean
  selected?: boolean
  key?: string
}

isSummary

  • type: Boolean
  • required: false
  • default: false

If enabled, will display list summary view with a few more details instead of table of contents style.

width

  • type: String
  • required: false
  • default: 210

Controls the width of the rendered spec. Currently supports numbers (will be converted to px), auto, vw, vh, and percentages for width.

Slots

empty-state

Controls the content displayed when the spec array is empty.

error-state

Controls the content when spec is not provided.

Emits

selected

  • returns: Object - the last clicked item data
{
  path: string
  method: string
  operationId: string | null
  tags: string[]
  summary: string | null
  deprecated: boolean
  selected?: boolean
  key?: string
}

This is emitted whenever an item in the spec is clicked. Clicking an item will deselect any previously selected items.

FAQs

Package last updated on 20 Jan 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