Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Questions tagged [json]

JSON (JavaScript Object Notation) is a textual data interchange format and language-independent. Use this tag when this text format is involved. DO NOT USE THIS TAG FOR NATIVE JAVASCRIPT OBJECTS OR JAVASCRIPT OBJECT LITERALS. Before you ask a question, validate your JSON using a JSON validator such ...

0
votes
0answers
2 views

Random empty request response from AJAX causing a JSON parsererror

I'm encountering an issue that is baffling me. When connecting to a database, through a AJAX JSON request, sometimes (randomly) it returns an empty XML string instead of the expected JSON. The ...
0
votes
0answers
8 views

Not able to consumer REST API with angular

I'm trying to consume JSON from a rest API i made but even the getting the result (status 200) from the API its not refreshed on the page. Rest response [{"flashsdcapacity":128,"installedversion":"...
1
vote
1answer
42 views

Fetch JSON data from API Javascript

So I have been working on a mini project however I can't seem to fetch data from the JSON file in JavaScript. I have the data displayed in the console, however if I want to print out the first array ...
1
vote
4answers
52 views

Jackson JSON output formatting

I have an ArrayList<Person> that contains a few Person type objects. The Person class has the following attributes with their getters and setters: private int id; private String name; private ...
0
votes
1answer
15 views

Convert ModelState to JSON for Logging

How do I convert ModelState to JSON? I know I can do BadRequest(ModelState) and it will return JSON to the client. How does it convert ModelState to JSON? And more importantly, how can I use what ...
0
votes
0answers
7 views

Issue to pass JSON string from fragment to adapter

I am a newbie to android Development, I was trying to implement a list view with items, by which when an item clicked it should display another list view with lists of specific items, I used JSON ...
0
votes
1answer
25 views

JSON API not retrieving through fetch due to origin Cross-Origin Read Blocking (CORB)

I continuously keep getting the (settings.js:76 Cross-Origin Read Blocking (CORB) blocked cross-origin response) error. I am using the fetch method to retrieve the json data from the api, here's my ...
1
vote
3answers
1k views

How to fix this error: "SQLContext object has no no attribute 'jsonFile'

I am learning Spark now. When I tried to load a json file, as follows: people=sqlContext.jsonFile("C:\wdchentxt\CustomerData.json") I got the following error: AttributeError: 'SQLContext' object ...
0
votes
0answers
8 views

Handling null data elements in JSON dump operation

I need to either remove or write a NULL, NONE or some text to a section of my JSON that has no input values for a given element. For example: Some of my original data has no description text, so I ...
0
votes
0answers
6 views

How to get a object key in a Json in Microsoft Flow

I'm using Mautic API to search contacts by e-mail. The standart json response is that below: { "total": "1", "contacts": { **"64936": {** "isPublished": true, "...
0
votes
1answer
51 views

Parsing JSON from input value in Javascript?

I'm completely new to the subject of JSON and I was wondering how to parse JSON from an input value in my form. I'm trying to string the inputs into an array like {"task" : "(input) ", "(input) "} {"...
0
votes
2answers
27 views

How to create a column containing a JSON that has names defined from the value of a column in another table?

I have a source table with data in VARCHAR format like the example below. I want to insert the data in another table in a JSON format (the result column itself can be of JSON or VARCHAR type). For ...
0
votes
0answers
12 views

Converting CSV data to JSON and then send it to an API using Python3.x

Here is the code I have written so far but seem to be getting the 400 error. I know the issue if with the way I am trying to post the data to the API but I am not able to figure out what exactly is ...
12
votes
2answers
13k views

Convert a Ruby Hash into JSON (without escape characters)

I have a Hash: my_hash = {"bob.johnson@example.com"=>{"first"=>"Bob", "last"=>"Johnson"}, "lisa.dell@example.com"=>{"first"=>"Lisa", "last"=>"Dell"}} When I try to serialize it ...
1
vote
2answers
22 views

JArray - search for an object by key name

I have an object of type JArray, which contains a list of json objects. The JArray looks like: JArray jarray = [{"Key1":"v1"}, {"Key2":"v2"}, {"Key3":"v3"}] Now I want to retrieve an element from ...
1
vote
2answers
1k views

Try to convert json4s values into integers

I have random JSON strings that contain string values when they are really numbers but I have no way to know what fields they might be when coming into my system. For example: { "some_key":"1234"...
0
votes
2answers
16 views

Using OpenWeatherMap forecast API in PHP

I am trying to show the forecast for a city from openweathermap. But my foreach show nothing. Whats wrong? <?php $url = "http://api.openweathermap.org/data/2.5/forecast?zip=85080,de&lang=de&...
0
votes
0answers
16 views

Jackson 2 @JsonConstructor with partial json deserialization

Given: The following bean: public class A { private final int a; private final int b; public A(int a, int b) { this.a = a; this.b = b; } } The following json: {"a":1} A ...
0
votes
0answers
24 views

read data from table and create a json data on submit in angular 6

I am very new to angular 6.Need help for the below I have create a dynamic html table in angular6, which is being created based below parameters: header name will be based on the name of players ...
0
votes
1answer
28 views

How do I get a json file from a website and put it into a MS access database minutely.

I am trying to read in sensor data which stored in a json file into a database every minute. But I have no idea how to read it in in visual basic or write it to the database. Ive tried creating local ...
0
votes
2answers
26 views

JSON API Parsing Issue

I created a GUI that lists the highest and lowest rated movies listed in the Hydra Movies Database API. When I parse through it to find the max and min IMDB ratings using Compare.Comparing and ...
-2
votes
1answer
13 views

JSON get nested information

I need to get information from some JSON code, so the data I have is: { "lastUpdate": "2018-07-24T18:23:44.7530145", "ownerTeam": "Administradores", "createdDate": "2015-03-...
1
vote
2answers
34 views

How do you convert encoded JSON string properties when calling JsonConvert.SerializeObject?

I have a POCO with some string properties that contain encoded JSON objects. When I call JsonConvert.SerializeObject, I would like to convert these strings back into JSON and have Json.NET serialize ...
1
vote
2answers
22 views

Spread number equally across elements of array (and add remainder to beginning of ring)

Let's say I have some JSON array, we'll call it A: ["foo", "bar", "baz"] And I have some number X, let's say 5 in this case. I want to produce the following object in jq: { "foo": 2, "bar": 2, ...
1
vote
1answer
682 views

Postgres/JSON - update all array elements

Given the following json: { "foo": [ { "bar": true }, { "bar": true } ] } How can I select the following: { "foo": [ { "bar": false }, { "...
1
vote
4answers
48 views

Spring deserialize object with JSONObject field

I'm having problems to de-serialize an object containing a JSON field in spring. I have a DataTable data structure that has both String fields and a field that should contain a JSONObject: public ...
0
votes
1answer
2k views

“The coordinates or dimensions of the range are invalid”

I am working on a Google Apps Script that links with a REST API and puts the data into a Google Sheet. I have successfully done this once, but upon accessing some different data I get the error ...
0
votes
0answers
22 views

How can I parse Date String from JSON in Swift 4 [duplicate]

I am trying to create an iOS API that interfaces with the NHTSA web API . When parsing the returned data with JSONSerialization as well as JSONDecoder, the value for the key "ReportReceivedDate" is ...
-1
votes
1answer
811 views

How to loop through Json file using Python

I am trying to print all the premier league fixtures this season through a JSON file I downloaded, using python. Here is the link to the Json file I am using - Json File I have managed to print the ...
0
votes
1answer
29 views

DateTimePicker - Add days in a given period

Good Morning. I found this code that serves my purpose: $(function () { $('#CheckIn').datetimepicker({ format: 'MM/DD/YYYY' }); $('#CheckOut').datetimepicker({ useCurrent: false,//...
1
vote
2answers
52 views

Steam Web API get all genres of app?

I'm trying to make a fun little program that incorporates showing information about steam games, but I'm not sure how to get all the genres of a specific game. For this example I'll be using ...
2
votes
3answers
2k views

Mapping JSON into Class Objects

I am trying to map my JSON file into a class object, and then update the cards based on the newly received JSON. My JSON structure is like this { "$class": "FirstCard", "id": "1", ...
1
vote
2answers
18 views

Socket blocked in transmitting json object from Java to Python

I have a problem with a Java-Python Socket. My objective is to send a Json object from java application to python script via socket tcp and receive a response but the socket is blocked after Json ...
0
votes
1answer
46 views

How to get value in json Swift

I hava a json file: jsonpElixo({ "response":{ "parks":[ { "Park":{ "id":"2", "name":"PARQUE VILLA-LOBOS", "type":"Urbano" }, "...
0
votes
0answers
8 views

self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ','

I have a large json file (2.4 GB). I want to parse it in python. The data looks like the following: [ { "host": "a.com", "ip": "1.2.2.3", "port": 8 }, { "host": "b.com", "ip": "2.5.0.4", "...
0
votes
0answers
14 views

parse binary file with unicode chars to json

I am trying to parse a binary file to the correct output as a python object. I tried reading the file and printing what it contains, but this has a lot of weird symbols that I'm not able to ...
2
votes
2answers
751 views

Make jackson serialize apache commons Pair

How can I make jackson, if even possible without making my own complex serializer of org.apache.commons.lang3.tuple.Pair, to serialize both my left and right object in a proper way. So for example I ...
-1
votes
1answer
24 views

“/usr/lib/python3.6/json/init.py”, line 296, in load return loads(fp.read(), MemoryError

I have a large json file (2.4 GB). I want to parse it in python. The data looks like the following: [ { "host": "a.com", "ip": "1.2.2.3", "port": 8 }, { "host": "b.com", "ip": "2.5.0.4", "...
0
votes
3answers
387 views

How to get sub values inside JSON based on user selection

I have some dynamic JSON to populate a drop down box. How can I retrieve all the values inside the parameter section based on the user selection of the value. For example if the user selects report, ...
0
votes
1answer
36 views

Nested JSON Object Looping in PHP Codeigniter

I'm having problems creating nested object looping from Controller . This is the data that i'm currently using What i've already tried is : function getCoordinate() { // Distict SQL Query for ...
0
votes
1answer
14 views

Create nestled JSON

The code below takes data that I have extracted from various websites and writes the data to a JSON file. I would like to create a nestled section called {nlp_description} for the NLP items (Unigrams,...
640
votes
14answers
405k views

How to reformat JSON in Notepad++?

I need Notepad++ to take a json string from this {"menu": {"id": "file","value": "File","popup": {"menuitem": [{"value": "New", "onclick": "CreateNewDoc()"},{"value": "Open", "onclick": "OpenDoc()"},{...
0
votes
1answer
31 views

JSON Multi Dimensional Array not shown on PHP

I make a normal API like this header('Content-Type: application/json'); $return = array(); $conn = mysqli_connect("localhost","root","mysql","dummy"); $fetch = mysqli_query($conn,"SELECT * FROM DATA "...
0
votes
1answer
52 views

Merge Spark RDDs from bad JSON

I have a lot json files, however they aren't formatted correctly for Spark. I don't want to write code to specifically convert them to the correct format by normalizing each dict on each line. ...
0
votes
1answer
15 views

XMLHttpRequest to JSON file won't return all descendent objects, only 32

I have a JSON file with nested arrays and objects and I am creating an XMLHttpRequest to access the data. It is working for the most part, I am able to get most of the data from the different JSON ...
2
votes
1answer
32 views

how to print this i m not getting any output train api

This is my js page $(document).ready(function(){ $("#submitCity").click(function(){ return getWeather(); }); }); function getWeather(){ var city = $("#city").val(); if(city != ''){ ...
-4
votes
0answers
24 views

Reading JSON with header and only values [duplicate]

My json looks like something below. {"Fields" :[{"Name":"AAAA","TYPE":2},{"Name":"BBBB","TYPE":2},{"Name":"CCCC","TYPE":2},{"Name":"DDDD","TYPE":2},{"Name":"EEEE","TYPE":2}],"records":[{"records"}:...
0
votes
1answer
64 views

How to add map markers stored in a JSON feed to an existing React Google Map?

I have a react-google-maps project which creates a map: const MarkerComponent = ({text}) => <div>{text}</div>; export default class NavMap extends Component { constructor(props) { ...
-1
votes
1answer
16 views

Photoshop Scripting export psd to json [on hold]

I am new in photoshop scripting. Is that possible to export photoshop psd to json? To write layers shapes e.t.c to json? Thanks for answers!
84
votes
7answers
39k views

Python's json module, converts int dictionary keys to strings

I have found that when the following is run, python's json module (included since 2.6) converts int dictionary keys to strings. >>> import json >>> releases = {1: "foo-v0.1"} >&...