openapi-ff 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +5 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -114,7 +114,11 @@ import { zodContract } from "@farfetched/zod";
114
114
 
115
115
  const { createApiEffectWithContract } = createClient(fetchClient, {
116
116
  createContract(method, path) {
117
- const { response } = (EndpointByMethod as any)[method][path];
117
+ const endpoints = EndpointByMethod[method] as any;
118
+ const response = endpoints[path]?.response;
119
+ if (!response) {
120
+ throw new Error(`Response schema for route "${method} ${path}" doesn't exist`);
121
+ }
118
122
  return zodContract(response);
119
123
  },
120
124
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-ff",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "test": "vitest run --typecheck",