All Projects → Elevista → nuxtswagger

Elevista / nuxtswagger

Licence: other
Nuxt-TS-Swagger

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to nuxtswagger

now-nuxt
A Now v2 Nuxt builder
Stars: ✭ 25 (+47.06%)
Mutual labels:  nuxt, nuxtjs
Bael Template
Brutalist Blog theme for Netlify CMS
Stars: ✭ 187 (+1000%)
Mutual labels:  nuxt, nuxtjs
Python Module
Write Nuxt.js applications using Python! [Experimental]
Stars: ✭ 181 (+964.71%)
Mutual labels:  nuxt, nuxtjs
Nuxt Imagemin
Nuxt module to minify your images. Works with: png, jpeg, gif, and svg
Stars: ✭ 170 (+900%)
Mutual labels:  nuxt, nuxtjs
Nuxt Shopify
🛍 Seamless Shopify Buy SDK integration with Nuxt.js.
Stars: ✭ 210 (+1135.29%)
Mutual labels:  nuxt, nuxtjs
Nuxt Client Init Module
Provide client version of nuxtServerInit
Stars: ✭ 176 (+935.29%)
Mutual labels:  nuxt, nuxtjs
Bootstrap Vue
BootstrapVue provides one of the most comprehensive implementations of Bootstrap v4 for Vue.js. With extensive and automated WAI-ARIA accessibility markup.
Stars: ✭ 13,603 (+79917.65%)
Mutual labels:  nuxt, nuxtjs
Nuxpress
A Nuxt-based blogging engine and boilerplate
Stars: ✭ 135 (+694.12%)
Mutual labels:  nuxt, nuxtjs
Nuxt Netlify Cms Module
Easy Netlify CMS integration with nuxt.js
Stars: ✭ 195 (+1047.06%)
Mutual labels:  nuxt, nuxtjs
Typed Vuex
🏦 A typed store accessor for vanilla Vuex.
Stars: ✭ 193 (+1035.29%)
Mutual labels:  nuxt, nuxtjs
Nuxt Coreui
💫 NuxtJS + CoreUI Project — Unofficial Nuxt + CoreUI project, free to use boilerplate for every need.
Stars: ✭ 166 (+876.47%)
Mutual labels:  nuxt, nuxtjs
Redirect Module
No more cumbersome redirects!
Stars: ✭ 235 (+1282.35%)
Mutual labels:  nuxt, nuxtjs
Vue Soundcloud
🎧 A SoundCloud client built with Vue and Nuxt
Stars: ✭ 141 (+729.41%)
Mutual labels:  nuxt, nuxtjs
Press
Minimalist Markdown Publishing for Nuxt.js
Stars: ✭ 181 (+964.71%)
Mutual labels:  nuxt, nuxtjs
Nuxt Payload Extractor
Nuxt.js module that makes `nuxt generate` command to store html and payload separately.
Stars: ✭ 140 (+723.53%)
Mutual labels:  nuxt, nuxtjs
Feed Module
Everyone deserves RSS, ATOM and JSON feeds!
Stars: ✭ 182 (+970.59%)
Mutual labels:  nuxt, nuxtjs
Blog Module
Build your blog with @nuxt
Stars: ✭ 130 (+664.71%)
Mutual labels:  nuxt, nuxtjs
Surmon.me
🆒 My personal website and blog, powered by @vuejs (3)
Stars: ✭ 1,767 (+10294.12%)
Mutual labels:  nuxt, nuxtjs
Gtm Module
Google Tag Manager Module for Nuxt.js
Stars: ✭ 187 (+1000%)
Mutual labels:  nuxt, nuxtjs
Vuemmerce
👉 Responsive ecommerce template 🛒 built with Vue.js and Nuxt.js
Stars: ✭ 223 (+1211.76%)
Mutual labels:  nuxt, nuxtjs

NuxTSwagger

Nuxt-TS-Swagger plugin generator CLI

npm package github stars

Installation

npm i -D nuxtswagger

Requirements

Basic Usage

in Nuxt project directory

npx nuxtswagger https://api.server.foo/swagger.json

in nuxt.config.js

module.exports = {
  plugins: [
    '~/plugins/api'
  ]
}

in component

export default {
  async asyncData ({ $api }) {
    return { foo: await $api.foo.get() }
  },
  data () { return { bar: undefined } },
  async mounted () { this.bar = await this.$api.bar.get() }
}

Path param mode

see form option

/* default (1.1.0+) */
$api.foo.bar(1).get(2)
$api.foo.bar.get()

/* underscore */
$api.foo._bar.get(1, 2)
$api.foo.bar.get()

Options

options priority : command line > nuxt.config > package.json

nuxtswagger argument1 --option1 value1 --option2 value2
option description default example
(first argument) Swagger schema JSON path (required) http://.. or ./foo/swagger.json
src same as first argument first argument same as above
plugins-dir Nuxt plugins directory plugins
plugin-name Name for generated plugin api
inject Nuxt plugin inject key {plugin-name}
type-path Path for scheme type file {plugins-dir}/{plugin-name}/{types.ts} ./types/swagger.d.ts
base-path base path /v1 /v2
skip-header Ignore parameter in header false true
form Path param interface mode (undefined) underscore

Set options using package.json

{
  "scripts": {
    "swagger": "nuxtswagger"
  },
  "nuxtswagger": {
    "pluginName": "foo",
    "src": "https://api.server.foo/swagger.json"
  }
}

Set options using nuxt.config

v1.2+

export default {
  // support array
  publicRuntimeConfig: {
    nuxtswagger: {
      pluginName: 'foo',
      // AxiosRequestConfig?
      axiosConfig: { baseURL: 'https://api-stage.server.foo' }
    }
  }
}

tsconfig.json

{
  "compilerOptions": {
    "types": ["nuxtswagger/types"]
  }
}

and npm run swagger or npx nuxtswagger

License

ISC License Copyright (c) 2020, Elevista

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].