1.0.4 • Published 4 years ago

@lubowiecki/node-openapi v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

node-openapi

Cli commands

Display cli documentation

openapi help

Compile openapi.json from docs

openapi build spec --source=./docs/index.json --dist=./dist/openapi.json

Serve documentation in browser

openapi serve editor --port=3010 --host=http://localhost --source=./dist/openapi.json --basePath=/v1

Serve openapi.json

openapi serve spec --port=3011 --host=http://localhost --source=./dist/openapi.json

Build typescript interfaces (needs 'openapi serve spec' command running)

openapi serve spec
openapi build typescript --source=http://localhost:3011 --dist=./src/rest/api --typesOnly=true

Default config

{
	basePath: '/v1',
	host: 'http://localhost',
	port: {
		editor: '3010',
		spec: '3011'
	},
	dist: {
		folder: './dist',
		fileName: 'index'
	},
	sourceUrl: './src/docs/index.json',
	tsModelsUrl: './src/rest/api'
};