chronark / zod-bird

Fully typed Tinybird pipes using zod
MIT License
157 stars 14 forks source link

default values should be passed to Tinybird #5

Closed tobiaslins closed 1 year ago

tobiaslins commented 1 year 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 1 year ago

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