chronark / zod-bird

Fully typed Tinybird pipes using zod
MIT License
140 stars 13 forks source link

default values should be passed to Tinybird #5

Closed tobiaslins closed 9 months ago

tobiaslins commented 9 months ago

Currently when defining an endpoint like following

export const publishEvent = tb.buildIngestEndpoint({
  datasource: "events__v1",
  event: z.object({
    id: z.string(),
    metadata: z.string().optional().default(""),
  }),
});

and call it

publishEvent({ id: "123" })

Tinybird will reject it because the parsed value (with defaults) is not passed.

chronark commented 9 months ago

Fixed in https://github.com/chronark/zod-bird/releases/tag/v0.2.1