Questions tagged [json]

JSON (JavaScript Object Notation) serves as a versatile data exchange format that can be easily understood by both machines and humans. Please refrain from employing this label when referring to native JavaScript objects or JavaScript object literals. Prior to seeking assistance, ensure the validity of your JSON through an esteemed validator like JSONLint (https://jsonlint.com).

Converting JSON data into a dataframe yields varying numerical values

Consider the following JSON data: $fraudster [1] FALSE $actionType [1] "LOGIN_FORM" $actionId [1] 10 $eventList [1] "[[1544018118438041139,162.0,38.0,0.023529414,1.0,2131230815,1], [1544018118466235879,162.0,38.0,0.025490198,1.0,2131230815,0], [1544018 ...

Connecting JSON objects based on unique GUID values generated

I am in search of a method to automate the laborious task of linking multiple JSON objects with random GUIDs. The JSON files are all interconnected: { "name": "some.interesting.name", "description": "helpful desc ...

Converting a PHP variable to JSON in an AJAX call

At the moment, my approach involves using a jQuery Ajax asynchronous function to repeatedly request a PHP page until a large number of spreadsheet rows are processed. I am uncertain if the way I set the variables to be passed to the requested page is corre ...

Insert a new key with a value into PostgreSQL only if it does not already exist. If the key exists, update its

Having an issue with updating columns that have NULL values or do not contain a specific key. Here is the code I am trying to run: update A a set a.jsonbcolumn = ('{"key":' 1 '}') I'm currently using postgres version 9.6.3 and u ...

Developing a personalized collection of top picks and syncing them across multiple

Currently, I am in the process of developing a favorites list using a custom listview. ----------------------------------- <Item_Name> <favorite button> ----------------------------------- On the listView, there is an onItemClickListener. ...

Import and load numerous JSON files into a responsive and visually appealing Bootstrap table

I am new to coding in javascript and I'm seeking assistance in loading multiple JSON files to populate a bootstrap table. Currently, I've managed to create a table by manually combining the content from different files into one variable called list: $(doc ...

There are various IDs in the output and I only require one specific ID

I have a JSON fetcher that is functioning properly. However, whenever I request an ID, it returns all the IDs present in the JSON data. Is there a way to retrieve only the latest ID? This is my first time working with JSON so I am still learning. $(docu ...

How to display JSON data in a table using UI5

I am encountering an issue while trying to display JSON data in UI5. I have successfully loaded the data and can access it to show in individual fields, such as a text view. However, I am facing problems when attempting to display the data in a table. Her ...

Retrieve HTML content, including images, using Json in ASP .NET MVC4

Is there a way to send a Partial view result back to the view using Ajax and Json in ASP .NET MVC4? The HTML content also includes images. I've attempted to return data with the following code, but it's not functioning correctly. return PartialView("_Onli ...

Sending data from JQuery to a PHP file

My JQGrid is set up to display bookings with a double click event: ondblClickRow: function(rowid) { rowData = $("#bookings").getRowData(rowid); var brData = rowData['bookref']; getGridRow(brData); }, The data then gets passed to the ...

How can we ensure the JSON output is easily searchable with grep?

The JSON structure I have is as follows: { "1":{ "state":{ "on":false, "bri":124, "hue":14985, "sat":252, "effect":"none", "xy":[ 0.5182, 0.4363 ], ...

Can the compiler be configured to generate an error when a string is used instead of a nlohmann::json object?

I'm facing a situation where my method requires an argument of type nlohmann::json. class MyClass { public: MyClass(); ~MyClass(); bool parse(const nlohmann::json& configuration); }; Currently, I am passing the JSON object in the ...

Python script transforms access.log file into JSON format

Having some trouble converting my nginx access.log file into json format due to the following error: Index error: list index out of range import json i = 1 result = {} with open('access.log') as f: lines = f.readlines() for line in lines: ...

BufferedReader is unable to process lengthy lines of text

While working with a BufferedReader and HttpUrlConnection to read a file from this URL: https://www.reddit.com/r/tech/top.json?limit=100, I've encountered an issue. Even though my code is able to read some of the file, it only captures about 1/10th of its ...

Incorporating AngularJS to parse a JSON file

{ "statusCode": "000", "statusMessage": "Record Successfully Fetched", "dsStatusCode": "000", "dsStatusMessage": "Record Successfully Fetched", "businessInput": null, "businessOutput": { "systemCircleId": "2", "categ ...

Reading a Json file with keys in puppeteer BDD: A Guide

Greetings, I am new to the world of puppeteer. I have successfully created my basic framework and now I am trying to figure out how to read data from .json files. I attempted to use the readFile method in my helper class, but unfortunately, it resulted in ...

Utilizing NextJS to fetch JSON data from the public directory

I am having trouble importing a globe.json file from my public folder. When I try to import it, I get the error message Module not found: Can't resolve '/globe.json' This is how my files are structured currently: public globe.json src lib ...

Send all state values to the child component

I have an old application that sends a JSON to generate a multi-page form. I'm working on creating a universal multi-page form component where we can simply input a JSON to produce a form. The app utilizes a function called buildFormState which initi ...

The Jersey proxy client is unable to properly deserialize the JSON response into the classes generated by RAML

I have used the raml-to-jaxrs maven plugin (version 2.1.1-SNAPSHOT) to generate classes from this RAML file and I call the service using a Jersey proxy client as shown below: Client client = ClientBuilder.newClient(); Logger logger = Logger.getLogger(getC ...

What is the best way to convert this JSON into Swift data structure?

I attempted to read the text_entries, but I am struggling because the object contains integers ranging from 0 and beyond. How can I accurately parse this? What am I overlooking? Upon running the code, I encounter an error indicating that the JSON decoder ...

How to handle Json parsing without arrays in C#

After making a call to an API, I receive the following JSON data { "services":{ "Home":{ "Homecall":{ "id":"10" }, "Two Day":{ "id":& ...

The initial button click does not display data

I am currently facing an issue with my app when trying to display JSON data retrieved from a PHP web service. The problem occurs when I click the fetch button for the first time and the data does not show up on the labels. After debugging, I noticed that ...

scala handling missing fields during JSON serialization in json4s

I've been utilizing json4s for serializing scala map objects. import org.apache.spark.util.StatCounter import org.json4s.DefaultFormats val myMap: scala.collection.Map[String, Map[String, StatCounter]] = Map("key" -> Map("secondKey" -> StatCounter( ...

Navigating through JSON arrays with Node.js

I have been given the task of iterating through a complex JSON file that contains an array of JSON objects. I am finding it difficult to access the array object within the JSON file. Specifically, I need to access the "class-name" object from the JSON f ...

Obtain EmberJS Data from File in a Synchronous Manner

New to JavaScript and working on an EmberJS app. Seeking guidance on synchronously loading Ember data fixtures from a JSON file. Any tips or recommendations are greatly appreciated! ...

Utilize AJAX and C# to seamlessly map JSON data onto an object

What is the best way to utilize JSON formatted data received from an AJAX request in C#? Check out this View with JQuery and AJAX: <script type="text/javascript"> $(function () { $("#btnGet").click(function () { var values = ...

Encountering an issue when attempting to convert data to JSON in Angular 13, as the content type 'text/plain;charset=UTF-8' is not supported. This problem arises after sending data from

I've been attempting to submit a form using the following method: saveBuildcompany(): void { // @ts-ignore // @ts-ignore console.log(this.group?.value); let data2=this.group.value; let serializedForm = JSON.stringify(data2); ...

Generating hierarchical structures from div elements

Looking for guidance on how to parse a HTML page like the one below and create a hierarchical Javascript object or JSON. Any assistance would be much appreciated. <div class="t"> <div> <div class="c"> <input t ...

Retrieve the inner object contained within a JSON file

I have encountered an issue while trying to parse a specific json format on android. The json structure is as follows: {"header": { "param": "param" }, "body": { "param": "1", "param2": "2", "param3": [ ...

Using AngularJS in combination with a Flask backend to visualize the data being sent from the backend

I am currently developing a Single Page Application using Angular with a Python/Flask backend that connects to MongoDB. The challenge I'm facing is that, although I can retrieve data from the backend using a $http get request in Angular as an object and s ...

Efficient JSON management for requests and responses in Grails

I pondered whether there is a universal method to parse requests in a standardized manner or append fields to a JSON response for every transmission. It would be ideal for me to handle and interpret something like this: { transactionId:456, // includ ...

Error handling in Spring MVC's @ResponseBody annotation

I am encountering an issue with passing an entity GroupStudent object from my Spring Controller to a JSP page using an ajax function. When attempting to pass the GroupStudent object using @ResponseBody, I consistently receive an error in the browser: Error ...

Employing Jackson for serializing and deserializing an object containing nested JSON

I am working with an Entity class that has two String fields: name and description. The description field is meant to hold a raw JSON value like { "abc": 123 } @Getter @Setter public class Entity { private String name; @JsonRawValue private S ...

Dealing with unescaped double quotes in values while using JSON_VALUE()

I'm currently facing an issue with a table in my database where the field JSONDetail stores JSON data. The problem arose when we encountered unescaped double quotes within one of the values in this field, likely due to migrating from a system that allowed ...

Using Gson for multiple serialized names with the same data type

I am facing a challenge with my class: public void results{ @SerializedName("object1") @Expose private Object1 object1; @SerializedName("object2") @Expose private Object2 object2; @SerializedName("object3") @Expose private Object3 object3; @Serialized ...

How to utilize a parameter value as the name of an array in Jquery

I am encountering an issue with the following lines of code: $(document).ready(function () { getJsonDataToSelect("ajax/json/assi.hotel.json", '#assi_hotel', 'hotelName'); }); function getJsonDataToSelect(url, id, key){ ...

"Receiving HTML response from an HTTP GET request in Angular 2

Attempting to transmit test data from my node.js server to the front end. router.get('/abc', (req, res) => { return res.json({ test: "success!" }); }); In my service component: private url = "http://localhost:4200/auth/abc"; getTitles() { ...

Exploring the process of iterating through a JSON post response and displaying its contents within image divs

After receiving a JSON post response, I am looking to iterate over the data and display it in image divs. Can anyone provide guidance on how to achieve this using JavaScript? Thank you. Here is the JavaScript code that handles the JSON post response: cor ...

Using PHP to decode a JSON array (Troubleshooting issues with Ajax JSON POST to PHP)

I am new to PHP and I have a jQuery/JavaScript based application that involves finding nearby places and presenting the results in a sorted order. I am attempting to move the sorting function from the HTML page to server-side PHP. This process includes ...

SQL JSON condition clause

I am currently working with a table that contains a column named PRICING_DATA, which is of type JSON. Here is an example: pricingJson type json nullable I have written an SQL query to retrieve data from this table based on the value of a specific key in ...

Having trouble extracting a specific field within a JSON on a webpage using VBA

My current project involves extracting property data from this specified link, which returns a JSON response. I've utilized a combination of JSON and VBA converter tools for this task. However, upon executing the script provided below, I consistently encou ...

Bug in data parsing process

Check out this code snippet: $_REQUEST[ 'LOM' ] var_dump($_REQUEST[ 'LOM' ]); After running the code, the output shows a JSON structure like this: { "id":0, "type":"root", "related_dropzone_id":0, "related_dropzone_order" ...

How to use Gson to deserialize JSON in Java

Struggling with deserializing json in java using gson. This is the json I am working with: {"races":[ {"id":1,"mask":1,"side":"alliance","name":"Human"}, {"id":2,"mask":2,"side":"horde","name":"Orc"}, {"id":3,"mask":4,"side":"alliance","name":"Dwarf"}]} ...

Pass the JSX data as JSON from the Express backend and showcase it as a component in the React frontend

I am currently developing a basic react front-end paired with an Express backend. Is it possible for me to have express send JSX data as JSON so that I can fetch it in react and utilize it as a component? Right now, I am sending JSON data and successfully ...

Maximizing Performance of JSON.stringify in Angular

In my Angular app, I have a service that retrieves JSON data from an API. At times, this API sends back over 400 records (JSON Objects). When I directly access the endpoint in my browser, it takes around 5 seconds to load all the JSON data onto the page. ...

Generating a JSON array in PHP and decoding it in an Android app has encountered an error: org.json.JSONException is throwing an exception stating

I have been using the following PHP code to generate a JSON array: $jsonData = array(); $jsonTempData = array(); $count=0; $result = $link->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result-& ...

Transfer an image file to a Ruby on Rails server

I am having trouble sending JSON data with an image included. When I send the request without the image as a Bitmap, everything works fine. But when I include the image in the JSON, the server returns an error. This is how I am sending the request: R ...

The jqGrid is not showing the AJAX JSON data as expected

Currently, I am exploring jqgrid and trying to figure out how to display data in another jqgrid when clicking on a specific colmodel. The retrieved data from the server goes through a function and reaches the grid, but no information is displayed without a ...

How to extract and process multiple values of the same key in a JSON file using

I'm new to working with JSON and I'm a bit confused about something. What I am attempting to do is to parse the following data: [{"name":"Djinnibone"},{"name":"Djinnibutt","changedToAt":1413217187000},{"name":"Djinnibone","changedToAt":1413217202000},{"na ...

Incorporating JSON Data into a Collection within my Controller

I have read numerous posts that somewhat touch on my situation, but they all leave me feeling perplexed. Currently, I am sending an object via a POST request to my Controller. I have managed to get the post to reach my controller using the following code: ...

Exploring Nodejs: Navigating through ServerResponse (or, Unraveling the mystery of client URL parameters)

User Interaction: Upon making a post request to the server, the user is redirected to Spotify's authorization endpoint where they grant access to our web application. After completion, the user is redirected back to our website with a URL that includes a ...

Sending JSON data using RestKit POST method

I'm currently working on developing an iOS App for my school. In order to run some statistics later, I have implemented a database and created a Restful Web Service to handle all the necessary functions. To access the Web Service, I am utilizing RestKit. ...

How do I leverage one of my props in React to iterate through my JSON data?

My goal is to utilize props.type to modify the mapping of the JSON in the H5 section. I attempted to accomplish this similar to how I did with the className, but unfortunately, I haven't been able to find the correct method. import text from "../../te ...

I have a dataset containing a JSON substring within one of the columns, and my goal is to extract the variables from it and create separate columns for each of them

imports json df = pd.read_json("C:/xampp/htdocs/PHP code/APItest.json", orient='records') print(df) https://i.stack.imgur.com/eJg1Y.png In order to enhance the data, I am looking to add three new columns: ['name','l ...

Send a JSON payload to an API endpoint using the requests module

Currently, I am in need of sending a JSON object as input to an API in order to receive another JSON response. My usual method for accessing an API using requests is shown below: response=requests.get('url',auth=uauth,headers=headers).json() B ...

`Generating a JSON object with varying values for a shared key`

Here is the array I have: [{"option":"27 : 28","image":""},{"option":"20 : 25","image":""},{"option":"28 : 27 ","image":""},{"option":"25 : 20","image":""}] I need to display these four options using PHP, how can I do that? The expected output should be ...

Unable to insert a JSON object into an Array

This might appear to be a duplicate, but it's not. None of the solutions I've tried have worked. Within my angular module, I have a list: this.checkedInterviews = [] Followed by a function that does the following: var interviewModel = { ...

Changing a nested JSON array into a Java array

I need assistance in converting this JSON Array into a Java class Type array for Android. The goal is to extract all elements from the array, including the "doses" array, and create a Java array. [ { "_id":"58299a0ae1053c391fb95026", ...

Obtain PHP array after making an AJAX request

I'm using $.post() to send a JavaScript object and I need to receive an array in return. JavaScript Code var ajaxData = {action:"createuser"} $("input[required]").each(function(){ var attr = $(this).attr("name"); ajaxData[attr] = $(this).val(); } ...

Guide to creating a dynamically adjustable index position for jsonb_set

I have a straightforward json dataset and I am looking to append a new key:value pair to it. select elem, position from jsonb_all_testing,jsonb_array_elements(jsonb_col->'UserProfile') with ordinality arr(elem,position) where col1=2 The re ...

The type '_InternalLinkedHashMap<String, dynamic>' is incompatible with the type 'BanarModel'

There seems to be an issue with the code. I believe it is because I stored an object in a list, so how can I solve this? The error message says '_InternalLinkedHashMap' is not a subtype of type 'BanarModel'. class Home ...

Leveraging jQuery or javascript to display json data in a table with multiple columns

My goal is to convert a JSON data into an HTML table that dynamically creates columns based on the content of the JSON. However, I am facing challenges in looping through the JSON and rendering multiple columns when necessary. The desired output for the e ...

What is the reason for Slack displaying the Node.js response JSON in its raw form?

When sending a JSON response from my Node.js server to a Slack App, I encountered an issue where the response is displayed in raw form as JSON instead of being properly formatted. To replicate the problem, here is the minimum code needed: server.js: ...

Send the output of MPDF back to the browser by utilizing JSON in combination with ExtJS

I am currently using mpdf to generate a PDF report in my PHP code. I have successfully been able to save the PDF file and view it by using Output($pdfFilePath), but now I need to send it back to the browser using JSON without saving it on the server. To ac ...

What is the procedure for updating or adding data to a JSON file with angularJS?

After successfully creating a local JSON file and retrieving data from it using app.controller('appCtrl', function($scope, $http){ $http.get('employees.json').success(function(data){ $scope.employees=angular.fromJson(data.employees); console.log($s ...

Guide on utilizing PHP to display a particular value from a JSON file

Hello, I am trying to extract specific data from a JSON response. Here is the structure of the JSON: { "data":{ "user_quota":[ { "group_limit":10240, "quota":0, "support_share_quota":false, ...

Reorganize the JSON data to match the specified format

{ "EUR": { "Description": "", "Bid": "1.1222", "Region": "", "Bid1": "1.1283", "CurrencyCode": "EUR", "FeedSource": "1", "Ask": "1.1226", "ProviderName": "TEST 1", "Low": "1.1195", ...

Utilizing MS SQL, AJAX, PHP, and JSON to fetch dynamic page content based on dropdown selection

I've hit a roadblock in my project. I'm currently working on an event registration system where a user selects an event from a dropdown menu populated by values and IDs retrieved from a SQL stored procedure (index.php). Upon selecting an event, I ...

jQuery fails to retrieve JSONP data from an external source

I want to determine if a stream is live on justin.tv. They offer an easy-to-use JSON API, where by querying http://api.justin.tv/api/stream/list.json?channel=channel_name it will provide specific JSON information if the stream is indeed live. var url = ...

Verify key in JSON object using org.json.simple library in Java

Is there a way to convert a key into a JSONObject using the org.json.simple library? I've tried a few methods but encountered errors in each attempt. 1st Attempt JSONObject name1 = (JSONObject) jsonObject.get(key); Error: cannot convert java.lan ...

What is the best way to enforce constraints on three keys when validating an object using Joi?

Currently experimenting with Joi for object validation. Able to validate objects with constraints on two keys using any.when(). Now looking to implement validation with constraints on three keys, for example: var object = { dynamicPrize: false, ...

Incorporate another parameter into the current JSON data

I am currently facing the following scenario: Several servlets are setting the HttpServletResponse content-type to application/json. This is how I am outputting my JSON: out.write(new Gson().toJson(myObject)); where myObject is an object that structur ...

Storing values in the database is not possible with a JSON array

Having trouble inserting JSON array values into my database, and I can't figure out why. Could it be because of the varchar255 limit in MySQL? <?php $json = '[ { "order_id":123, "kases_id":12, "product_quantity":121, ...

Tips for accessing and storing a particular value from a JSON object array in a variable

I have some code that retrieves data from my database. The output is in the form of a list: results = [(2, '4'), (2, '17'), (3, '65'), (1, '54'), (2, '14'),...] I aim to convert this list into a JSON obj ...

Built-in Handlebars helper for nested iteration - no results displayed

I'm currently facing an issue with using an iteration helper within another one. Strangely, the inner helper isn't producing any output. Here's a snippet of the handlebars template I'm working with: {{#people}} <h4>{{firstNa ...