Closed FredrikNoren closed 2 months ago
I quite often find myself in a spot where I want serde(default) so that old values can be de-serialized, but I don't want the typescript type of be optional. It would be amazing if there was a tsify(required) so that I could do this:
serde(default)
tsify(required)
#[tsify(required)] #[serde(default)] pub field: String;
which would produce the type:
{ field: string }
Or even better, I think I would prefer if #[serde(default)] wouldn't make the field optional in the first place.
#[serde(default)]
I quite often find myself in a spot where I want
serde(default)
so that old values can be de-serialized, but I don't want the typescript type of be optional. It would be amazing if there was atsify(required)
so that I could do this:which would produce the type:
Or even better, I think I would prefer if
#[serde(default)]
wouldn't make the field optional in the first place.