Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
v0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
drwpow committed May 1, 2023
1 parent 22197a1 commit a138f87
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 29 deletions.
5 changes: 0 additions & 5 deletions .changeset/honest-mayflies-listen.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/mean-nails-brush.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rare-adults-wait.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rotten-coats-dream.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/strange-chefs-mix.md

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# openapi-fetch

## 0.1.0

### Minor Changes

- f878cd3: Add querySerializer

### Patch Changes

- 22197a1: Add missing type defs for minified build
- ff3174a: Fix type inference bugs
- 4ce3828: Skip parsing JSON for empty responses (#23)
- ff3ae1b: Skip parsing JSON for 204 responses (#28)

## 0.0.8

### Patch Changes
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,9 @@ const { data, error } = await post('/create-post', {

Note in the `get()` example, the URL was actually `/post/{post_id}`, _not_ `/post/my-post`. The URL matched the OpenAPI schema definition rather than the final URL. This library will replace the path param correctly for you, automatically.

### Query Parameters
### 🔀 Parameter Serialization

To customise the query parameters serialization pass in a `querySerializer` function to any fetch
method (get, post, etc):
In the spirit of being lightweight, this library only uses [URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) to [serialize parameters](https://swagger.io/docs/specification/serialization/). So for complex query param types (e.g. arrays) you’ll need to provide your own `querySerializer()` method that transforms query params into a URL-safe string:

```ts
import createClient from 'openapi-fetch';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openapi-fetch",
"version": "0.0.8",
"version": "0.1.0",
"author": {
"name": "Drew Powers",
"email": "drew@pow.rs"
Expand Down
Empty file removed schema.ts
Empty file.

0 comments on commit a138f87

Please sign in to comment.