ts-proto
ts-proto copied to clipboard
Should deprecated fields be optional?
Given the message:
message Amount {
Currency currency = 1;
int64 old_value = 2 [deprecated = true];
double value = 3;
}
ts-proto generates:
export interface Amount {
currency: Currency;
/** @deprecated */
oldValue: number;
value: number;
}
But wouldn't it be a lot nicer if oldValue
was defined as oldValue?: number
?
That seems reasonable; if you want to try adding that check here, we could see what happens:
https://github.com/stephenh/ts-proto/blob/main/src/types.ts#L356
@husseinhere this issue/feature request should be addressed by https://github.com/stephenh/ts-proto/pull/1010 now
Closing this out thanks to #1010, thank you @tufandevrim !