0.1.9 • Published 4 months ago

@oas-typescript/axios v0.1.9

Weekly downloads
-
License
-
Repository
github
Last release
4 months ago

oas-typescript-axios

oas-typescript-axios is a generator for OpenAPI Specification 3 to axios. This tool is powered by openapi-zod-client for the OAS parsing.

Installation

It is recommended to install this as a project dependency so that it can be used in CI consistently.

# With npm.
npm install --save-dev @oas-typescript/axios

# With yarn.
yarn add -D @oas-typescript/axios

CLI guide

Usage
  $ openapi-to-axios generate <path-to-openapi-json>

Options
  --output, -o                  Specify a place for output, defaults to (pwd)/generated.
  --headers, -h                 When this flag is set, response will be in the form of AxiosResponse.

Examples
  $ openapi-to-axios generate ./openapi/api.json --output src/generated
  $ openapi-to-axios generate ./openapi/api.json --output src/generated --headers

Generating API client

To generate an API client, do this command:

# Do this using the "scripts" in package.json.
openapi-typescript-axios generate ./api.json --output generated

The command above will read the Open API Specification api.json and output them to the generated folder. The result will be as the following.

generated
├── index.ts
├── pet.ts
├── store.ts
├── user.ts
└── utils
    └── query.ts
0.1.9

4 months ago

0.1.8

4 months ago

0.1.7

5 months ago

0.1.6

5 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago