All Projects → axetroy → swagger2ts

axetroy / swagger2ts

Licence: MIT license
💗 从 Swagger 生成优雅的 Typescript 代码. Generate elegant typescript code from swagger.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to swagger2ts

deno-csv
Streaming API for reading and writing CSV for https://deno.land/
Stars: ✭ 34 (+100%)
Mutual labels:  deno
i18next-http-backend
i18next-http-backend is a backend layer for i18next using in Node.js, in the browser and for Deno.
Stars: ✭ 270 (+1488.24%)
Mutual labels:  deno
progress
ProgressBar in terminal for deno
Stars: ✭ 39 (+129.41%)
Mutual labels:  deno
dem
A module version manager for Deno.
Stars: ✭ 58 (+241.18%)
Mutual labels:  deno
deno-drash-realworld-example-app
Deno + Drash RealWorld example app
Stars: ✭ 56 (+229.41%)
Mutual labels:  deno
deno install
Deno 安装器(国内加速)
Stars: ✭ 58 (+241.18%)
Mutual labels:  deno
aqua
A minimal and fast 🏃 web framework for Deno
Stars: ✭ 219 (+1188.24%)
Mutual labels:  deno
deno bindgen
Simplified glue code generation for Deno FFI libraries written in Rust.
Stars: ✭ 142 (+735.29%)
Mutual labels:  deno
database
towards a common interface for SQL databases in Deno TypeScript
Stars: ✭ 15 (-11.76%)
Mutual labels:  deno
vscode-deno-extensionpack
Deno VS Code Extension Pack
Stars: ✭ 12 (-29.41%)
Mutual labels:  deno
iam-policies
Iam policies implementation for create roles and manage permissions
Stars: ✭ 20 (+17.65%)
Mutual labels:  deno
logrocket deno api
A functional CRUD-like API with Deno and Postgres
Stars: ✭ 23 (+35.29%)
Mutual labels:  deno
merlin
Testing and Benchmarking framework for deno 🧙‍♂️
Stars: ✭ 46 (+170.59%)
Mutual labels:  deno
hex
An ecosystem delivering practices, philosophy and portability. Powered By Deno and JavaScript.
Stars: ✭ 48 (+182.35%)
Mutual labels:  deno
denoffi
Deno Foreign Function Interface.
Stars: ✭ 37 (+117.65%)
Mutual labels:  deno
bundle
An online tool to quickly bundle & minify your projects, while viewing the compressed gzip/brotli bundle size, all running locally on your browser.
Stars: ✭ 475 (+2694.12%)
Mutual labels:  deno
deno-task-runner
Task runner for deno
Stars: ✭ 31 (+82.35%)
Mutual labels:  deno
espresso
Minimal web framework for Deno
Stars: ✭ 43 (+152.94%)
Mutual labels:  deno
erc20-balance
💎 Get 2000+ ERC-20 token balances with JavaScript. Supports Node.js and Deno
Stars: ✭ 18 (+5.88%)
Mutual labels:  deno
deno-fetch-event-adapter
Dispatches global fetch events using Deno's native http server.
Stars: ✭ 18 (+5.88%)
Mutual labels:  deno

中文简体 | English

Build Status

从 swagger(v3) 的 JSON 文件生成 typescript 代码。

它会生成 typescript 的声明和基于 fetch 的运行时。几乎开箱即用。

它能够适用于绝大多数场景,强健你的接口调用,省去烦人的类型声明。

这里有一些生成好的精美例子,看看是否符合您的胃口

安装

通过 Deno 安装

deno install \
  -A \
  --no-check \
  --reload \
  -f \
  https://github.com/axetroy/swagger2ts/raw/v0.2.24/swagger2ts.ts

或者通过 npm 安装

npm install -g @axetroy/swagger2ts

使用

使用命令行工具

swagger2ts swagger.json > api.ts
swagger2ts https://example.com/swagger.json > api.ts

通过 nodejs 函数调用

import { generate } from "@axetroy/swagger2ts";

const output = await generate("/path/to/swagger.json");
// const output = await generate("https://example.com/swagger.json");

console.log(output);

通过 Deno 函数调用

import { generate } from "https://github.com/axetroy/swagger2ts/raw/v0.2.24/generate.ts";

const output = await generate("/path/to/swagger.json");
// const output = await generate("https://example.com/swagger.json");

console.log(output);

开源许可

The MIT License

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].