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
0
votes
3answers
59 views

How to design RESTful API for response object properties dependent on request parameter

I have a RESTful service where clients provide product codes, start date and end date. In response, the service returns a list of price metrics for the products over the date range. Start date is ...
1
vote
7answers
170 views

Representing a large list of complex objects in JSON

I am currently developing an API that returns JSON structures. One of the domain objects returned is a time series, which is a potentially large list (many thousands of elements) of complex objects. ...
-2
votes
2answers
67 views

How to best manage multilingual information in documents in JSON/MongoDB/Mongoose?

I have to manage multilingual information in JSON documents in a MongoDB/Mongoose context. But I'm in a dilemma regarding best the format to use with a view to performance metrics: I'm currently ...
0
votes
1answer
42 views

Running ad hoc queries on JSON log files

I have a situation where let's say I have a folder called logs which has N folders. Each folder contains events for a specific event type and each folder has N .log files where each file has multiple ...
1
vote
1answer
162 views

Sharing types & endpoints between frontend & backend [closed]

I'm looking for a clean solution to share types, endpoints and response format between a backend and frontend. The backend will be in Python & the frontend in Typescript. The backend is a REST API....
1
vote
1answer
93 views

Java REST services - What are best practices regarding DTOs?

I've been working on a project that communicates with a service which sends very complicated REST responses. Current "best practice" on this team is that we use POJO DTOs to handle all data ...
0
votes
1answer
95 views

How can I represent a graph for a visual programming language in JSON?

I am in the process of implementing a visual programming language similar to Blender's node editor or Unreal Engine Blueprints. It will be implemented as a SPA that will communicate with a JSON based ...
-2
votes
1answer
117 views

Can I manage a NoSQL database with only JavaScript?

I am creating an app with Deno (a personal project), and I manage the "database" with only the Javascript code of the Deno enviroment, modifying JSON files like any other JS object. For me, ...
1
vote
2answers
132 views

Performance strategies for repeatedly iterating through large JSON files

I'm designing a project which will require iterating through a foreign language dictionary in JSON format. The idea is clicking on a word in a text will trigger a search on the JSON file for a match. ...
0
votes
1answer
50 views

Index all fields of json documents in a desktop app without server or service

We have a .NET Core application that works as a datawarehouse and we store our entities in json documents that we regroup by projects. Usually projects would easily have 300k json documents with 50 to ...
1
vote
1answer
47 views

Semantic meaning of empty list parameter in JSON API request

I'm attempting to find some authoritative references to address this particular scenario. References to best practices guides would be helpful, specifications even more so. The scenario in question: A ...
1
vote
1answer
68 views

How to represent Spacial Time Series data in json clearly?

Currently, I have an application generating time series spacial data. The data is weather data with coordinates and a time of reading. I would like to receive chunks of the data in a time series way ...
-3
votes
2answers
139 views

Sending JSON in body of an email

Basically, in our scenario, data has to be sent from a WordPress form to Dynamics 365. My current approach is putting it into an email body in JSON format, that is then extracted and further processed ...
-1
votes
1answer
129 views

Best practice to flatten JSON object and store it database

I'm fetching data from Clockify, flattening the JSON response, and storing it in the database where each property on the API response should have its own table's field. I have read this article about ...
0
votes
1answer
65 views

Redesign json structure to reduce duplication of ids

I have json like below in our legacy system. In general, my json is very large. To make things simpler and easier to understand I have reduced the entries. { "clientSettings": [{ ...
-2
votes
4answers
211 views

Is there a name for the data structure [object, list, primitive] e.g. JSON? [closed]

I am wondering if there is a terminology for the container data structure "isomorphic" to valid JSON, in other words, each item is one of: array/list object/dict/mapping leaf: something ...
3
votes
3answers
523 views

What is the normal form of JSON?

This is going to sound like a trivial question, but I like to think it's actually a deep one. The simple quesiton is, "What is the normal form of a typical JSON object?" For reference, I ...
1
vote
1answer
89 views

Consuming complex JSON service that does not have schema

Hi I have this weird situation where I have a JSON producing service that represents a very complex object graph and this bject graph does not have a JSON schema that it is based on. The reason for ...
0
votes
1answer
49 views

Architecture question: Match addresses in different JSON schemas

I had to move houses recently and I found that it is tedious to check every potential place's broadband coverage. For that reason I want to build a website where you can check which broadband options ...
-2
votes
1answer
23 views

RestAPI different json for list of items and item details

I have a RestAPI with two endpoints: /items - list of items /items/2 - selected by id, an item details returned json for list of items is { "id": "1", "name": "Max&...
2
votes
1answer
295 views

Storing static data idea — is it best practice?

I have a database in which I am storing a bunch of companies that can have several different types of codes associated with them — here is a example of a group of codes I was wondering if storing them ...
-5
votes
1answer
40 views

How is data stored prior to downloading?

I go to several sites that offer their data in XML, JSON, CSV formats. As shown here, https://www.space.org/basicspacedata/query/class/boxscore/format/csv, I choose the format. Question is how is ...
-6
votes
1answer
71 views

Are aspects of domain driven design limiting when we scale?

From what I have read about the domain driven design, an aspect of it is that there is a clear separation between domain objects and DTOs. So the application level components deal with domain objects ...
0
votes
2answers
565 views

Is it bad practice to in a REST API to use Form Data in POST requests when all responses are in JSON?

When developing a REST API, is it ok to use Form-Data in POST requests or is that frowned upon? All my methods return a JSON body or only an HTTP code, should this be extended to my POST and PUT ...
1
vote
1answer
85 views

Should I perform some minor denormalization to save myself several queries in the future?

I'm in charge of designing the entire backend for the REST API of an application that works more or less like an online browser game (think OGAME, Travian, and the likes). In this game, players are ...
5
votes
4answers
795 views

How to stream JSON using HTTP instead of pure TCP

If we have a long list of JSON entries, we could put those on an HTTP body so we could parse the whole body of JSON with something like JSON.parse(): HTTP/1.1 200 OK Date: Sun, 10 Oct 2010 23:26:07 ...
0
votes
2answers
78 views

How to use strict schema with seemingly fluid data type

Our company is trying to find a good generic way to have Many-to-One data for an entity. For example, a user might have 1 primary email, but many other emails also attached to their account. So we ...
3
votes
3answers
274 views

Read large JSON file and return a subset for map

To some extent, this is a wide question, because I do not know in which direction I should move. I am using Polymaps to show markers on a map. The markers are static but the visualization depends on ...
2
votes
1answer
2k views

How to parse a dynamically changing Json file? (c#)

So I know a little bit about parsing Json data but not too much so pardon if I am not describing everything as I should. Lets use this Json file as an example: { "firstname": "John", "...
8
votes
4answers
13k views

Is it a bad idea to pass JSON objects on the query string for an API “search” operation?

I'm building an API endpoint for a UI grid to search, filter, and display a list of domain objects, let's call them "widgets." In the past, I would have built this with a list of named query string ...
2
votes
3answers
1k views

How to maintain XML/JSON serialization tests?

It is quite common to test JSON / XML producing methods against file-stored expected output (at least in Java world, but probably in other environments, too). For instance there's a method that ...
0
votes
1answer
34 views

API Request/Response Model for showing differences in JSON objects

I am writing an API to merge two different JSON Objects. Both of these objects can have same as well different number of properties. Object 1 : { "name": "Sam", "lastName": "Hanks", "...
-1
votes
1answer
57 views

Is it permissible to have relationships to parents of parents for JSON:API resources?

I have the following hierarchy: venue -> concert -> booking And within booking I have a relationship for the concert. But should the booking also have a relationship to the venue? Or is it bad ...
3
votes
3answers
236 views

Ways to mark the parts of a JSON that need to be updated (“dirty bit”)

I have a JSON object of arbitrary complexity, representing several entities (not my design choice). I want to partially persist it, only for the changed entities. What would be the best way to mark ...
-2
votes
1answer
80 views

Database with auto-expiration

I am midway through my software development project in Node.js and have encountered a fork in the road. I need to create a "database" or a JSON file, that will automatically delete an entry after it ...
1
vote
1answer
25 views

Represent nested resources that has two different type (entites) owners in REST APIs?

Suppose I have a entity called Appointment. This entity represents an medical appointment between one Doctor and one Patient. To create a new Appointment, I send somethind like: POST /appointments {...
1
vote
1answer
81 views

What is the word for the “shape” of json requests/responses? [closed]

For example, what would you name a module containing all of the Pydantic models for your FastAPI project? What would you put as a subtitle in your documentation below an example JSON api response? In ...
6
votes
6answers
1k views

Should error codes in JSON be integers or strings?

I'm designing a backend webservice, and when an error occurs I'm returning it as a JSON to the frontend. This JSON contains an error code, which the frontend maps to an localized string and shows that ...
-1
votes
2answers
158 views

What does a proper server response look like? [closed]

tl;dr Which is the best server response for an endpoint to get a user's age? 30 or {"age":30} or {"metadata":{"time":1561919615,"status":200},"age":30} or something else? I am writing a server using ...
0
votes
2answers
208 views

Why not program our video text terminals/terminal emulators to use something JSON or XML on the backend instead of ANSI escape sequences? [closed]

Backstory (You can skip) Awhile back I was developing a console toolkit for displaying debug messages and the like: It gives me colour coding, blinking, underlines, bold, italic, etc. While ...
0
votes
1answer
104 views

Do TCP Sockets need validity/security checks?

I am currently building a distributed system that consists of two separated nodes, connected over wireless Lan. The processes communicate over a bidirectional TCP Socket and JSON messages. For the ...
0
votes
1answer
156 views

When is the point where a JSON text file storage is not enough?

I guess it was Robert C. Martin who campaigned against using SQL in one of his apps, where he was just fine without DB and SQL initially. Later, thanks to the abstraction a DB implementation could be ...
2
votes
2answers
3k views

Is there a canonical way to handle JSON data format changes?

Problem Say we have a C# class with is serialized to JSON (currently via Newtonsoft's JSON.Net) and stored in a database: public class User { public string authInfo; } If the class definition ...
0
votes
0answers
77 views

JSON-RPC Json Objects Best Practices

I am building a JSON-RPC over UDP socket API in Java. There are 6 objects that will be transmitted in JSON: jsonRequest jsonSuccessResponse jsonError jsonErrorResponse jsonNotification ...
2
votes
1answer
68 views

What is the purpose of adding a schema validation in responses?

Many of the server scripting packages/tools out there have the option to have a schema validation before the response is sent out to the clients. E.g. the fastify package for a Node.js has a pretty ...
1
vote
2answers
1k views

What does the colon before the name mean in this JSON like string?

I encountered this string that looks like JSON syntax but I've never seen a property with a colon before it and not with a backwards greater than or equals sign: Badge { :id=>36, :name=&...
5
votes
3answers
17k views

JSON without quotes for keys

I need a textual human readable format which is reasonably compact and version-control friendly to serialize a persistent memory heap. My Bismon system (GPLv3) has such a format (it is textual, human-...
2
votes
2answers
171 views

How to create useful error messages in a JSON REST API without leaking implementation details across layers?

We're implementing a REST service with three main layers: Controller, Domain, Repository. The REST API is supposed to respond to error conditions with meaningful error messages. Suppose the general ...
1
vote
1answer
1k views

HashMap versus Object ? Which one is better to finally generate JSON output with KEY and VALUE

I do have this use case. callers(APIs in same microservice or different microservices) wants to report different KEYS and VALUES as an audit as part of their methods. There is a high possibilities ...
1
vote
1answer
340 views

Why protobuf is said to be in binary format although we write it in text format similar to json

JSON { "hello": "world" } Protobuf message HelloWorld { required string name = 1; } Why do we say that protobuf uses binary format during network exchange and json don't, even though network ...

1
2 3 4 5
7