Comments (6)
For those who find this and wonder "how", @JsonSerializable(explicitToJson: true) is the magic. Without the explicitToJson it won't call .toJson() recursively:
https://pub.dev/documentation/json_annotation/latest/json_annotation/JsonSerializable/explicitToJson.html
from json_serializable.
How can this still not be addressed?
from json_serializable.
How can this still not be addressed?
We have not received a pull request fixing it yet. This package is supported at a "best effort" level.
from json_serializable.
And honestly, I'm not sure what it means any more...
from json_serializable.
I believe it IS fixed!
from json_serializable.
Yup! This setup is designed for https://api.dart.dev/stable/2.17.3/dart-convert/jsonEncode.html and friends which call toJson
for you.
Interesting note: this is a dynamic invocation, which we'd like to avoid in many cases. So I may change this behavior in the future. We'll see...
from json_serializable.
Related Issues (20)
- Generated converters do not work HOT 1
- JsonKey name is ignored HOT 2
- JsonKey name is ignored
- Map<String, dynamic> can't be assigned to Object HOT 1
- Enum w/ custom toJson as a Map key...is broken HOT 2
- Can't create constructor with required nullable property and ignored in to/from json HOT 1
- Future data serialisation HOT 2
- Generated code should use a string uri to point at the library it is a part of HOT 4
- [Suggestion] Add a project wide option and a @JsonKey option to customize how far to parse DateTime HOT 9
- [Question/Feature Request?] Support generics serialization from parent HOT 3
- [problem] Dart program generated by json_annotation fails analyze check HOT 2
- Dynamic parsing with the help of an additional type parameter HOT 2
- Serialize/deserialize positional records as lists HOT 10
- How to generate code for specific files HOT 5
- FromJson generated function violates strict-raw-types language rule HOT 3
- Serialize a custom high-precision type as a json number (without quotes) HOT 1
- [Feature Request] Generate `fromJson`, `toJson` from typedef of `Records` types HOT 1
- Getting a null error when converting from Firebase a complex object, how to debug? HOT 1
- I get an error when I run flutter pub run build_runner build for the second time HOT 1
- BUG - 'includeFromJson : false' also excludes from ToJson. HOT 1
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 json_serializable.