115 questions
0
votes
0
answers
309
views
com.google.gson.stream.MalformedJsonException | Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
I'm encountering the following problem when sending an API request on my Android 10 device. The response to the request I sent to the API returns as follows:
Actually, I am facing a crash issue ...
0
votes
1
answer
26
views
Json entry Login reader
I made a Json reader in python that reads data from a file named data.json but i don't know how to read an entry named Login from entry named Amazon
{
"Facebook": [
{
...
0
votes
0
answers
74
views
Drilling deep into JSON file with Gson JsonReader
I'm working with JsonReader for the first time and I'm trying to grab values within an array. Basically what I've found is to drill deep down into a JSON file it seems like there is a ton of ...
1
vote
1
answer
581
views
How to use GSON streaming to parse JSON with multiple top-level objects?
I've been looking for example Gson streaming API code, and I see a lot of this style:
reader.beginObject();
while (reader.hasNext()) {
switch(reader.peek()) {
...
-2
votes
1
answer
37
views
How to Deserialize a string which contains multiple object of same type in appended format [C#]
Let's say I have an Employee class.
Employee
{
string Name;
int Age
}
My string contains the data of different company's employee in a string. I want deserialize it as List of Company Info. I ...
1
vote
1
answer
114
views
Reading multiple parameters of JSON objects in java
Hi guys I am getting issue while reading this file can anyone suggest me how to read this file by using model name and tagline and also variant code of this model. I am new to reading in json using ...
0
votes
1
answer
121
views
How can I read json data which has its tag/identifier in quotes?
I'm using NodeJS to fetch the NPM registry with the code below.
import fetch from "node-fetch";
let url = "https://registry.npmjs.com/[package-name]";
let settings = { method: &...
2
votes
0
answers
1k
views
How can I pass input stream to Utf8JsonReader in C#?
So I am trying to read in a serialized JSON file. So a part of my code currently looks like this
using (Stream input = File.OpenRead(openDialog.FileName))
using (BinaryReader reader = new BinaryReader(...
0
votes
1
answer
1k
views
Read a simple JSON file with GSON JsonReader
I thought this would be simple but it keeps crashing with InvocationTargetException at reader.hasNext().
File jsonInputFile = new File(root + "/dicts/phrases.json");
JsonReader ...
2
votes
1
answer
1k
views
How to load a json file which is having double quotes within a string into a dataframe in spark scala
I have the below json file which i want to read into a dataframe but i wm getting error as the json file has double quotes within the string.for example:
data:{
"Field1":"val"ue 1&...
0
votes
1
answer
419
views
Bug report ExtJS 7.4.0 Ext.data.reader.Json
first post on this account, how exciting. Sadly, the contents are less exciting. I have found a very simple bug in the reader.json function getResponseData.
I want to have proper error handling in my ...
1
vote
2
answers
2k
views
How to read a Json file under the resources folder?
In my SpringBoot application I have to read a Json file at this path src/main/resources/mock/fileName.json.
I done it in this way
JsonReader jsonReaderStream = new JsonReader(new InputStreamReader(...
0
votes
1
answer
1k
views
How to read the value from json using JsonReader without knowing the json key
I am trying to use TypedArray to parse json.
My json will be the following:
{
"id":"112233",
"tag":"From server",
"users":{
...
0
votes
0
answers
287
views
Encountering JSONreader ClassNotFoundException despite including it on classpath
I am trying to figure out how to use the JSONreader package, I have downloaded the gson-2.8.6.jar file and am using the command: javac -classpath gson-2.8.6.jar Dummy.java
This command works fine but ...
-2
votes
2
answers
215
views
how to parse json where key is variable using scala play json reader?
how can i access i4x-IITB-CS101-problem-33e4aac93dc84f368c93b1d08fa984fc_2_1 key and data inside this key ? I have never seen an example json reader that describes how the reader works when the key ...
0
votes
1
answer
366
views
Google.Apis.Urlshortener in C# giving Error JsonReaderException
I want to use Google Nuget package for shortening URLs.
I included all the required files
public string shortenIt(string url)
{
UrlshortenerService service = new ...
0
votes
0
answers
226
views
JsonTextReader gets stuck after reading a certain amount of lines
I'm trying to deserialize a large stream of Twitter Tweets.
Everything is going well at around the first 200 deserialized tweets, but after that, the Deserialize method gets stuck and never proceeds.
...
6
votes
2
answers
32k
views
C# Error reading JObject from JsonReader. Path '', line 0, position 0
I'm trying to parse my json with the code below. I get the error:
Error reading JObject from JsonReader. Path '', line 0, position 0.
I thought this might be because my JSON was malformed, so I ...
1
vote
1
answer
2k
views
How to read JSON file with Arrays and Objects in Java
I'm trying to read a file which is fetched from Opentdb and access data from only specific keys.
I've tried all of the given methods which includes GSON and Json Simple but ended up having errors.
...
0
votes
2
answers
4k
views
How to loop through json array of json object in java
I am trying to loop through the json file and find the value of particular json object.
Here is my sample json:
{
"diagram":[
{"size":{"width":30,"height":20},"color":"blue","id":1},
...
0
votes
1
answer
19k
views
How to resolve MalformedJsonException: Unterminated object that exist even after setting JsonReader to lenient
I am trying to parse two json files and convert them to Map<String, Object> using gson but while doing the above convertion using gson i am getting com.google.gson.stream.MalformedJsonException:...
2
votes
0
answers
2k
views
.NET Core - JSonReaderException Error reading Jobject from JsonReader
I'm developing an application with the ASP.NET core Framework and Visual Studio keeps coming up with the error message:
System.FormatException: "Could not parse the JSON file. Error on line number '...
2
votes
0
answers
5k
views
ERROR: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
I am getting following error while opening android studio existing project first time ERROR: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
I am getting this error ...
0
votes
2
answers
167
views
FileNotFoundException in the onCreate() method
I keep receiving the FileNotFoundException error when trying to load my file into a JSONReader using an InputStream within my onCreate method.
I've tested this code in a simple Java program and it ...
0
votes
0
answers
388
views
how to read input data (.json file)line by line using dictionary in c# --> generic code
I'm using Newtonsoft.Json to read a .json file. I need to generically --> It should loop through all the datas where data/count may vary every time.
//var map=new Dictionary<string,string>();
...
1
vote
1
answer
3k
views
Control characters in Json causing JsonParsingException
I have this java method:
public class ReadIssues {
// Reads from a Json object
protected JsonArray readJson() throws IOException {
JsonArray issueArray = null;
ClassLoader cl = Thread....
0
votes
3
answers
146
views
Can not read the specific values of json file in objective c
I have downloaded the json files in my App Folder and I want to read that files from my App Folder to print specific values.
Files are located like this : /var/mobile/Containers/Data/Application/...
2
votes
1
answer
2k
views
Reading a JSON file in order
I have this json file that have a map of key-value pairs, but each value is a list of values
{
"car":["BMW", "AUDI"],
"OS":["Mac", "Win", "Ubuntu"],
"food":["Burger", "Taco"]
}
I ...
0
votes
1
answer
3k
views
Transform and flatten JSON using GSON
I’m working on splitting a SignalK JSON object into canonical JSON items representing each value.
The original JSON looks like this:
{
"mmsi": "urn:mrn:signalk:uuid:5377770-4ee4-4a4b-3230-...
2
votes
1
answer
574
views
JsonReader don't parse correctly String Array
I'm using JsonReader from gson, for parsing JSON, my JSON parsing is fine for all value except this one :
"tags": [
"String1",
"String2",
"String3",
"String4"
],
...
0
votes
0
answers
437
views
Get a dump of a section (object) of JSON
I'm looking to dump, rather toString() a section of JSON that I want to store locally as a string, since it it is highly variable and not imperative for me to know the contents.
I'm using JsonReader ...
1
vote
0
answers
1k
views
MalformedJsonException error
It happened when I restarted my computer.
I turn on android studio, but I can't start the emulator.
Information:Gradle tasks [:app:assembleDebug]
Error:java.lang.RuntimeException: com.google.gson....
1
vote
1
answer
3k
views
Does JsonReader in gson need to be explicitly closed
I want to do this with gson when reading from a json file:
JsonReader reader = new JsonReader(new InputStreamReader(
new FileInputStream(filename)));
JsonParser jsonParser = new ...
0
votes
1
answer
2k
views
Postman json data needs conversion into a c# class i want to use anything i got back from my API to zillow call
So I used postman to retrieve API data from a website named Zillow, the problem I am running into now is I don't know how to use that data that received in a c# class. basically how to call my json, ...
0
votes
1
answer
121
views
Slow Performance on Android implementing Offline Dictionary using JsonReader
I am trying to implement an offline dictionary in a ebook reader app I am working on.
Let me explain the process. The dictionary is not part of the original app, rather will be downloaded in ...
10
votes
4
answers
9k
views
Using GSON do not parse a field, only keep it with the json raw string
Using GSON in Java is there any annotation where I can indicate a field that it should keep it as a raw string even though it is an object. ?
Or What would be the easiest way to achieve this?
//This ...
0
votes
1
answer
597
views
Use a custom type parameter to auto map a JSON response
Can I pass a custom type as a parameter in a method and use it to read JSON from an external API? So if I had this:
trait ApiInfo
case class SunInfoResults(sunrise: String, sunset: String, solar_noon:...
0
votes
1
answer
1k
views
Read cached Json file as ByteArray with JsonReader
I cached a Json file as byte array and want to read it afterwards with the JsonReader.
However, the JsonReader takes a Reader as input parameter.
How can I convert me byte array to a Reader and is ...
1
vote
4
answers
688
views
Java API call using JsonReader?
So I'm at lost how to do this: the goal is simply to make a call to the openweather api in java and have the result be returned on the console. I can't find any tutorials on how to do this, only on ...
1
vote
0
answers
67
views
Strange case error of java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 47 [duplicate]
I have 2 same projects that has same task, it is want to access web service from android with JsonReader,
project 1 was running well and everything good there is no problem,
project 2 was appearing ...
0
votes
1
answer
2k
views
JsonPath with JsonTextReader: Token at a Time
I am having an issue with JsonPath working differently when loading token (.Load) at a time using JsonTextReader versus loading the entire JSON using ReadFrom. Here is an example:
JSON: Path="[*]....
0
votes
1
answer
350
views
Android JsonReader is closed when attempting to refresh content
Currently, I'm working on an app that shows contents of an JSON-based API in a listview. Fetching the data and using the adapter to fill the listview works fine the first time. But when I try to ...
0
votes
2
answers
1k
views
Jsonreader parse error
I have a the following code:
reader = new JsonReader(new InputStreamReader(con.getInputStream()));
It returns the following JSON:
{
"results": [
{
"bioguide_id": "D000626",
"...
2
votes
2
answers
3k
views
JsonReader - reading an array throws Expected a name but was NULL
I'm using JsonReader to parse some JSON data. It's a big array of elements of similar structure:
[
{
"type":"duel",
"discipline":"leagueoflegends&...
0
votes
0
answers
272
views
when use Boost to handle json string, I get a core dump which say "stream is not available"
I use boost to handle a Json, it works well, but today I get a core.
here is the stack.
#0 0x0000000000517a19 in std::for_each<std::reverse_iterator<__gnu_cxx::__normal_iterator<boost::...
3
votes
1
answer
13k
views
Convert value from JsonObject to BigDecimal
I'm a newbiew in java language.
I want to get a value from a JsonObject and convert it to BigDecimal.
I have the following code:
JsonReader jsonReader;
try {
jsonReader = Json.createReader(...
6
votes
2
answers
7k
views
Reading Large JSON file into variable in C#.net
I am trying to parse the JSON files and insert into the SQL DB.My parser worked perfectly fine as long as the files are small (less than 5 MB).
I am getting "Out of memory exception" when trying to ...
0
votes
0
answers
82
views
How to read object name using JSONReader
I am developing an android application and i need to parse the json data from YQL
https://query.yahooapis.com/v1/public/yql?q=select%20%20*%20from%20%20yahoo.finance.historicaldata%20where%20symbol%...
3
votes
2
answers
67
views
How to order and display json values in list, if some values are not unique and some are unique
{
places: [
{
id: 1,
place:"America",
name: "Robert",
age: "22",
place_lat: "10.017",
place_lon: "76.344"
},
{
id: 1,
place:"America",
name: "Albert",
age: "22",
place_lat: "10.017",
place_lon: "76....
1
vote
1
answer
504
views
How to read a array value form json in java
I have following json data:-
{
"store": {
"book": [
{
"category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the ...