一覧へ戻る
thelinuxlich/zodios-api-shorthand(新しいタブで開きます)
主要言語: TypeScript
A shorthand helper to implement Zodios API endpoints
- star 数
- 17
- watcher 数
- 1
- fork 数
- 1
- issue 数
- 0
- 最終更新
- 2022/12/10
主要言語: TypeScript
A shorthand helper to implement Zodios API endpoints
This library is a helper to shorten the Zodios API definition, so instead of writing:
makeApi([ { method: "get", name: "getTransactions", path: "/v1/transactions", parameters: [ { type: "Query", name: "limit", schema: z.number(), }, { type: "Query", name: "offset", schema: z.number(), }, ], response: z.string(), }, ]);
You can write:
api({ "GET transactions": { path: "/v1/transactions", queries: { limit: z.number(), offset: z.number(), }, response: z.string(), }, });
Check out src/index.test.ts about usage