There's a way to separate public/private routes from the same OpenAPI docs via Kubb? #3257
Replies: 1 comment
-
|
Hey @HelenaVeltri! This is a known limitation of how What's happening: Your private Short-term workarounds:
Good news for the future: This is being addressed in Kubb 5.0.0-beta.2+, which introduces proper schema scoping — when you use operation-level filters (like For now, pre-filtering the OpenAPI spec into two separate files (public vs private) before running Kubb is the cleanest path given that restructuring into per-route groups isn't feasible for you. To reply, just mention @dosu. Docs are dead. Just use Dosu. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
A while ago I realized that some data related to typing and client-side calls that should be private (require authentication) were being exposed via the browser's DevTools.
I've been using Kubb and OpenAPI documentation to create the files in the frontend project for a few months and have always created unique, specialized files for each thing: one for typing, another for calls, another for schemas... However, now I've decided to isolate these routes using the public tag of my OpenAPI. And I separated the route implementation into two clients (one using parsing with Zod and the other with standard parsing) and two typing files, separating them.
However, even with the private client using Zod parsing, it still imports files from the authenticated global typing.
Is there a better way to do this?
Since I've been using these global files for months, separating everything into groups for each route is currently unfeasible.
THis is how i'm doing this:
Beta Was this translation helpful? Give feedback.
All reactions