schultek / dart_mappable

Improved json serialization and data classes with full support for generics, inheritance, customization and more.
https://pub.dev/packages/dart_mappable
MIT License
153 stars 23 forks source link

`__type` being applied to nested objects even when includeTypeId is set false #199

Open AhmedLSayed9 opened 4 months ago

AhmedLSayed9 commented 4 months ago

Is there a way to avoid adding __type for the nested objects?

i.e I'm doing the following:

SomeMapper.ensureInitialized()
        .encodeJson(this, EncodingOptions(includeTypeId: false));

SomeMapper has nested objects which themselves should add the __type property in normal cases. However, I want to prevent SomeMapper and all nested objects from adding __type

schultek commented 3 months ago

Yes that should actually disable the __type property for all nested types. Could be a bug, I will look into it.