-
Notifications
You must be signed in to change notification settings - Fork 184
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
Record list serialization unexpectedly converted to a map by StandardJsonPlugin. #1295
Comments
A
I think you will need to use |
This is not going to work. Returning ['wireName', ['element1', 'element2']] from the serializer will result in {
"wireName": [
"element1",
"element2"
]
} which is not the desired plain list [
"element1",
"element2"
] One would need to provide a list of root types that are ignored by the StandartJsonPligin (similar to how it already ignores BuiltList, BuiltSet and JsonObject). Are you willing to support such a use case or do we need to write our own JsonPlugin handling this functionality? |
Does it work for you to do something in
defaults to It's not obvious to me that this will work 100%, since it was never intended to allow a serializer that sometimes returns an int and sometimes returns a list. That said I notice now that this is already how |
Yes this does work (with the above PrimitiveSerializer), |
Yes please :) |
Hi there,
I hope y'all had calm holidays and a good start into 2024.
Problem:
I'm trying to serialize a record with a list into a json list. Unfortunately the
StandardJsonPlugin
is converting this record into a json map.I have the following scenario:
The registered serializer looks like this:
Cause:
The issue lies in this part of the
StandardJsonPlugin
. Is there any easy way to mitigate this?The text was updated successfully, but these errors were encountered: