Questions tagged [json]

JSON (JavaScript Object Notation) aka the Fat Free Alternative to XML is a lightweight data exchange format inspired by JavaScript object literals. It is often used with JavaScript, Ajax, and RESTful web services but is completely language independent.

Filter by
Sorted by
Tagged with
3
votes
1answer
83 views

Extract string list as array from an array of objects

Having the following array of objects of ingredients used by cooks ...
3
votes
1answer
39 views

Extracting average time series

I have this JSON code that I got from a get request with Azure API. Everything works how I want it but it doesn't look good. There must be an easier way to parse the data. ...
0
votes
1answer
56 views

Any better way to read Json array

I have a json file - WorkflowNames.json with contents as - ...
0
votes
2answers
144 views

Python arbitrary objects Serialization and Deserialization [closed]

I am trying to convert objects inside an object(arbitrary objects) to Json and later retrieve it. I have developed some codes and would like to share if there is any problem in the code. ...
3
votes
0answers
36 views

JsonStatus - A tiny C++ JSON writer

JsonStatus (as in status file) Goal A simple and fast JSON writer in C++ (JSON output only). When you need something so small that you're not sure you even need a JSON library and you don't feel like ...
1
vote
0answers
18 views

Excel to Json getting file data into state in React JS

I am using dropzone and XLSX to load excel documents and then convert them into json. The goal is to upload as many documents as possible and it will create an object with a key of the file name and ...
1
vote
1answer
32 views

Creating a Navbar Menu from JSON data with Lodash

I am trying to create a navbar menu from JSON data. Actually I have achieved it but I am looking for feedback not to call getItems twice? How can I improve my code? ...
-2
votes
0answers
13 views

how to build pandas data frame faster from elastic scroll result (more than half billons)?

currently I use elastic python API to query my data by scroll.However, it is quite slow to build a pandas data frame from the result(1 millon records, about 40s). list my code below: ...
3
votes
1answer
55 views

JSON Data-structure in C++ and querying it

As a personal challenge I want to implement a C++ JSON Parser. As part of that I have implemented the following Types/Data-structures and a way of querying them. To represent the type of an individual ...
6
votes
2answers
103 views

JSON reader based on a pushdown automata

I haven't used C++ in over a decade, so to learn modern C++ (17) I built a JSON reader based on a pushdown automata (PDA). The general idea is this: A stream is passed to ...
0
votes
0answers
27 views

To assign objects from array of objects to mulitple arrays in JavaScript

Suppose I have this array that contains objects: ...
2
votes
1answer
67 views

JSON Input validator and Parser

There are probably a lot better ways to do it, but take it as a learning exercise. Basically below is the JSON InputValidation and parsing using nlohmann::json ...
1
vote
1answer
12 views

Using a dictionary template for consistent response structure from an API

I am making a simple API for news items using Python and the Bottle framework. I return a Python dictionary from my endpoints as Bottle converts this to JSON automatically in the response to the ...
0
votes
1answer
102 views

REST API PHP find by id

Description: The web server retrieves data from file database (pdf, doc, 3d file, zip and rar) and financial program such as inventory, price, indexes, order status and so on. I'm doing REST API PHP ...
2
votes
0answers
19 views
3
votes
1answer
55 views

Converting JSON to CSV using powershell

I have a very large JSON Lines File with 4.000.000 Rows, and I need to convert several events from every row. The resulted CSV File contains 15.000.000 rows. How can I optimize this script? I'm using ...
2
votes
3answers
107 views

Efficiently convert 60 GB JSON file to a csv file

Description Simply take a JSON file as input and convert the data in it into a CSV file. I won't describe the functionality in too much detail since I have reasonable docstrings for that. As you can ...
1
vote
0answers
13 views

Re-interpolating a value from jq back into jq

I have an almost-json document in a file named "versions.json" like this: ...
3
votes
2answers
56 views

Parsing nested JSON with Haskell and Aeson

I'm trying to reduce nested JSON data using Haskell and Aeson without creating data/record types. The following code works, but seems ugly and unreadable. Any advice on cleaning this up would be great....
4
votes
1answer
69 views

How can this C++ json library be improved

I need a class to generate json content from data retrieved from a database. This gave me an excuse to play at creating a json library. This is my first attempt so it could probably be improved in ...
1
vote
0answers
29 views

Simple Json log Parser Application

I had a coding assignment task(interview) for a senior data engineer role, JSON data validation. Every record in the input json indicates a customer record, I need to write a script to validate that ...
3
votes
2answers
105 views

Code for saving / loading a class object

As I was advised, I broke my code into 2 classes. Could you take a look at the repository class and report what problems this code has ...
2
votes
2answers
338 views

Print Bitcoin price by getting JSON data using CoinDesk API

In this code in Python, I used an API called CoinDesk to get the Bitcoin price as JSON. I'm trying to follow the best practices in coding, so, I've used logging and I'm using a code formatter in my ...
0
votes
1answer
120 views

Filtering JSON objects from array of values

My code works, but it seems to be running exceptionally slow. I have an array of values to search, and I have a JSON that I'm filtering. ...
2
votes
2answers
72 views

C# - Reapply the manipulation of JS Object in .Net Core

IMPORTANT: I made another version with some improvements: Version 2 Since some months ago I disagree with the native/code methods to manipulate dynamic or ...
2
votes
1answer
60 views

Mapping a complex JSON response to two different JPA Entities

I am mapping a complex JSON response to two JPA Entity model classes using Jackson. The classes are CxExport and Mention, Mention has a Many to one relationship with CxExport I.e. Many mentions belong ...
4
votes
2answers
170 views

Takes json input and builds dynamic json output based on values in input: Looking for a better way to accomplish this

I have this specific scenario where I'm going to get a JSON that could have multiple Objects. From the Multiple Objects I will create a new Json that can have nested arrays growing by n amount ...
3
votes
1answer
108 views

Query the type of a keypath in a JSON Schema

This was the question given to me: Implement a function to query json_schema The goal of this exercise is to implement a function that allows you to query the type of a keypath in a JSON ...
1
vote
1answer
106 views

Java wrapper for a movie database API

I am still a beginner and I would love to hear some feedback on a small wrapper I wrote for the TMDb API (https://developers.themoviedb.org/3/getting-started/introduction). It is used for queries on a ...
2
votes
2answers
70 views

Postgres query to extract a JSON sub-object from a JSON field

I have a json field in a table that I want to select certain fields from into a new json field. So far I have this, which works, but I feel may not be optimal: ...
0
votes
1answer
62 views

JSON-Parser written in Go

Below is a JSON parser written in Go. It's just a task I set myself in order to learn Go, which is also the rationale for reinventing this wheel. At the moment, it's not 100% complete but it can ...
2
votes
3answers
744 views

Sorting a list in ascending/descending order with a button toggle

I have this piece of code written as a function to handle a button-toggle for sorting a list in ascending and descending order. Below is the code which is working as expected, but I would appreciate ...
3
votes
2answers
180 views

Array of objects to array

What would be the "correct" way of transforming an array of objects into an object that contains an array? Suppose I have this array that contains objects: ...
5
votes
1answer
90 views

Program for calculating and ranking scores

I've recently completed a vanilla JS challenge . It is a method for calculating and ranking scores. If possible, I would love to make it better. Any suggestions are welcome. Challenge Directions: The ...
2
votes
1answer
82 views

Parsing a string with specific pattern into json

I've a string as an input which is having some specific patterns and I'm trying to parse it into a desired json. Here is my code: ...
2
votes
1answer
89 views

Golang REST API that CRUDS in-memory object

Hey everyone I have a very simple go REST API that is running CRUD operations on an in-memory object. I would love some feedback on how I can refactor this code, and how/if I should break this up into ...
5
votes
1answer
33 views

Time Tracker Project

I am working on a little Python project to track how much time I am spending coding and doing things outdoors. Coding subtracts and outdoors stuff adds. My code is looking pretty bad. Any suggestions ...
1
vote
0answers
135 views

OCaml backend for REST API and JSON data

I want to create a backend for a simple REST API in OCaml. For this I use the libs httpaf and yojson. I have something that works but I would like some reviews. Here is the structure of my little ...
19
votes
4answers
2k views

CodeReview question markdown downloader

This is an update to my earlier question From Q to compiler in less than 30 seconds. As with that version, this Python script automatically downloads the markdown from any question on Code Review and ...
2
votes
0answers
112 views

GraphQL Schema for a Social Network [closed]

I am learning about GraphQL so I decided to make a schema for some sort of social network. Please let me know if there are any best practices I should follow based on my schema below. ...
6
votes
2answers
200 views

Improving a JSON parser for C++

I wrote a JSON parser for C++. It is not particularly fast, efficient or elegant. I'd like to change that and primarily I'd like the code to be more elegant. How do I improve it and get rid of all the ...
6
votes
1answer
121 views

Recursive component JSON configuration builder

My goal here is to make data driven nested forms in React. I've created a function that points to a form configuration JSON, which can contain both components and references to other configuration ...
2
votes
1answer
88 views

Javascript map/filter/reduce over facebook messenger data

Context: I am making a website that allows people to upload their Facebook Messenger data, and see data visualizations for conversations. It is a React front-end, and a nodejs back-end. It doesn't ...
2
votes
1answer
127 views

Strictly typed JSON representation

I would like to be specific in parameter types or write something like this: Test test = (Json<Test>)"{\"age\": 46}"; Where: ...
0
votes
1answer
69 views

Reduce the execution time utilizing two apis

I am new to python. I have been given a task to verify the data from 2 apis which give similar data but in different format i.e. Json and XML. I have written the code but it is taking too much time to ...
2
votes
1answer
57 views

Import/Export data from/to json using python

I developed a code in python that: add name, age and Id information for each person, search a person by name, if it exists then display a message "Found" and fill "age" and "Id" with the ...
1
vote
1answer
50 views

Don't include root directory in HTML tree

I've written a function to create an HTML tree from JSON. ...
0
votes
0answers
35 views

Code with Java REST API and Json Objects (Gson library)

I need to make a POST call with Java to a REST Service. My code works fine, I am just writing in order to ask if there are better ways to do this, or if someone could refactor my code and make it more ...
4
votes
0answers
49 views

Thoughts about a json2clos decoding using cl-json

Coming from this question https://stackoverflow.com/questions/58131614/how-to-convert-json-string-into-complex-clos-object-using-cl-json-library I've finally come up with the following solution. I ...
2
votes
1answer
222 views

Send excel data to Kafka

I would like some one to review my code and let me know the feedback. Each Kafka Message is like as follows [{guid=id.Value1, timestamp=1386394980000, booleanValue=null, longValue=null, floatValue=...

1
2 3 4 5
16