@qdrant/openapi-typescript-fetch
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -73,3 +73,3 @@ export declare type Method = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'head' | 'options'; | ||
parameters: { | ||
query: infer Q; | ||
query?: infer Q; | ||
}; | ||
@@ -76,0 +76,0 @@ } ? _CreateFetch<OP, { |
{ | ||
"name": "@qdrant/openapi-typescript-fetch", | ||
"description": "A typed fetch client for openapi-typescript", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"engines": { | ||
@@ -6,0 +6,0 @@ "node": ">=12.0.0", |
@@ -1,7 +0,6 @@ | ||
[![version(scoped)](https://img.shields.io/npm/v/openapi-typescript-fetch.svg)](https://www.npmjs.com/package/openapi-typescript-fetch) | ||
[![codecov](https://codecov.io/gh/ajaishankar/openapi-typescript-fetch/branch/main/graph/badge.svg?token=Z8GQ6M5KAR)](https://codecov.io/gh/ajaishankar/openapi-typescript-fetch) | ||
[![version(scoped)](https://img.shields.io/npm/v/openapi-typescript-fetch.svg)](https://www.npmjs.com/package/@qdrant/openapi-typescript-fetch) | ||
# 📘️ openapi-typescript-fetch | ||
A typed fetch client for [openapi-typescript](https://github.com/drwpow/openapi-typescript) | ||
A typed fetch client for [openapi-typescript](https://github.com/drwpow/openapi-typescript) | ||
@@ -13,3 +12,5 @@ ### Install | ||
``` | ||
Or | ||
```bash | ||
@@ -90,3 +91,3 @@ yarn add openapi-typescript-fetch | ||
if (e instanceof addPet.Error) { | ||
// get discriminated union { status, data } | ||
// get discriminated union { status, data } | ||
const error = e.getActualType() | ||
@@ -135,2 +136,3 @@ if (error.status === 400) { | ||
Node CommonJS setup | ||
```ts | ||
@@ -178,3 +180,6 @@ // install node-fetch v2 | ||
const findPetsByStatus = fetcher.path('/pet/findByStatus').method('get').create() | ||
const findPetsByStatus = fetcher | ||
.path('/pet/findByStatus') | ||
.method('get') | ||
.create() | ||
@@ -191,8 +196,7 @@ type Arg = FetchArgType<typeof findPetsByStatus> | ||
```ts | ||
const body = arrayRequestBody([{ item: 1 }], { param: 2 }) | ||
const body = arrayRequestBody([{ item: 1}], { param: 2}) | ||
// body type is { item: number }[] & { param: number } | ||
``` | ||
Happy fetching! 👍 | ||
Happy fetching! 👍 |
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
198
37116