You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the encore:"optional" and generating a client, the field is marked as field?: type. However, this typing is only correct when omitempty is included in the json tag.
Sometimes you actually don't want to add an omitempty, for example if you want to convey that there is a field here, but it just has no value.
When using the
encore:"optional"
and generating a client, the field is marked asfield?: type
. However, this typing is only correct whenomitempty
is included in the json tag.Sometimes you actually don't want to add an
omitempty
, for example if you want to convey that there is a field here, but it just has no value.For example, take this simple endpoint:
When generating a TypeScript client, the type of
HelloResponse
isHowever, when actually calling the endpoint and parsing it in JavaScript, the response you get is
which actually matches to the type
The text was updated successfully, but these errors were encountered: