You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<summary><ahref="https://www.npmjs.com/package/openapi-typescript-fetch"target="_blank"rel="noreferrer">openapi-typescript-fetch</a> by <ahref="https://github.com/ajaishankar"target="_blank"rel="noreferrer">@ajaishankar</a></summary>
awaitupdateBlogPost({ body: { title: 'My New Post' } });
71
+
} catch (error) {
72
+
console.error('Error:', error);
73
+
}
74
+
```
75
+
76
+
:::
77
+
78
+
</details>
79
+
80
+
<details>
81
+
<summary><ahref="https://www.npmjs.com/package/feature-fetch"target="_blank"rel="noreferrer">feature-fetch</a> by <ahref="https://github.com/builder-group"target="_blank"rel="noreferrer">builder.group</a></summary>
@@ -60,6 +187,108 @@ TypeChecking in server environments can be tricky, as you’re often querying da
60
187
61
188
:::
62
189
190
+
## Hono with [`@blgc/openapi-router`](https://github.com/builder-group/community/tree/develop/packages/openapi-router)
191
+
192
+
Instead of manually typing each route with generics as in the [Hono example](#hono), [`@blgc/openapi-router`](https://github.com/builder-group/community/tree/develop/packages/openapi-router) wraps around the [Hono router](https://hono.dev/docs/api/routing) to deliver full typesafety and enforce your OpenAPI-Schema with validators.
193
+
194
+
::: tip Good To Know
195
+
196
+
While TypeScript types ensure compile-time safety, they don't enforce runtime schema validation. For runtime compliance, you need to integrate with validation libraries like Zod or Valibot. Although you must define the validation rules manually, they are type-safe to ensure these rules are correctly defined.
## Express with [`@blgc/openapi-router`](https://github.com/builder-group/community/tree/develop/packages/openapi-router)
242
+
243
+
[`@blgc/openapi-router`](https://github.com/builder-group/community/tree/develop/packages/openapi-router) wraps around the [Express router](https://expressjs.com/en/5x/api.html#router) to deliver full typesafety and enforce your OpenAPI-Schema with validators.
244
+
245
+
::: tip Good To Know
246
+
247
+
While TypeScript types ensure compile-time safety, they don't enforce runtime schema validation. For runtime compliance, you need to integrate with validation libraries like Zod or Valibot. Although you must define the validation rules manually, they are type-safe to ensure these rules are correctly defined.
If you are using [Mock Service Worker (MSW)](https://mswjs.io) to define your API mocks, you can use a **small, automatically-typed wrapper** around MSW, which enables you to address conflicts in your API mocks easily when your OpenAPI specification changes. Ultimately, you can have the same level of confidence in your application's API client **and** API mocks.
0 commit comments