encore icon indicating copy to clipboard operation
encore copied to clipboard

TypeScript client codegen: generate | null for optional pointer fields

Open ravilamichhane opened this issue 4 months ago • 2 comments

when encore generates typescript types for web clients, pointer fields (e.g. *string) marked as optional are currently generated as field?: string. since these fields can be nil in go (→ null in json), it will be more type safe if the generated type instead be field?: string | null.

ravilamichhane avatar Oct 25 '25 08:10 ravilamichhane

agree with that, field?: string | null is correct format

ctzaruba avatar Nov 20 '25 07:11 ctzaruba

This will be addressed in #2163

fredr avatar Nov 26 '25 08:11 fredr