npm

@tsed/cli-generate-swagger
TypeScript icon, indicating that this package has built-in type declarations

5.4.3 • Public • Published

Ts.ED logo

Ts.ED CLI - Generate Swagger

Build & Release PR Welcome semantic-release code style: prettier backers


Website   •   Getting started   •   Slack   •   Twitter

Ts.ED CLI plugin. Generate all Swagger in json and yaml format from your Ts.ED Server.

Features

The plugin let you generate all Swagger spec from the Ts.ED Server instance without running it.

Installation

Run:

npm install @tsed/cli-generate-swagger @tsed/cli-core @tsed/cli @tsed/swagger

Then create or edit the src/bin/index.ts in your project:

#!/usr/bin/env node
import { CliCore } from "@tsed/cli-core";
import { GenerateSwaggerCmd } from "@tsed/cli-generate-swagger";
import configuration from "../config";
import { CronCmd } from "./commands/CronCmd";
import "./db/connections";
import { Server } from "../Server";

CliCore.bootstrap({
  ...configuration,
  server: Server,
  // add your custom commands here
  commands: [GenerateSwaggerCmd, CronCmd]
}).catch(console.error);

Add a new script your package.json:

{
  "scripts": {
    "build:specs": "yarn tsed run generate-swagger --output ../specs"
  }
}

This command generate all Swagger specification in json and yaml format.

Contributors

Please read contributing guidelines here

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

License

The MIT License (MIT)

Copyright (c) 2016 - 2023 Romain Lenzotti

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Readme

Keywords

none

Package Sidebar

Install

npm i @tsed/cli-generate-swagger

Weekly Downloads

226

Version

5.4.3

License

MIT

Unpacked Size

260 kB

Total Files

20

Last publish

Collaborators

  • romakita