Questions tagged [jsonparser]

Questions concerned with parsing JSON files using either built-in, third-party or custom built JSON parsers. Questions about implementing JSON parsers are valid too.

Questions concerned with parsing JSON files using either built-in, third-party or custom built JSON parsers. Questions about implementing JSON parsers are valid too.

607 questions
61
votes
2 answers

JsonParser is deprecated

Getting deprecated message for JsonParser for Spring Boot app, JsonObject jsonObject = new JsonParser().parse(result).getAsJsonObject(); What is the alternative?
Sazzad Hissain Khan
  • 37,929
  • 33
  • 189
  • 256
51
votes
7 answers

'Newtonsoft.Json' already has a dependency defined for 'Microsoft.CSharp'

I'm installing NewtonSoft.Json for parsing Json in .NET application. When I'm using Visual Studio(VS) 2012, it can not be installed via NuGet. This is the error I have got: 'Newtonsoft.Json' already has a dependency defined for…
Vin.X
  • 4,759
  • 3
  • 28
  • 35
26
votes
1 answer

Parsing JSON on Jenkins Pipeline (groovy)

I created a method as shown online: @NonCPS def parseJsonString(String jsonString) { def lazyMap = new JsonSlurper().parseText(jsonString) // JsonSlurper returns a non-serializable LazyMap, so copy it into a regular map before returning …
Katone Vi
  • 1,010
  • 1
  • 8
  • 12
12
votes
4 answers

How to parse a small JSON file with jsmn on an embedded system?

I need to parse a small JSON file on an embedded system (only 10K RAM/flash). The JSON is: { "data1":[1,2,3,4,5,6,7,8,9], "data2":[ [3,4,5,6,1], [8,4,5,6,1], [10,4,5,3,61], [3,4,5,6,1], [3,4,5,6,1], [3,4,5,6,1]…
Vincent Zhou
  • 503
  • 1
  • 6
  • 17
8
votes
5 answers

Create CSV from XML/Json using Python Pandas

I am trying to parse to an xml into multiple different Files - Sample XML
Rafa
  • 487
  • 7
  • 22
6
votes
1 answer

How to parse polymorphic objects in Kotlin using Moshi

Currently having an issue with PolymorphicJsonAdapterFactory and Kotlins sealed class. I have an API that that returns polymorphic home components and I am trying to parse and create polymorphic object using Moshi in Kotlin but I getting following…
user1288005
  • 890
  • 2
  • 16
  • 36
5
votes
4 answers

Parse Json without quotes in Python

I am trying to parse JSON input as string in Python, not able to parse as list or dict since the JSON input is not in a proper format (Due to limitations in the middleware can't do much here.) { "Records": "{Output=[{_fields=[{Entity=ABC ,…
Ankit Singh
  • 57
  • 1
  • 3
5
votes
1 answer

Parsing an exception instead of List of entities is not working, when using TestRestTemplate and MockRestServiceServer

I have a simple controller (CODE) @RestController @RequestMapping("/profiles" , produces = [MediaType.APPLICATION_JSON_VALUE]) class Controller(@Autowired val restClient: RestClient) { @GetMapping("/simple-get") fun simpleGetCall():…
Joergi
  • 1,527
  • 3
  • 39
  • 82
5
votes
1 answer

Can't parse Json String with Moshi

I'm trying to parse a Json response with Moshi, the problem that I have is that the value of the key is a Json wrap on a String: {"mobile_accounts_account_showProperties":"[{\"name\": \"current\"},{\"name\": \"available\"}]"} This is my…
5
votes
3 answers

how to escape special character colon (':') in jsonpath

Json: { "im:rating": { "label": "1" } } While trying to use Jsonpath in groovy If i am using this '$.im:rating' It is showing following error Caused by: com.nebhale.jsonpath.InvalidJsonPathExpressionException: Illegal character…
kaushik
  • 556
  • 1
  • 7
  • 22
4
votes
1 answer

Json Parse Error - MismatchedInputException expecting array or string for LocalDate in Spring Boot

I have 2 microservices which communicate via REST call. I have an Entity named Consumer which has various fields including a LocalDate. When i pass this entity via REST call, i get the following exception Json parse error expected array or…
VinodKhade
  • 147
  • 1
  • 2
  • 10
4
votes
2 answers

Why JsonParser gives double quotes in the return value, using com.google.gson API

I am currently using JsonObject and JsonParser of com.google.gson api (using gson-2.8.5 version) to parse and read the value form input JSON. I have JSON filed like , smaple "resultCode":"SUCCESS", when I try to read the same value from json it…
Gautam
  • 3,707
  • 5
  • 36
  • 57
4
votes
1 answer

Read Json file in JAVA with io.vertx.core.json library

I want to read .json file in java and typecast it to JsonObject.Please suggest the code with Json but not JSON.I am using io.vertx.core.json.JsonObject library . Object obj = parser.parse(new FileReader()); //this is from library…
ammy
  • 306
  • 1
  • 6
  • 23
4
votes
2 answers

How to get raw JSON text from Unirest response in Java

I'm trying to send a POST request to a server, get the response, and parse it (it is a JSON file). I am using Unirest for my POST request, simply as below: HttpResponse response = Unirest …
Tina J
  • 4,983
  • 13
  • 59
  • 125
4
votes
1 answer

Django Rest Framework + Postman + JSON parse error

I created a Django Api. I used rest_framework.generics.CreateAPIView to post. It works well in default browser. But When i use Postman it throws a error. views.py class AuthorCreateAPIView(CreateAPIView): queryset = Author.objects.all() …
1
2 3
40 41