Minor Changes
-
#2226
1c66d88
Thanks @mrlubos! - feat(valibot): generate a single schema for requestsSingle Valibot schema per request
Previously, we generated a separate schema for each endpoint parameter and request body. In v0.76.0, a single request schema is generated for the whole endpoint. It may contain a request body, parameters, and headers.
const vData = v.object({ body: v.optional( v.object({ foo: v.optional(v.string()), bar: v.optional(v.union([v.number(), v.null()])), }), ), headers: v.optional(v.never()), path: v.object({ baz: v.string(), }), query: v.optional(v.never()), });
If you need to access individual fields, you can do so using the
.entries
API. For example, we can get the request body schema withvData.entries.body
.