Closed MalpenZibo closed 7 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
openapi-zod-client | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jan 18, 2024 2:58pm |
hey, sorry this library is already bloated with a thousand options and edge-cases, I'd rather not add one more
you can probably use the endpointDefinitionRefiner
https://github.com/astahmer/openapi-zod-client/blob/main/lib/src/template-context.ts#L369C2-L376C37 from https://github.com/astahmer/openapi-zod-client/issues/173 for your specific use-case
if not, I guess you could create a callback to edit the resulting zod schema (and another one for TS types) so that you can refine it to your needs (and everyone could just hook into it to fit their specific needs as well), but I think the current endpointDefinitionRefiner
already allows that
This PR adds
zod
brand feature support.It's very useful when dealing with IDs.
For example
In this and other cases, it could be useful to get as an input parameter something like
z.string().uuid().brand("EntityId")
.With this change, we could add to our
openapi-spec
the propertyx-brand
to achieve this.