0.0.3 • Published 7 months ago

@stefanprobst/openapi-client v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

openapi-client

this is a minimal typed request utility to interact with openapi-specified backends.

it uses openapi-typescript for generating types, and is mostly copied from openapi-fetch.

how to install

npm install @stefanprobst/openapi-client

how to use

first, generate types from an openapi document:

npx openapi-typescript https://my-backend.org/openapi.json -o ./types/api.ts

second, instantiate a typed api client:

import { createClient } from "@stefanprobst/openapi-client";

import type { paths } from "./types/api";

const client = createClient<paths>({ baseUrl: "http://localhost:3000" });
0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago

0.0.0

7 months ago