Category "gson"

How to make GSON fail on unknown properties

I need GSON mapper to throw an exception if json contains unknown fields. For example if we have POJO like public class MyClass { String name; } and json l

Java 17 | Need Help to update to Gson 2.9.0 and disableJdkUnsafe

I'm trying to Update my Gson version to 2.9.0 and disableJdkUnsafe, Can I get help with below error. This is from a broken test when I updated my GsonBuilder. T

Java application for sorting and selecting

I need to develop a simple application for sorting and selecting data according to predefined rules. The application must be able to work with JSON lists of obj

How to modify values of JsonObject

I want to add a new field to jsonObject and this new field's name will be based on a value of another field. To be clear, this an examples of what I want to ach

How to modify values of JsonObject

I want to add a new field to jsonObject and this new field's name will be based on a value of another field. To be clear, this an examples of what I want to ach

Gson.toJson object contain URL

I am using Gson.toJSON method. My pojo contains one of attribute as URL string. Strange thing is Gson converter changes URL characters output is: /myApp/myAct

How to unrealize a json using GSON? Get an error

The structure of the json that I have stored in a string is: { "0": { "PDate": "2019-02-25 00:00:00.0000000", "DDate": "2019-06-25 00:00:00.000