Questions tagged [fromjson]

The fromjson tag should be used in connection with the interpretation of a JSON string as a stringified representation of an arbitrary JSON entity, e.g. "1" as the number 1.

fromjson as a function would convert a JSON string representing an arbitrary JSON document to the corresponding JSON value, e.g "1" to the number 1, "[1]" to the array [1], and so on.

49 questions
2
votes
1 answer

How to iterate through nested dynamic JSON file in Flutter

So I have two JSON files with different fields. { "password": { "length": 5, "reset": true}, } "dataSettings": { "enabled": true, "algorithm": { "djikstra": true }, "country": { "states": {"USA": true, "Romania": false}} } I want to…
osstackerf
  • 23
  • 3
2
votes
2 answers

Use jq to interpret nested JSON in JSON

I'm looking to use jq to automatically resolve any field which contains json as json, example: Input { "guaranteedPrizes": "[]", } Output { "guaranteedPrizes": [], }
M. Christopher
  • 305
  • 3
  • 14
2
votes
1 answer

Get the whole List as Json from a List in R

Hello So I am using get request to github api: commitsPublic <- GET("https:///api/v3/search/commits? q=is:public+org:", add_headers(Authorization= "token ", Accept=…
Alex Rika
  • 141
  • 2
  • 14
2
votes
1 answer

Gson.fromJson(json, Custom.class) empty string

i'm developing a small web application. That's my problem: This is executed when a user try to add a new record in my Datatable @RequestMapping(value="/saveJokerRule", method= RequestMethod.POST, consumes= "application/json", produces =…
Daniele
  • 93
  • 6
1
vote
1 answer

Flutter Map or .fromJson of my not working

I have data response with api and i can't map it to List but it return users null, i think is not working because method fromJson this is data return with api and this is my models My controller end is Debug window Thanks for any answer
Otis
  • 156
  • 2
  • 11
1
vote
2 answers

Turn the json response of an httr GET into a dataframe in R

Hi I used the httr library to get some data from an API. Using this code URL <-…
Juan Lozano
  • 635
  • 1
  • 6
  • 17
1
vote
1 answer

How can I fix this Error: lexical error: invalid char in json text.?

Im trying to work with an API, application/json in R but when I use this code: data <- fromJSON(content(XXX, type = "text")) I see the next error Error: lexical error: invalid char in json text. Producto;IdCompra;VentaN; …
Clara
  • 111
  • 4
1
vote
1 answer

Fromjson returns no data in my Flutter App

i have a problem with "fromJson" in my program. I get my json data back from the server. But I can't save them in an array and return them to my screen. static Future?> getTasks() async { List infos= []; try{ …
Lowterm
  • 101
  • 7
1
vote
0 answers

Dart: List of generic class that implements fromJson function

I have an api which returns an entity of type Category which has the following implementation: class Category { final int id; final String title; Category({this.id, this.title}); factory Category.fromJson(Map json) => …
Gabi
  • 103
  • 3
  • 9
1
vote
0 answers

How to extract elements from a string value in json, using jq

I am trying to parse out a json string value. It looks like a json nested object, but it's a string value for a key. I can use -r on jq to do raw output, which strips the double-quotes, and thereby makes it a json object.. or so I think. The -r also…
jimidak
  • 11
  • 1
1
vote
1 answer

How do I update values in a json string using jq?

I have a JSON file with content this:- { "content":…
1
vote
0 answers

Import Json file into R with unicode error

I am having issues importing a JSON file into R Below is the code library(RJSON) json_file <- "file_path" json_data <-fromJSON(file=json_file) Which returns - Error in fromJSON(file = json_file) : unexpected character '' which i suspect is due…
Vine
  • 395
  • 3
  • 13
1
vote
1 answer

Inject some properties to class before function fromJson

I want inject property to class before induce fromJson. PrimitiveDocument document = null; document = (PrimitiveDocument) gson.fromJson(requestBody.toString(), AcceptPathDocument.class); In AcceptPathDocument induce constructor…
Tomasz Knapp
  • 91
  • 1
  • 4
1
vote
0 answers

Error converting Json to object that contains list of objects

I have a response that I got from my API request that I've decoded into a JSON object. When trying to convert this Json object into my class that contains a list of objects I run into the following error: "Unhandled Exception: type…
Jet.B.Pope
  • 642
  • 1
  • 5
  • 25
1
vote
0 answers

jsonlite::fromJSON is not working properly

I am trying to read in a JSON file (that I unfortunately cannot post here) into R using the fromJSON function from the jsonlite package. Thereby, I always get a parsing error and I don't know why. The really strange thing is that I have two versions…
K.O.T.
  • 111
  • 10
1
2 3 4