Releases: christoph-fricke/openapi-msw
Releases · christoph-fricke/openapi-msw
v0.1.2
Patch Changes
-
#17
2931f0c
Thanks @christoph-fricke! - Fixed OpenAPI operations with no-content responses cannot return a response. Now they are required to return an empty response, i.e.null
as response body.const http = createOpenApiHttp<paths>(); // Resolver function is required to return a `StrictResponse<null>` (empty response) // if the OpenAPI operation specifies `content?: never` for the response. const noContent = http.delete("/resource", ({ params }) => { return HttpResponse.json(null, { status: 204 }); });
v0.1.1
Patch Changes
- #12
96ce15c
Thanks @christoph-fricke! - Add legacy entrypoint definitions (types, module) for tools and bundlers that do not understand package.json#exports fields.
v0.1.0
Minor Changes
-
#9
6364870
Thanks @christoph-fricke! - Added installation and complete usage guide to the documentation. -
#5
d15a0c2
Thanks @christoph-fricke! - AddedcreateOpenApiHttp(...)
to create a thin, type-safe wrapper around MSW'shttp
that uses openapi-tspaths
:import type { paths } from "./openapi-ts-definitions"; const http = createOpenApiHttp<paths>(); // Define handlers with fully typed paths, path params, and request/response bodies const handler = http.get("/pets/{id}", () => { /* ... */ }); // Fallback to default http implementation const catchAll = http.untyped.all("*", () => { /* ... */ });