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.

103 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
0 answers
636 views

Chaining JSON transformations with visitors

I have currently two use-cases that require JSON transformations before it can be deserialized. The first use-case requires changing the custom short type property name from ...
t3chb0t's user avatar
  • 44.2k
6 votes
0 answers
1k views

Recursive conversion from ExpandoObject to Dictionary<string, object> #2

Because my original question was lacking many details, I have been advised to ask a new question. I will repeat the important parts of the original question and add examples etc to hopefully make it ...
Joelius's user avatar
  • 355
5 votes
0 answers
1k 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 ...
Georgii Lvov's user avatar
5 votes
0 answers
45 views

JSON Test Harness: Part 2

Part 1: JSON Test Harness: Part 1 Part 3: JSON Test Harness: Part 3 Part 4: JSON Test Harness: Part 4 Time to review some test harness code I have written. https://github.com/Loki-Astari/...
Martin York's user avatar
  • 94.6k
5 votes
0 answers
73 views

JSON Test Harness: Part 1

Part 2: JSON Test Harness: Part 2 Part 3: JSON Test Harness: Part 3 Part 4: JSON Test Harness: Part 4 Time to review some test harness code I have written. https://github.com/Loki-Astari/...
Martin York's user avatar
  • 94.6k
5 votes
1 answer
170 views

GitHub API client

Here is my Haskell program designed to list all of my GitHub repos along with their descriptions and languages via the GitHub JSON APIs: ...
Richard Cook's user avatar
4 votes
0 answers
44 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 ...
markb's user avatar
  • 171
4 votes
0 answers
79 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 ...
CplusPuzzle's user avatar
4 votes
0 answers
159 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 ...
user212061's user avatar
4 votes
0 answers
880 views

Node JS | From Excel to Json

Intro -> I have to convert an excel file, which comes usually in this way: to a Json file that must looks like this: ...
Matteo's user avatar
  • 41
4 votes
0 answers
11k views

Deserializing JSON with Utf8JsonReader

Path of Exile is a PC game where players can list their items for sale. The game has a public API that serves JSON which contains all of these items. My application consumes that JSON and indexes the ...
Rainbolt's user avatar
  • 141
4 votes
0 answers
49 views

JSON Test Harness: Part 4

Part 1: JSON Test Harness: Part 1 Part 2: JSON Test Harness: Part 2 Part 3: JSON Test Harness: Part 3 Time to review some test harness code I have written. https://github.com/Loki-Astari/...
Martin York's user avatar
  • 94.6k
4 votes
0 answers
8k views

Function to return JSON-like objects using VBA collections and arrays

My goal is to create a compact function that can create a JSON Like object from JSON string. I want a function with a small footprint that I or anyone who wants to use it, can simply paste into a ...
TinMan's user avatar
  • 4,133
4 votes
0 answers
139 views

Dynamically creating login screen on Android devices

This has been an experience. I'm well above "hello world" java is not a language I use often when programming and I don't program too much. I find myself a lot on Google.... basically just about for ...
Nolan Robidoux's user avatar
4 votes
0 answers
2k views

Encode object to JSON and encrypt with AES (with tests)

While the task at hand is relatively straightforward, it turned out AES in Go is a bit clunky so I was wondering if this seems right. Also, any tips on Go coding in general are more than welcome. <...
fstanis's user avatar
  • 380
3 votes
0 answers
186 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 ...
Zubair97's user avatar
3 votes
0 answers
628 views

JSON to CSV in python using json.loads and json_normalize

I am trying to convert a JSON file to CSV format using Python. I am using the JSON.loads() method and then using json_normalize()...
Bhawna Aggarwal's user avatar
3 votes
0 answers
200 views

JSON flattening with object duplication on array property for CSV generation

I am looking for a way to transform JSON data into a flat "csv-like" data object. In some way, I am looking to "sqlirize" a mongodb collection. I have already check some json flat libraries in NPM ...
Alfredo's user avatar
  • 31
3 votes
0 answers
925 views

Using Python threads to download images

I am using Python threads to download images. I have a JSON file that contains URLs to the images in the following structure: ...
liz's user avatar
  • 31
3 votes
0 answers
114 views

Network abstraction layer for a JavaScript JSON API client

I'm rewriting collection-json.js, a client for Collection+JSON. (Collection+JSON is a HATEAOS API media type built on top of JSON.) My Goals: Remove CoffeeScript webpack UMD so it can be used via ...
MustModify's user avatar
3 votes
0 answers
1k views

Python script for OpenStack health check

First time moving from Bash to Python for scripting and looking for feedback/improvements. I've spent the weekend learning about OOP, and am aware that not fully utilizing it in this script — so any ...
n7s's user avatar
  • 131
3 votes
0 answers
32 views

JSON Test Harness: Part 3

Part 1: JSON Test Harness: Part 1 Part 2: JSON Test Harness: Part 2 Part 4: JSON Test Harness: Part 4 Time to review some test harness code I have written. https://github.com/Loki-Astari/...
Martin York's user avatar
  • 94.6k
3 votes
0 answers
340 views

Accessing Apixu weather API

My code is a module to simplify accessing a weather API. I'm quite certain it could be simplified, just not sure how yet. Some advice would very much be appreciated. Possibly use individual classes ...
Macoryx's user avatar
  • 31
3 votes
0 answers
30 views

Testing whether pages can be fetched from two ports

I have an endpoint in my API which does a port test on 4455 and 4456 once a client GET's it. This is accomplished by requesting two web pages. The result will respond to the client with a JSON object: ...
Harvey's user avatar
  • 131
3 votes
0 answers
179 views

Filtering OTC market data

It's been one month I do programming in python. Hence, my experience is a bit limited. Here is what I've done so far. The program is only filtering OTC market data according to certain features. Could ...
J.Doe's user avatar
  • 31
3 votes
0 answers
266 views

Search GitHub users when text field changes in Kotlin Android app

Problem: Search for users by their name using the GitHub API (sorted by the number of followers) and display the results in a RecyclerView. Implementation: Hitting the GitHub API every time when user ...
Ankur_009's user avatar
  • 131
3 votes
0 answers
919 views

Implementing a JSON-serializable ORM model

I implemented a library which, amongst other things, implements a JSON-serializable ORM model based on the peewee framework. Here's the relevant excerpt: ...
Richard Neumann's user avatar
3 votes
0 answers
1k views

D3 Force-Directed Graph with Numerous Functionalities

I have a d3.js force directed graph that is driven by the code below. I am relatively new to d3, and much of the code is pieced together from various examples found online. If anyone has a moment or ...
OverflowingTheGlass's user avatar
3 votes
0 answers
92 views

MVC JavaScript app to display athletes by country

I'm new to javascript programming and not sure if I'm coding correctly. For testing myself I created a small JS application. The idea of app is: List of athletes, grouped by country and the ...
Zourab's user avatar
  • 131
3 votes
0 answers
220 views

Perl nagios plugin to query an api, obtain date from json, and determine if the date is within thresholds

This is an update of Using an API to obtain JSON data and get the date string and determine if data is stale This is a nagios check that will use an API URL, get JSON data, flatten the data into a ...
japtain.cack's user avatar
3 votes
0 answers
52 views

Sorting upcoming events listed in JSON

I've written my first program in GO, a command line tool that parses JSON containing events from a file or from STDIN and outputs the upcoming events in sorted order. Please critique it! ...
Rohan Shah's user avatar
3 votes
0 answers
721 views

JSON schema visualizer

I have the following backbone function to read a JSON schema and draw the tree structure (as in the screenshot below). I want to make sure if checking against the type as object/array is alright or if ...
SachiDangalla's user avatar
3 votes
0 answers
764 views

Web service for Android clients to store images

I wrote this code for Android server interaction. The way I built the client was an onSharePreference of strings includes photo encoded to a base64 ...
sivi's user avatar
  • 181
2 votes
0 answers
137 views

Python raw dataclass to formatted dataclass transformation for avro schema

I receive some data from an api. I would like to define the raw responses schema and model it as a python dataclass, with the added benefit of using the ...
bbd108's user avatar
  • 121
2 votes
0 answers
113 views

Python code to add GeoIP data to a Suricata eve.json log

I wrote this script as part of a Suricata course where I had to annotate destination IP addresses with GeoIP data in an EVE JSON log file. I would like your input on my code style and smell, ...
Devilish Spirits's user avatar
2 votes
0 answers
29 views

Transform dataframe to a certain JSON format

I need to go from this dataframe: ...
Stéphane Laurent's user avatar
2 votes
0 answers
202 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 ...
dialupisbad's user avatar
2 votes
0 answers
986 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 ...
user2112618's user avatar
2 votes
0 answers
26 views

A service that posts JSON to a server and works with responses

...
Minh Triet's user avatar
2 votes
0 answers
135 views

Bash bitcoin blockchain explorer

I wrote a little bash script that displays the transaction info in json: ...
reardenlife's user avatar
2 votes
0 answers
603 views

Updating UI in Retrofit onResponse

I have an Android project that queries the BART train API. I was curious if updating the UI inside the Retrofit onResponse method is correct or if there is a better way. Below is my code. Also, here ...
jmcs's user avatar
  • 21
2 votes
0 answers
28 views

Recuperate user's details into fake JSON server

This is the 'details.ts' which define the user's details that I want to recuperate in a JSON (user's role, logintime, duration). ...
Hiba's user avatar
  • 21
2 votes
0 answers
50 views

Client wrapper for sending data to a downstream process

I am building a Python client for an alert process engine. The users can use this client to publish and clear the alerts. The client exposes two methods publish and clear to the users. These methods ...
Aparna Rajan's user avatar
2 votes
0 answers
1k views

Mapping nested arrays from API response

I have some selects on my html page that I want to populate with the response from my backend API. The response looks like this JSON response ...
idetodospoca's user avatar
2 votes
0 answers
63 views

Parsing potentially nonexistant JSON fields in JavaScript

Context: I'm currently toying with the Google Geocode API to break down address strings into a more machine-friendly format. The problem is that neither the user input or API output are 100% ...
Magmagan's user avatar
2 votes
0 answers
41 views

Looping JSON to get matching values from Database

I have a need to take in a payload that looks like this: ...
VinnyGuitara's user avatar
2 votes
0 answers
141 views

Determine the country by an IP

EDIT: I have updated the code, if you have comments about the previous version of the code, please do post them anyway. The task is to determine the country by an IP. Provided programme queries two ...
John Snow's user avatar
  • 235
2 votes
0 answers
131 views

Basic to-do CLI app (with JSON for persistence) using Python

I’m very new to Python. I wanted to start out with a simple project: a CLI app that keeps track of my to-do’s. The code works as intended, but is what I have written is any good? File structure: <...
VirtualRaccoon's user avatar
2 votes
0 answers
61 views

Controller to execute AJAX requests for a client

I have been developing this structure or pattern (I don't really know how to call it). It's my first time doing something like this, and I'm a bit worried about the future, if it becomes unmanageable. ...
Vistor's user avatar
  • 43
2 votes
0 answers
60 views

Display results from a JSON response based on game type

This code currently works with no errors. I want to know if there is a way to improve its conding structure, as there is a lot of repetition and it looks really bad. I tried an alternative way by ...
James Green's user avatar