openapi-client-axios
Advanced tools
Comparing version 3.0.0 to 3.0.1
{ | ||
"name": "openapi-client-axios", | ||
"description": "JavaScript client library for consuming OpenAPI-enabled APIs with axios", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"author": "Viljami Kuosmanen <viljami@avoinsorsa.fi>", | ||
@@ -35,2 +35,3 @@ "license": "MIT", | ||
"**/*.d.ts", | ||
"bin/*", | ||
"!*.test.*", | ||
@@ -37,0 +38,0 @@ "!**/*.test.*", |
@@ -79,3 +79,3 @@ # OpenAPI Client Axios | ||
Alternatively, you can explicitly specify parameters in array form. This method allows you to set custom parameters not defined | ||
Alternatively, you can explicitly specify parameters in array form. This method allows you to set custom parameters not defined | ||
in the OpenAPI spec. | ||
@@ -124,8 +124,14 @@ | ||
## Generating types for clients | ||
## Generating type files (.d.ts) | ||
`openapi-client-axios` comes with a tool called `typegen` to generate typescript type files (.d.ts) for | ||
OpenAPIClient instances using an OpenAPI definition. | ||
![TypeScript IntelliSense](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. | ||
``` | ||
$ npm install -g openapi-client-axios | ||
``` | ||
``` | ||
Usage: typegen [file] | ||
@@ -143,8 +149,2 @@ | ||
```typescript | ||
import { Client } from './client.d.ts'; | ||
const client = await api.init<Client>(); | ||
``` | ||
Both the `api.getClient()` and `api.init()` methods support passing in a Client type. | ||
@@ -159,2 +159,9 @@ | ||
`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 | ||
```` | ||
## Contributing | ||
@@ -161,0 +168,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
49137
14
169
0