Comments (2)
Hey Niklas,
Suggested solution has been implemented. Please consult the unit tests on how to resolve your use case.
btw, thank you for feedback and really useful edge cases.
from dart-json-mapper.
Hello @k-paxian,
man, you're faster than light! 🥇
But I have one question left, would something like this also be possible?
@jsonSerializable
class CEO<TBusiness extends Business> {
TBusiness business;
String fullName;
CEO(this.fullName, this.business);
}
test(
"Should dump typeName to json property when"
" @JsonSerializable(includeTypeName: true)", () {
// given
final john = CEO<Startup>("John", Startup(10));
// when
final String json = JsonMapper.serialize(john);
final CEO<Business> target = JsonMapper.deserialize(json);
// then
expect(target.business, TypeMatcher<Startup>());
});
Thanks,
Niklas
from dart-json-mapper.
Related Issues (20)
- Flutter Json Mapper (json_mapper) is failing to deserialize Enum HOT 1
- Cannot deserialize to a class with a constructor that takes an enum HOT 4
- Can't add sources to `build.yaml` using `flutter_translate_annotations` package HOT 7
- ignoreNullMembers seems to break the deserialization HOT 2
- Problem converting enum with following uppercase character HOT 9
- Adapter for https://pub.dev/packages/fast_immutable_collections
- `main.mapper.g.dart` is not generating all `@jsonSerializable` classes HOT 6
- `JsonMapper.copyWith` doesn't respect deep merge
- Parsing error when building for web HOT 9
- Improve class instance creation error handling HOT 4
- Problem converting enum with following uppercase character - second edition :) HOT 10
- Omit serializing optional fields HOT 14
- Issues with deserialising Color HOT 3
- Dart Json Mapper looks like don't generate valueDecorators when models in different package HOT 1
- Default discriminatorValue may not work. HOT 4
- Using with Retrofit HOT 2
- Serialize generic type. HOT 1
- @Json takes no effect even if put on top class & processAnnotatedMembersOnly in option will ignore all members when serialization HOT 1
- Empty Reflectable file - regarding HOT 1
- dart_json_mapper 2.2.10 depends on analyzer ^5.4.0 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart-json-mapper.