Skip to content
sneppets

sneppets

  • Privacy
sneppets-java8

Error: Expected BEGIN_OBJECT but was STRING at line 1 column 1

February 12, 2020February 12, 2020 Editorial Staff4 Comments on Error: Expected BEGIN_OBJECT but was STRING at line 1 column 1

Are you getting error “Expected BEGIN_OBJECT but was STRING at line 1 column 1” while parsing Json String to Json Object using Google gson library ?

Java gson, java, json

Convert JSON string to JsonObject using Google Gson

November 14, 2019 Editorial StaffLeave a Comment on Convert JSON string to JsonObject using Google Gson

It is very common that Java web services receives JSON string. If you wanted to convert JSON string to Jsonobject using Google Gson then there are two ways to achieve this. JSON string to JsonObject Example Google Gson is a… Read More!

Java gson, JsonObject

Check if key exists in jsonobject before fetching value for that key ?

November 12, 2019November 14, 2019 Editorial StaffLeave a Comment on Check if key exists in jsonobject before fetching value for that key ?

When you deal with json object you may want to check whether key exists in the jsonobject before fetching value for that key. We can easily check using Google gson JsonObject has() method. has() method – Class JsonObject This is… Read More!

Java gson, json
Copyright © 2018 Sneppets. All Rights Reserved