-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
final fields are not written during serialization #891
Comments
This is by design. We only "round-trip" values that can be provided when we create the value. You can always wrap the generated value and add in the final value. See #274 |
@kevmoo is there any reasoning for this? it is very strange that explicitly saying that I want to serialize something does nothing. At very least codegen should throw an error if this is the case. Explicit stuff cannot be simply ignored, it took me some time to find why API calls where not working because of this. |
This is bizarre... we have a type, we need to write it into our payload so the server knows what class this is. I don't understand the rationale.
This is the elegant approach, not being able to do this leads to a can of worms... we can't be Why not at least give us |
I'll reopen this issue. PR's are welcome! |
This sounds crazy. Are you saying this won't work: I haven't tried json_serializable yet, I'm looking for a replacement for simple_json (which is the best, but not being updated) I can't have finals? class AnnotationModel { final String containerId; |
Source code
Generated code:
Actual result
vars are written, finals are not
Expected result
all fields must be written - vars and finals
Versions
The text was updated successfully, but these errors were encountered: