0.2.0 • Published 3 months ago

openapi-client-codegen v0.2.0

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

openapi-client-codegen

Node CI npm license

Node.js library that generates Typescript function chaining clients based on the OpenAPI specification.

  • Full type
  • Faster
  • Small
  • Powerful

Usage

npx openapi-typescript examples/example.yaml -o examples/schema.d.ts
import { createClient } from 'openapi-client-codegen';

const client = createClient<paths>({
  baseUrl: 'http://localhost:8080',
  request: async (options) => {
    // using fetch or custom fetch API
  },
});

// use function chaining client with type
const result0 = await client.pet().get();
const result1 = await client.store.order().get();
const result2 = await client.store.inventory.get();
const result3 = await client.pet.findByTags.get();
const result4 = await client.pet().post();
const result5 = await client.pet.post({
  body: {
    name: 'dog',
    photoUrls: ['http://example.com/dog.jpg'],
  },
});

License

openapi-client-codegen is MIT licensed.

0.1.2

3 months ago

0.2.0

3 months ago

0.1.1

3 months ago

0.1.3

3 months ago

0.1.0

9 months ago

0.0.1

9 months ago