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
-4 votes
0 answers
20 views

Best Practices for mapping complex JSON [closed]

I often find myself having to work with complex JSON payloads. They might have 2-3 levels of nested objects and arrays, making them difficult to keep track of. Typically in java I just map them to a ...
user avatar
  • 127
1 vote
1 answer
46 views

Can a REST API response include a reference and preview data

Let's say I have a REST API with resources that look something like this: /users/<id> { "id": <str:user_id>, "firstName": <str:first_name>, "lastName&...
user avatar
1 vote
0 answers
118 views

Versioning JSON data in db

I'm curious if there are any obvious pitfalls to the following: I have a database table that, because it is storing many objects of various subclasses, I'm using a JSON field to hold the non-...
user avatar
-1 votes
2 answers
56 views

Best practices for API design for an E-Commerce System

I have a few basic questions on how to implement an API for a basic e-commerce system. The relevant entities are Customer, Puffle, and Review. Each Puffle can have zero or more Reviews. Each Review is ...
user avatar
8 votes
6 answers
759 views

How should an API handle unsupported fields?

Let's assume I have this API on /api/v2/persons that enables me to create new entries by POSTing this JSON: { "name": "me" } The API is implemented using Spring Boot and if ...
user avatar
  • 225
0 votes
1 answer
226 views

Constantly writing a JSON file [closed]

I need to write continuously into a JSON file in C++. The format and structure are defined as requirement. The data is produced in the process itself and needs to be stored multiple times per second. ...
user avatar
-2 votes
2 answers
139 views

Avoid redundant field using JSON type in MySQL [closed]

I have experienc with designing relational dbs but first time attempting to store JSON in a mysql table. I am using mysql 5.7.8 which has the ability to store json data type as a column. When I create ...
user avatar
  • 139
2 votes
1 answer
125 views

Best practice for designing a WebAPI for exposing data in a SQL database interacting with C++ and C# applications

I am looking for general guidance or any relevant links for a complex project. We are a small business that sells a construction materials testing software. The client is a Windows application with ...
user avatar
1 vote
1 answer
561 views

How do you pass enums between microservices, without need to have copies of enums in different services?

I'm working with microservices, and I see an issue. There are two services, that transfer info between each other via jsons. Because of this, we have to store our enums in strings, and serialise-...
user avatar
1 vote
1 answer
154 views

SQL for storing hierarchical data

I have a UX that is modeling a hierarchy. There is a concept of a section, a sub-section under a section, a panel under a section and a bunch of form-fields under a panel. The UX exposes an ability to ...
user avatar
1 vote
2 answers
49 views

Does it make sense to refer to a user created label for an object as an ID?

Currently working on a project where the user will create a JSON file that's then read into the system. The fields of one object can be referred to in another object for relevant operations. Something ...
user avatar
0 votes
3 answers
540 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 ...
user avatar
  • 285
2 votes
7 answers
336 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. ...
user avatar
  • 184
-2 votes
2 answers
312 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 ...
user avatar
0 votes
1 answer
51 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 ...
user avatar
1 vote
1 answer
444 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....
user avatar
1 vote
1 answer
284 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 ...
user avatar
  • 127
0 votes
1 answer
183 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 ...
user avatar
  • 111
-2 votes
1 answer
132 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, ...
user avatar
  • 13
1 vote
2 answers
313 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. ...
user avatar
  • 121
0 votes
1 answer
56 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 ...
user avatar
  • 145
1 vote
1 answer
131 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 ...
user avatar
1 vote
1 answer
99 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 ...
user avatar
-3 votes
2 answers
708 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 ...
user avatar
-1 votes
1 answer
347 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 ...
user avatar
  • 13
0 votes
1 answer
74 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": [{ ...
user avatar
-2 votes
4 answers
262 views

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

tl;dr - I've settled on the terminology Traversable for the container type which includes List and Dict but excludes str, and Atom for anything which is not traversable, e.g. cannot nest indefinitely. ...
user avatar
3 votes
3 answers
879 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 ...
user avatar
1 vote
1 answer
111 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 ...
user avatar
0 votes
1 answer
51 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 ...
user avatar
  • 101
-2 votes
1 answer
24 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&...
user avatar
2 votes
1 answer
579 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 ...
user avatar
  • 139
-5 votes
1 answer
41 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 ...
user avatar
-6 votes
1 answer
124 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 ...
user avatar
  • 297
1 vote
3 answers
2k 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 ...
user avatar
1 vote
1 answer
98 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 ...
user avatar
5 votes
4 answers
2k 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 ...
user avatar
0 votes
2 answers
82 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 ...
user avatar
3 votes
3 answers
394 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 ...
user avatar
  • 141
2 votes
1 answer
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", "...
user avatar
9 votes
4 answers
19k 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 ...
user avatar
2 votes
3 answers
2k 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 ...
user avatar
0 votes
1 answer
52 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", "...
user avatar
  • 101
-1 votes
1 answer
58 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 ...
user avatar
  • 177
3 votes
3 answers
245 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 ...
user avatar
-2 votes
1 answer
111 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 ...
user avatar
  • 115
1 vote
1 answer
30 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 {...
user avatar
1 vote
1 answer
82 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 ...
user avatar
7 votes
6 answers
2k 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 ...
user avatar
  • 223
-1 votes
2 answers
181 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 ...
user avatar
  • 1,406

1
2 3 4 5
7