@sebspark/openapi-client
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

@sebspark/openapi-client

A typed REST client for the definitions from openapi-typegen

Usage

Install

yarn add @sebspark/openapi-client`

or

npm install @sebspark/openapi-client`

Generate client type

Use @sebspark/openapi-typegen

Code

import { TypedClient } from '@sebspark/openapi-client'
import { MarketdataClient } from './schemas/marketdata'

const client = TypedClient<MarketdataClient>(`https://example.com/api`)
const {data} = await client.get('/markets')

Example

Example can be found in @sebspark/openapi-e2e

Readme

Keywords

none

Package Sidebar

Install

npm i @sebspark/openapi-client

Weekly Downloads

586

Version

1.4.0

License

Apache-2.0

Unpacked Size

21.7 kB

Total Files

7

Last publish

Collaborators

  • believer
  • raduachim
  • alexanderczigler
  • johanobrink