From 062ea5ef39af9db56ef79087f5952b140f1cbd7b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 19 Nov 2023 15:27:21 +0100 Subject: [PATCH] ci: release package (#32) Co-authored-by: github-actions[bot] --- .changeset/tame-eyes-complain.md | 15 --------------- CHANGELOG.md | 16 ++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 .changeset/tame-eyes-complain.md diff --git a/.changeset/tame-eyes-complain.md b/.changeset/tame-eyes-complain.md deleted file mode 100644 index c3eaa89..0000000 --- a/.changeset/tame-eyes-complain.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -"openapi-msw": patch ---- - -Fixed a type mismatch between path fragment types and the values provided at runtime, which are always strings. Now all path-fragments are typed as string. If a fragment's schema is a string constrained by an enum, the resulting string literals are preserved. This fixes bug [#22](https://github.com/christoph-fricke/openapi-msw/issues/22). - -```typescript -const handler = http.get("/resource/{id}", ({ params }) => { - // Previously calling "parseInt(...)" caused a type error - // when the schema type for "id" is defined as number. - const id = parseInt(params.id); - - return HttpResponse.json({ id }); -}); -``` diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a2b0d5..bc22a18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # openapi-msw +## 0.2.2 + +### Patch Changes + +- [#31](https://github.com/christoph-fricke/openapi-msw/pull/31) [`556dfca`](https://github.com/christoph-fricke/openapi-msw/commit/556dfca3a2c87eeec6f1f7acd2db63af52df2806) Thanks [@christoph-fricke](https://github.com/christoph-fricke)! - Fixed a type mismatch between path fragment types and the values provided at runtime, which are always strings. Now all path-fragments are typed as string. If a fragment's schema is a string constrained by an enum, the resulting string literals are preserved. This fixes bug [#22](https://github.com/christoph-fricke/openapi-msw/issues/22). + + ```typescript + const handler = http.get("/resource/{id}", ({ params }) => { + // Previously calling "parseInt(...)" caused a type error + // when the schema type for "id" is defined as number. + const id = parseInt(params.id); + + return HttpResponse.json({ id }); + }); + ``` + ## 0.2.1 ### Patch Changes diff --git a/package-lock.json b/package-lock.json index c5e25d6..2d353cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "openapi-msw", - "version": "0.2.1", + "version": "0.2.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "openapi-msw", - "version": "0.2.1", + "version": "0.2.2", "license": "MIT", "dependencies": { "openapi-typescript-helpers": "^0.0.4" diff --git a/package.json b/package.json index 25b24a8..19d69b9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "$schema": "https://json.schemastore.org/package.json", "name": "openapi-msw", "type": "module", - "version": "0.2.1", + "version": "0.2.2", "license": "MIT", "author": "Christoph Fricke ", "description": "Tiny, type-safe wrapper around MSW for type inference from OpenAPI schemas.",