Skip to content

Commit da2d8a5

Browse files
committed
Multiple improvements
1 parent 3a4f410 commit da2d8a5

File tree

9 files changed

+560
-403
lines changed

9 files changed

+560
-403
lines changed

.changeset/beige-ligers-hunt.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-fetch": patch
3+
---
4+
5+
Clone response internally

.changeset/khaki-bobcats-shave.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-fetch": minor
3+
---
4+
5+
Expose createFinalURL() logic for testing

.changeset/khaki-cycles-cough.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-fetch": minor
3+
---
4+
5+
Automatically remove `undefined` and `null` query params without requiring querySerializer

.changeset/long-llamas-attend.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-fetch": patch
3+
---
4+
5+
Strip trailing slashes from baseUrl

.changeset/mighty-dots-hammer.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-fetch": patch
3+
---
4+
5+
Fix querySerializer typing

.changeset/rude-bikes-happen.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-fetch": minor
3+
---
4+
5+
Allow overriding of JSON body parsing

docs/src/content/docs/openapi-fetch/api.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ const { get, put, post, del, options, head, patch, trace } = createClient<paths>
2727
const { data, error, response } = await get("/my-url", options);
2828
```
2929

30-
| Name | Type | Description |
31-
| :---------------- | :-----------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32-
| `params` | ParamsObject | Provide `path` and `query` params from the OpenAPI schema |
33-
| `params.path` | `{ [name]: value }` | Provide all `path` params (params that are part of the URL) |
34-
| `params.query` | `{ [name]: value }` | Provide all `query params (params that are part of the <a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams" target="_blank" rel="noopener noreferrer">searchParams</a> |
35-
| `body` | `{ [name]:value }` | The <a href="https://spec.openapis.org/oas/latest.html#request-body-object" target="_blank" rel="noopener noreferrer">requestBody</a> data, if needed (PUT/POST/PATCH/DEL only) |
36-
| `querySerializer` | QuerySerializer | (optional) Override default param serialization (see [Parameter Serialization](#parameter-serialization)) |
37-
| (Fetch options) | | Any valid fetch option (`headers`, `mode`, `cache`, `signal` …) (<a href="https://developer.mozilla.org/en-US/docs/Web/API/fetch#options" target="_blank" rel="noopener noreferrer">docs</a>) |
30+
| Name | Type | Description |
31+
| :---------------- | :-------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32+
| `params` | ParamsObject | Provide `path` and `query` params from the OpenAPI schema |
33+
| `params.path` | `{ [name]: value }` | Provide all `path` params (params that are part of the URL) |
34+
| `params.query` | `{ [name]: value }` | Provide all `query params (params that are part of the <a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams" target="_blank" rel="noopener noreferrer">searchParams</a> |
35+
| `body` | `{ [name]:value }` | The <a href="https://spec.openapis.org/oas/latest.html#request-body-object" target="_blank" rel="noopener noreferrer">requestBody</a> data, if needed (PUT/POST/PATCH/DEL only) |
36+
| `querySerializer` | QuerySerializer | (optional) Override default param serialization (see [Parameter Serialization](#parameter-serialization)) |
37+
| `parseAs` | `"json" \| "arrayBuffer" \| "blob" \| "text"` | Decide how to parse the response body (default: `"json"`) |
38+
| (Fetch options) | | Any valid fetch option (`headers`, `mode`, `cache`, `signal` …) (<a href="https://developer.mozilla.org/en-US/docs/Web/API/fetch#options" target="_blank" rel="noopener noreferrer">docs</a>) |
3839

3940
### Parameter Serialization
4041

0 commit comments

Comments
 (0)