openapi-client-axios
Advanced tools
Comparing version 7.3.3 to 7.3.4
{ | ||
"name": "openapi-client-axios", | ||
"description": "JavaScript client library for consuming OpenAPI-enabled APIs with axios. Types included.", | ||
"version": "7.3.3", | ||
"version": "7.3.4", | ||
"license": "MIT", | ||
@@ -77,3 +77,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "fdd867307f9422c9d2d9fd52b6686572798b8df7" | ||
"gitHead": "20cce9ebc81b10fbabc4bbd26e47354c75e065eb" | ||
} |
@@ -173,24 +173,12 @@ <h1 align="center"><img alt="openapi-client-axios" src="https://github.com/anttiviljami/openapi-client-axios/raw/master/header.png?raw=true" style="max-width:50rem"></h1> | ||
## Generating type files (.d.ts) | ||
## Typesafe Clients | ||
![TypeScript IntelliSense](https://github.com/anttiviljami/openapi-client-axios/blob/master/packages/typegen/intellisense.gif) | ||
`openapi-client-axios` comes with a tool called `typegen` to generate typescript type files (.d.ts) for | ||
OpenAPIClient instances using an OpenAPI definition file. | ||
`openapi-client-axios` comes with a CLI command `openapicmd typegen` to generate Typescript types for type safety and code autocomplete. | ||
``` | ||
$ npm install -g openapi-client-axios-typegen | ||
npx openapicmd typegen ./openapi.yaml > src/types/openapi.d.ts | ||
``` | ||
``` | ||
Usage: typegen [file] | ||
Options: | ||
--help Show help [boolean] | ||
--version Show version number [boolean] | ||
Examples: | ||
typegen ./openapi.yml > client.d.ts - generate a type definition file | ||
``` | ||
The output of `typegen` exports a type called `Client`, which can be used for instances created with `OpenAPIClientAxios`. | ||
@@ -207,7 +195,7 @@ | ||
`typegen` supports using both local and remote URLs for OpenAPI definition files. | ||
`openapicmd typegen` supports using both local and remote URLs for OpenAPI definition files. | ||
``` | ||
$ typegen ./petstore.yaml | ||
$ typegen https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml | ||
$ npx openapicmd typegen ./petstore.yaml | ||
$ npx openapicmd typegen https://petstore3.swagger.io/api/v3/openapi.json | ||
``` | ||
@@ -214,0 +202,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70562
204