Closed ppoetsma closed 8 years ago
As far as I can see from the code it is supported except for booleans. Are you using the latest version? Otherwise can you provide some more details?
Anyway, the code you are interested is located here: https://github.com/mendix/RestServices/blob/master/javasource/restservices/util/JsonDeserializer.java#L169
Oops, I mean serialization; keep on mixing the two. We are on version 1.4.2 because we are still using Mx 5.8.1. Soon we will upgrade but it is hard to keep up. Per version 1.4.2 null values are allowed for deserialization but not serialization.
My app provides webservices but when an integer gets null this is the response: "Failed to serve POST
Hi @ppoetsma
This can be fixed by altering: https://github.com/mendix/RestServices/blob/master/javasource/restservices/util/JsonSerializer.java#L166 (put null instead of throw)
and to make sure the generated json schema also still match: https://github.com/mendix/RestServices/blob/master/javasource/restservices/util/JSONSchemaBuilder.java#L123 (basically, wrap orNull around the corresponding types)
(almost) published as part of the 2.0 release
Thanks!
Hi,
Deserializing JSON null values in enumerations and numbers (int, long, float, etc) is not supported. Why is that and can it be changed?
Regards, Paul