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
Well, actually it is really weird feature request since, AFAIK, every property in TS can be set to null - you do not need something special for that. ? with field actually means that field may be omitted when instantiating value of type.
From documentation:
These optional properties are popular when creating patterns like “option bags” where you pass an object to a function that only has a couple of properties filled in.
So .NET Nullable<> has different semantics since it has value/reference types separation. As result, some people insist that C# nullable properties must not be translated into TS optional properties, other people insist that they must.
In conclusion, I have decided to add AutoOptionalProperties parameter to [TsGlobal]/fluent configuration in order to satisfy both sides. If you want nullables to be translated into TS optionals, just turn AutoOptionalProperties on. By default it is off.
I have the same problem as in issue #49, though with
TsInterface
annotated classes. I'm using .NET Core 2.1 with Reinforced Typings version 1.4.95.Every nullable property (e.g.
bool?
) will not be exported as optional and I have to explicitly add[TsProperty(ForceNullable = true)]
.Reinforced Typings configuration (no fluent configuration):
with
RtTargetFile
and<RtDisable>false</RtDisable>
project properties.The text was updated successfully, but these errors were encountered: