I used the Google Gson API to create JSON. When I initialized JsonObject with:
JsonObject json = new JsonObject();
and print it out, it was actually {} .
I tried to exclude the "empty" JSON, i.e. tags {} that have not added any properties. But I could not find a method similar to isEmpty() in the Gson API.
How can I find out "empty" JSON with the Gson API?
source share