Most voted "gson" questions
Gson is a Java library that can be used to convert Java objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object. Gson can work with arbitrary Java objects including pre-existing objects that you don’t have the source code for. If the question is not about "GSON", do not use this tag, even if you are using "GSON" in your project.
Learn more…67 questions
Sort by count of
-
0
votes1
answer630
viewsHibernate self relationship transforming into json breaks
I am using Hibernate to persist the objects in an embedded HSQLDB file. I have created a method similar to a "Tester" to popular and seek the persistent information. But when I search for the…
-
0
votes1
answer180
viewsGoogle Gson Problems: Unparseable date: "Apr 19, 1991"
I work with Google Gson to persist and recover Java objects. I use this code to create and format Gson, with the aim of preplanning it to receive certain date formats, which come from forms and the…
-
0
votes1
answer422
viewsGet specific value from a JSON JAVA URL
Good morning Friends. I’m having a hard time handling information collected in a third-party online JSON url, my APP needs information from various websites that send back different ways in JSON…
-
0
votes1
answer187
viewsConvert Gson to List<Object>
I’m starting to learn how to use the Gson library in my code and need to create a list of objects from a Json file. Json:…
-
0
votes0
answers81
viewsRead json with gson
I would like to read the JSON below with GSON, put each line in a POJO and add in one ArrayList. But I can’t read JSON.…
-
0
votes1
answer135
viewsHow to manipulate a Json Object before returning to the API
Hello I have this method in my controller: @GetMapping(value="/{id}/perfil", produces = MediaType.APPLICATION_JSON_VALUE) public String carregarPerfilUsuario(@PathVariable("id") Long id,…
-
0
votes2
answers320
viewsPOST using Retrofit is not returning to the Onresponse function
My application is made with Kotlin Retrofit and Gson. I have several gets to fetch information and work normally, manipulate the data returning in Onresponse and ok, works normally. But when I run…
-
0
votes1
answer110
viewsPass parameters on GET
I’m trying to do a GET to validate a user using Cpf and password,using DAO, but I’m not sure when to pass the parameter. Follow the get code private Usuario usuarioLogado; @GET…
-
0
votes1
answer121
viewsHTTP GET in JAVA with a different result than POSTMAN
I am running an HTTP Get Request in Java using Gson to use the data in my program, but the first and last attribute are coming as null. However, when performing the request in POSTMAN I saw that…
-
-1
votes1
answer528
views -
-1
votes1
answer111
viewsJava code error read GSON: java.lang.Nullpointerexception
I’m trying to read this file but when I run it shows this error: Exception in thread "main" java.lang.NullPointerException at principa.Main.main(Main.java:61) but I do not know what this null public…
-
-1
votes1
answer64
viewsQuery error for a JSON URL "getContentHandler, getContent"
I am starting the development of an app that performs queries to various websites with JSON return and treat this information in several ways. To test the Urls I use the code below, works well with…
-
-1
votes1
answer47
viewsPerformance JSON x Properties in Java
Good night. I used to use several files .properties to save the data from the desktop application I develop. I studied the possibility to exchange these files for files .json, because I see that…
-
-1
votes1
answer105
viewsread a series of json elements (gson)
Next, I’m trying to write a java method that reads a series of json objects using Gogle’s gson. It’s just not working. I don’t know if it’s my code or my file, they’re both down there: customer…
-
-2
votes1
answer109
viewsApp is closing, while consuming webservice
I have a problem in my application, when consuming a web service in Json, the application is closing. The idea of my application is I consume this web service to validate my email and password, and…
-
-2
votes1
answer62
viewsProblem picking up a GSON variable
I’m making an app that uses the google maps Directions api, which returns me a json, for example: { "geocoded_waypoints" : [ { "geocoder_status" : "OK", "place_id" : "ChIJeRLP8gx3GZURImtwaSWGJgY",…
-
-3
votes1
answer200
viewsReserved word as variable name
I’m building a program that integrates an online store with another program that controls the physical stock of a store. Communication is done through HTTP requests that respond in JSON format. In…