Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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
1 vote
0 answers
13 views

Transferring values from a json-string into an object-instance in nim

While writing a web application I've stumbled upon the following problem: I have a relational database. For each table with n columns I have an object-type (called ...
user avatar
0 votes
0 answers
11 views

Dynamic forms with angular

I've written open source plugin for dynamic forms, you can check out the code here: https://www.npmjs.com/package/ng-formality My main concern is that as ...
user avatar
  • 101
3 votes
3 answers
102 views

Json Array to ND Json converter

Problem We have a tool which produces output as json array We have another tool which anticipates input as ndjson (newline delimited json) I need to write a converter to transform json array to ...
user avatar
  • 5,560
-1 votes
1 answer
50 views

Nested pojo java class - What could I make better

I need code review. I've used Lombok and jackson. Static statemts look very "ugly" in Root class. I don't know what I should make with that. Is There another way to create nested classes? ...
user avatar
1 vote
0 answers
125 views

Inheriting from a JSON converter class with schema definition through constructor

I wanted to convert C++ data structures to JSON with little code. More specifically, I wanted to convert C++ data structures to nlohmann JSON representation. Project context: The goal is to use this ...
user avatar
2 votes
1 answer
33 views

Javascript function which polls an async endpoint and inserts the result in a web page

I read about debounce this morning and ended up needing something similar to the concept in real life this evening to build a poll that checks whether a link I receive from an async call is ready to ...
user avatar
  • 21
3 votes
0 answers
37 views

Fetch JSON from several URLs

The exercise is Write a JavaScript package that is able to: fetch an array of URLs which contain JSON data return their contents in a promise I have already made a solution to this exercise, but I ...
user avatar
1 vote
1 answer
69 views

JSON save system for Unity

I made a Json save system for my Unity game. I wanted to make something as generic as possible to keep the code DRY. I couldn't find much information online on how to make something generic. Could you ...
user avatar
0 votes
1 answer
37 views

Adapter pattern apply with JsonObject

The purpose of the code is to apply adapter pattern to put an extra feature for searching through json object. I hate deep nested json object because it makes my code look messy when access through ...
user avatar
  • 271
3 votes
2 answers
261 views

Download entire localStorage as file

I would like to download the entire contents from localStorage to a json file (in a "clear" formatting). I've tried this and it works perfectly. However, ...
user avatar
0 votes
2 answers
56 views

JSONtab library : A tool to reversibly convert between an arbitrarily deep nested object and a tabular format

Could the following code be improved in terms of clarity, performance, maintainability, best practices etc? JSONtab library A tool to reversibly convert between an arbitrarily deep nested object and a ...
user avatar
6 votes
1 answer
350 views

Elegantly combine list of records into JSON for a Python post request?

I'm parsing a Pandas DataFrame table for an API post request (using requests, of course). I'm working on building my script in Jupyter Notebooks. ...
user avatar
  • 331
0 votes
1 answer
37 views

Collect values from an api more quickly

To collect the values of an api, I use three loopings, I would like to know if it is possible to improve this method that I use. a = 9625897 ...
user avatar
3 votes
1 answer
168 views

How to not use the output of a function for the arguments of another function

I wrote this first function that use a JSON datafile as an input ...
user avatar
  • 592
2 votes
1 answer
50 views

Using XSLT 3.0 to extract information from real-world HTML and produce JSON

For work, I extract information from HTML and XML sources to save in databases. The objective is to generate JSON representing the source document's information and its relationships in order to 1) ...
user avatar
0 votes
1 answer
67 views

Extract matrices from hierarchical file structure

I have a set of JSON files stored in a folder; the folder structure is as follows: Main_folder ----F1 -----I1 ------X.json -----I2 -------X.json . . . . . . In all,...
user avatar
0 votes
1 answer
85 views

Jackson deserialization of subset of enums

I have several enums that all implement this interface: public interface SelectOption { String getId(); String getLabel(); } Here's an example: ...
user avatar
  • 169
3 votes
1 answer
72 views

Remove elements from JSON

This function removes a JSON element from a JSON file. In may case, the ID element. I am able to get the desired result. But the code looks very verbose; can it be written in a better way without ...
user avatar
  • 133
1 vote
2 answers
126 views

group countries by language in JavaScript

I need a better implementation than the below code (O(N) Solution), I am grouping countries by language ( data ) is the countries JSON, each country could have 0, 1 .. or more language as the object ...
user avatar
0 votes
1 answer
75 views

Very slow work with data analysis in JSON using Python

I'll put my complete code below so that anyone who can help won't have any difficulty running, just copy it and it's 100% functional, just very very slow. To register the data I need, I make several ...
user avatar
1 vote
1 answer
56 views

Extracting data stored in a JsonDocument from an Excel file on sharepoint.com, retrieved using Microsoft Graph

I retrieve data from an Excel file located on sharepoint.com using Microsoft.Graph like this: ...
user avatar
  • 10.6k
2 votes
1 answer
48 views

Achieving same abstraction by replacing JObject's implementation with System.Text.Json alternative

I'm trying to improve this wrapper by replacing the Newtonsoft.Json with System.Text.Json in its ...
user avatar
  • 423
2 votes
1 answer
55 views

Handling Medium-like text editor output at backend

I'm a developer who has completed almost one year of full-stack development & learning. I published my very first package lately, and I don't know is my code good or bad. So I jumped down here. ...
user avatar
0 votes
1 answer
52 views

React code that controls user permissions

I have this code that controls the user permissions provided to a user. In my case, I constructed a simple example of CRUD. When the admin checks the boxes, it will grant the user access to perform ...
user avatar
0 votes
0 answers
34 views

Resource manager code improvement

So I'm making a utility class to find resources and read them as JSON objects using the GSON library, the code below is working good but I don't really know how good it is, so I would like to get ...
user avatar
  • 1
2 votes
1 answer
112 views

FizzBuzz JSON via Unix socket (Go)

At heart, this program is just the basic "FizzBuzz" program. However, the program was pushed further, by making it a client-server via Unix Socket: Server run, and listening on a socket. ...
user avatar
  • 23
1 vote
0 answers
37 views

Unpack a flattened hash into Hash/JSON

The following JSON ...
user avatar
1 vote
0 answers
233 views

Restaurant Open Hours - Converting Json to human readable format

I am seeking a general code review. Task: Write a program that takes JSON-formatted opening hours of a restaurant as an input and outputs hours in more human readable format. Input: Input JSON ...
user avatar
0 votes
0 answers
25 views

API handler to retrieve universities from MongoDB

I have this handler for my API endpoint /api/universities. My main concern is the overall quality of the code and the efficiency of my use of ...
user avatar
  • 193
8 votes
2 answers
838 views

Efficiently parsing JSON response data in python

I'm using this API to get information on sports-betting odds. I am then processing it in Python to discard the irrelevant information. Here's what the response looks like: ...
user avatar
  • 183
4 votes
0 answers
27 views

Fetching data from endpoint, retrieving coordinates, then merging into an output

I'm in no way a skilled developer (or even a developer at that!) but I did want to take a go at writing a script that fetched one endpoint's data, extracted some data, sent if off to be geocoded, then ...
user avatar
  • 161
0 votes
1 answer
146 views

OOP Refactoring

The following script derives schemas from varied file formats. Can I get this reviewed? What would the improvements look like: ...
user avatar
  • 177
3 votes
2 answers
273 views

Simple "schema validator" of JSON using JSON Patch (nlohmann::json)

Well, it's not actually a schema validator but anyway... Motivation I'm writing a library which is a UI to work with some electronics - modules. Each real module is represented by a corresponding ...
user avatar
  • 771
1 vote
2 answers
105 views

Add a folder via JSON

I read about, that I only should have up to two parameters and a function should have about 10 lines. Now I am in trouble to achieve this. It is a Javascript/JSON thing in C#. I have too many ...
user avatar
2 votes
0 answers
25 views

Transform dataframe to a certain JSON format

I need to go from this dataframe: ...
user avatar
2 votes
2 answers
436 views

Using JavaScript, given a JSON value, recursively find all JSON objects, then sort keys in-place

Some background: JavaScript is not my primary language, so I'm looking to get some constructive criticism here. I built a tiny single page HTML app that pretty prints JSON text. It's very useful when ...
user avatar
  • 131
1 vote
1 answer
2k views

Patch a JSON object using dynamic / ExpandoObject with System.Text.Json

Background Recently, I was making some updates to an "older" library that would handle PATCH-style modifications to an object that is persisted in a JSON format on our document-storage ...
user avatar
  • 1,003
1 vote
1 answer
80 views

Copy vehicle information from JSON list to relational database

I am looking for suggestion to make my for loop iterate faster. With about 2000 rows of data. Below code is taking lot of time to run. So far I have followed various Stack Overflow answers. For ...
user avatar
3 votes
2 answers
165 views

OOP - Contact Form PHP Backend - Procedural to OOP - Dynamic MySQL Prepared Statement PHP

I just converted procedural code to OOP code. Is there any performance or security issue with this code or what should I consider further? interface ...
user avatar
4 votes
1 answer
56 views

Extracting domains and IPs from Exodus trackers JSON report

The following command series is used to gather every bit of valuable information from Exodus trackers. The ultimate goal would be to get this all into one jq ...
user avatar
  • 2,897
5 votes
0 answers
410 views

Exception handling: using @JsonProperty value to make error message

If the validation in RestController fails, I need to handle MethodArgumentNotValidException and provide an errorMessage, that ...
user avatar
2 votes
0 answers
45 views

Python script to collect NWS gridpoint forecast data (JSON) and push it into MariaDB

This script is my first-ever attempt at writing anything in python. Though I have an electrical engineering background and therefore got a little programming education in college, it was fairly ...
user avatar
3 votes
3 answers
1k views

How to handle configuration from a config file and global variables transparently in python?

This is how I handle configuration in my python code, currently, but I guess it might look magic to people, and it is cumbersome to code. How can this be improved? Are there better solutions? The ...
user avatar
1 vote
1 answer
202 views

Read and display JSON results from Google Books API

I’m working with the Google Books API and I’m not so sure about the way I’m going to get the search data and return it to the user. I will describe the path here and I would like to know if you would ...
user avatar
  • 369
3 votes
1 answer
51 views

Refactor Web Scraper

I wrote a simple Zoopla real estate scraper for just practicing what I learned so far in Python, Requests, BeautifulSoup and overall web scraping fundamentals. By looking at my code I feel like there ...
user avatar
3 votes
1 answer
197 views

Python script to parse XML file into Json

How are you doing? I have to make a script to parse an xml input file to a json file. I tried to do my best, but it will be nice if you could check it and help me to improve it. The idea is that I don'...
user avatar
2 votes
1 answer
110 views

Query the github api and filter the last 1000 commits which include and exclude certain words from the top 3 repositories in a given organization

This code should query the github api and filter, out of the last 1000 commits, which ones include and exclude certain words from the top 3 repositories in a given organization. For example, I could ...
user avatar
  • 231
-3 votes
1 answer
47 views

Form a flat indexed array from a multidimensional result set [closed]

I want make my looped data into one flat array without associative keys. I have solved it with my code, but I think it is so crowded and not simple. This my code: ...
user avatar
1 vote
2 answers
113 views

Get data from JSON values

I have been working on where I want to improve my knowledge to do a safe JSON scraping. By that is that I could pretty much do a ugly workaround and wrap it into a try-except but that is not the case. ...
user avatar
2 votes
1 answer
775 views

Run python File With get request flask API

Code is Working Review and Recommend What Are Best Practice What I am trying to achieve. API with Flask that runs any python file from the current directory. Run the file and get output in JSON ...
user avatar

1
2 3 4 5
18