|
1 | 1 | # swagger-typescript-api |
2 | 2 |
|
3 | | -<img |
4 | | - src="https://raw.githubusercontent.com/acacode/swagger-typescript-api/master/assets/swagger-typescript-api-logo.png" |
5 | | - title="swagger-typescript-api logo by js2me" |
6 | | - align="left" |
7 | | - height="180" |
8 | | - width="93" |
9 | | -/> |
| 3 | +- Support for OpenAPI 3.0, 2.0, JSON and YAML |
| 4 | +- Generate the API Client for Fetch or Axios from an OpenAPI Specification |
10 | 5 |
|
11 | | -- Generate api via swagger scheme |
12 | | -- Supports OA 3.0, 2.0, JSON, yaml |
13 | | -- Generated api module use [**Fetch Api**](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) or [**Axios**](https://github.com/axios/axios) to make requests. |
| 6 | +Any questions you can ask [**here**](https://github.com/acacode/swagger-typescript-api/discussions) |
14 | 7 |
|
15 | | -<br> |
| 8 | +## Examples |
16 | 9 |
|
17 | | -Any questions you can ask [**here**](https://github.com/acacode/swagger-typescript-api/issues) or in [**our Slack**](https://join.slack.com/t/acacode/shared_invite/enQtOTQ5ODgyODQzMzYwLWYxOGI1MzQ3Yzg1ZWI5ZTI5NzNiZjExZTE5OWI1YjQ4NjBiNTk4NWVlNjM5YmU1ZWI2ZDkyMzZkZGIxNjA5NTQ)(**#swagger-typescript-api** channel) |
| 10 | +All examples you can find [**here**](https://github.com/acacode/swagger-typescript-api/tree/main/tests) |
18 | 11 |
|
19 | | - |
20 | | - |
21 | | -Thanks to [JetBrains](https://www.jetbrains.com/?from=swaggertypescriptapi) for providing a free license for their excellent Webstorm IDE. |
22 | | - |
23 | | -## 👀 Examples |
24 | | - |
25 | | -All examples you can find [**here**](https://github.com/acacode/swagger-typescript-api/tree/master/tests) |
26 | | - |
27 | | -## 📄 Usage |
| 12 | +## Usage |
28 | 13 |
|
29 | 14 | ```muse |
30 | 15 | Usage: sta [options] |
@@ -95,9 +80,9 @@ npx swagger-typescript-api -p ./swagger.json -o ./src -n myApi.ts |
95 | 80 | You can use this package from nodejs: |
96 | 81 |
|
97 | 82 | ```js |
98 | | -const { generateApi, generateTemplates } = require("swagger-typescript-api"); |
99 | | -const path = require("path"); |
100 | | -const fs = require("fs"); |
| 83 | +import fs from "node:fs"; |
| 84 | +import path from "node:path"; |
| 85 | +import { generateApi, generateTemplates } from "swagger-typescript-api"; |
101 | 86 |
|
102 | 87 | /* NOTE: all fields are optional expect one of `input`, `url`, `spec` */ |
103 | 88 | generateApi({ |
@@ -203,7 +188,7 @@ generateTemplates({ |
203 | 188 | }); |
204 | 189 | ``` |
205 | 190 |
|
206 | | -## 💎 options |
| 191 | +## Options |
207 | 192 |
|
208 | 193 | ### **`--templates`** |
209 | 194 |
|
@@ -487,21 +472,13 @@ generateApi({ |
487 | 472 |
|
488 | 473 | See more about [swagger schema type/format data here](https://json-schema.org/understanding-json-schema/reference/string.html#dates-and-times) |
489 | 474 |
|
490 | | -## 📄 Mass media |
| 475 | +## Mass media |
491 | 476 |
|
492 | 477 | - [5 Lessons learned about swagger-typescript-api](https://christo8989.medium.com/5-lessons-learned-about-swagger-typescript-api-511240b34c1) |
493 | 478 | - [Why Swagger schemes are needed in frontend development ?](https://dev.to/js2me/why-swagger-schemes-are-needed-in-frontend-development-2cb4) |
494 | 479 | - [Migration en douceur vers TypeScript (French)](https://www.premieroctet.com/blog/migration-typescript/) |
495 | 480 | - [swagger-typescript-api usage (Japanese)](https://zenn.dev/watahaya/articles/2f4a716c47903b) |
496 | 481 |
|
497 | | -## 🚀 How it looks |
498 | | - |
499 | | - |
500 | | - |
501 | | - |
502 | | - |
503 | | - |
504 | | - |
505 | | -## 📝 License |
| 482 | +## License |
506 | 483 |
|
507 | | -Licensed under the [MIT License](https://github.com/acacode/swagger-typescript-api/blob/master/LICENSE). |
| 484 | +Licensed under the [MIT License](https://github.com/acacode/swagger-typescript-api/blob/main/LICENSE). |
0 commit comments