Monday, March 10, 2025

JSON.stringfy() doesn't preserve propery names

I'm trying to serialize an object using JSON.stringify(), however since the GWT complier shortens/obfuscates the property names, the resulting JSON has propery names like "a" and "b" instead of the original names, which means that the JSON can't be deserialized by the server because the property names don't match what it expects.

I've tried turning PRETTY style on for the GWT complier, but even then it seems to still change some property names.

Is there any way to tell the GWT compiler to exempt certain classes from obfuscation? Or some easy alternative way to serialize/deserialize JSON? I don't want to have to write a serializer code separately for each class.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/e0463f53-109d-4c73-95dd-d9c965a0a292n%40googlegroups.com.

No comments:

Post a Comment