Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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.

-2
votes
0answers
24 views

react native - to db or json

I am building a front end app in react native. The app is content managed. The app will pull down a zipped version of it's data (json) from a web based CMS as it needs to be usable without internet ...
-2
votes
0answers
43 views

Ideal design for many tables using the same source

First I apologize for my English. Scenario 1 In Questions and Answers tablars, I keep the identities of related files in json format. Scenario 2 The "rel_type" field shows which table belongs to ...
1
vote
2answers
93 views

Define a complex query in JSON sensibly

A bit of background. We are in the design phase of an HTTP API, and we are facing the question of how to define complex queries in JSON format. We have a items in our product that have A LOT of fields ...
2
votes
2answers
123 views

How do I avoid increased memory consumption by browser and performance degradation when dealing with many records?

In my MVC 5 web application there are many instances in which users will require to view thousands of records within grids, now I managed to get around many performance related issues by utilising the ...
1
vote
2answers
48 views

Returning JPA Entities in Rest Api's?

Recently Ive seen so many devs working with the stack Spring/JPA and returning all these JPA entities on their rest controllers. In my opinion it's a BAD PRACTICE for several reason such: ...
0
votes
0answers
32 views

How to build a data-driven menu in JavaScript?

I'm going to attempt to build a data-driven menu for my web-app. The goal is to be able to serve different menu options to different users from an API. The hope is that the server could return a ...
0
votes
0answers
21 views

JSON-based Audit Log best practice

Not quite sure if this is the community to ask this question, but I was wondering what the best structure would be for a JSON-based audit logger. We currently run Microsoft SQL Server but some of the ...
0
votes
1answer
120 views

What is the best way to represent data with inheritance?

In my current work, we need to serialize some data and use it later. Our data is in this format: <resources> <style name="Person"> <item name="name">name</item> <...
2
votes
1answer
134 views

Where to store config settings in a text file and when in a database?

I have several web applications. All of them have config files. I'm trying to figure out when it's appropriate to store data in a config file and when in database in json or free format? For instance, ...
2
votes
1answer
152 views

Keeping a JSON copy of a database

I'm new to server-side programming and I'm building a small "test" web application in NodeJS. Each time the clients need to view data from the PostgreSQL database, NodeJS will execute a "SELECT" query ...
0
votes
1answer
127 views

Representing Java Object Hierarchy With Nested Classes

I was working with some API which was used internally, and while looking at their code I found something like this: public class Parent { @Data public static class Child { private ...
1
vote
1answer
107 views

Designing a flexible search API response

Quick Summary I'm building a search micro-service that will allow searching across different types of resources in a particular system (e.g. blog posts, users etc.). The API that will be exposed will ...
1
vote
3answers
296 views

Validate JSON on server side

I'm working on Web Application (ASP.Net MVC) that will allow users to edit a JSON object in the browser and save it to database. To do so, JSON object will be sent from view to server side (...
0
votes
0answers
73 views

A program, written in native code, needs to access data, read by a managed DLL

I'm working on an application, which needs to base itself on a DLL, written in managed code (C#), in order to function. That DLL contains type definitions. Therefore a convertor has been written, ...
0
votes
0answers
200 views

Storing template like data partially as JSON in MySQL or as flat JSON file

I am working on creating a import/export template solution for a web application. The web application has "Departments" (stored as a MySQL table departments) and each "Department" has a set of "...
0
votes
0answers
46 views

Which is the correct idiom, $ref or format?

Which is the correct idiom to use in the following situation? { "title": "asset", "description": "Media Asset", "type": "object", "properties": { "id": { "type": "...
0
votes
1answer
254 views

Web API Response, Error Code Convention [duplicate]

Imagine that you are developing a front end client that will consume an API. You're working on the login page and want to display errors to users below each field, in this case you want password ...
0
votes
0answers
80 views

Reusing existing canonical data model for REST services

I work in an enterprise where is slow transition from SOAP & SOA to Microservices&Rest like architecture. For specific business domains there are well established canonical data models which ...
0
votes
2answers
222 views

Design public API - String or generic type?

My team needs to design an API which sends objects to a queue in the cloud and retrieves objects from it. The data is inserted into the queue as byte[]. We have 2 ideas until now which I would love ...
-1
votes
1answer
128 views

How are some websites utilizing .JSON protocols as their web address

https://www.toyota.de/automobile/corolla/index.json I understand how .JSON works but, how is it possible to use that instead of say, .php or .html this is the first time I've seen anything like that.
0
votes
0answers
73 views

How to translate from managed to native class definitions

I have an input file, being the DLL of a C# piece of code, containing managed class definitions. I also have a *.json file, who determines how the conversion should be done. As an example, this is ...
2
votes
2answers
806 views

Maintaining stateful information in REST API

I am developing a REST API which accepts JSON using Spring Boot. I use Spring Security for authentication. I have a use case where I have two services, one to test connection to a 3rd party system and ...
0
votes
2answers
433 views

Design - JSON Strings storing large amounts of data for large amount of users

I have a website that allows users to be "tracked" and track their time/work. This involves the users being able to update their account with my site at most every minute, but typically users do it ...
0
votes
1answer
139 views

Best practices for sending various details about REST resource in a reply from service

We are creating REST API which will be consumed by Web and Mobile users. My question is: do we need to consider user interface before designing the JSON structure? For example, we have one ...
0
votes
0answers
88 views

What's the right way to find patterns in models?

I have to find predetermined patterns in business process models and I'm not sure whether I have chosen the right solution for this. The input is a business process and the output is a list with ...
2
votes
3answers
153 views

Should I be lenient with types when accepting JSON data? (String vs number)

Background: So while Javascript implicitly convert various data types and hence may seem almost type-less(is there such a thing?) it does have different types. Most of my colleagues seem to think ...
1
vote
3answers
556 views

Which is a more efficient way of storing data in a database using Objects or strings (Database design)

Which method is better to store the data in a database and why? Here is a restaurant example. I'm using a SQL database and JSON to communicate with the database. Imagine each row is a column in a ...
2
votes
1answer
147 views

How to convey object hierarchy when object is converted to json for updates?

I have some classes being serialized via frugal (this is an open source extension of Thrift). The primary reason this is relevant is that the serialization process is out of my control and needs to ...
3
votes
2answers
56 views

Ajax response — is there an agreement on the structure?

Say, I make an ajax request to a server from a page, something like "show more articles". Is there a common agreement on the format or rather structure in which a result should be returned? Something ...
0
votes
1answer
202 views

Correct way to inform business rules violation during JSON parsing

We have the following scenario in our company: There are some business objects which have business rules associated with them. One of these objects, Person, has the following rules: A Person must ...
0
votes
1answer
149 views

Modeling JSON with Javascript

Using C# I've modeled a JSON message this way: public class MessageBase<T> { public MessageBase() { this.message = new List<T>(); } public string type { get; set; } public ...
0
votes
0answers
368 views

Building up a JSON object in a stored procedure

My apologies if this isn't the right forum to ask this question. If it is, please let me know and I'll move it over to stack exchange. After discovering an unfortunate limitation of our PostgreSQL ...
-4
votes
4answers
182 views

What are good ways to parse a large amount of input for a C++ application [closed]

For small command line applications I can get away with simple command line input. ./test input.png output.png But for larger applications that requires a lot of input, simply using command line ...
11
votes
7answers
750 views

Is it a good practice to have a special value “ALL” in an enum

I'm developing a new service in a micro-services environment. This is a REST service. For simplicity, let's say that the path is: /historyBooks And the POST method for this path creates a new history ...
0
votes
2answers
404 views

Consuming external APIs within the microservice architecture

I'm writing a small microservice-based application. One of the services is assigned the task of querying an external API and processing the JSON response (filtered list of houses). Since I'm using ...
3
votes
2answers
1k views

Are Unknown JSON Keys a Valid Approach to Sending Data?

There a lot's of SO questions asking "how" to get unknown JSON keys from a JSON object, and I've done it plenty of times, but after starting to use JSON schema to start designing API request and ...
1
vote
1answer
857 views

How to design anti-corruption layer in DDD

I'm getting ready to create an integration with a major external system and was wondering if my understanding of the design pattern for this in domain driven design was solid. Considerations: ...
0
votes
1answer
1k views

Why is elastic search popular? [closed]

Elastic search is basically about indexing of data. In database world, Multiple indexes can be created on a MongoDB collection Collection in MongoDB can be schema-less. In MongoDB, BSON encoding ...
2
votes
2answers
238 views

What are the drawbacks of modeling (unit) test fixtures in JSON instead of using ObjectFactories?

When writing java tests for an application, be they unit tests or testing a broader scope, the java community tends to model fixtures in terms of object factories that produce fixtures of a defined ...
0
votes
1answer
1k views

Comparing Two JSON Files In O(n)

I've got a scenario where I need to compare two JSON files and override one if the values are different. These JSONs also include arrays (i.e. [) My approach is to traverse one JSON to dictionary O(n)...
2
votes
5answers
366 views

Using a workaround instead of going the “standard” way in parsing json

I have been tasked with developing a java application that includes retrieving one property from a json response from a web server. Normally when I parse json I go with the standard way of creating a ...
3
votes
1answer
6k views

How to represent a set in JSON?

JSON supports the following data structures (Java equivalents): Scalar, Array/List, and Map. A Set is not supported out-of-the-box in JSON. I thought about several ways to represent a set in JSON: [...
0
votes
2answers
250 views

Load JSON immediately for SPA instead of AJAX? (Python=>AngularJS)

I have access to a Response object in my python backend for returning HTML pages, etc. I can declare headers, content-type, etc. Instead of re-engineering the Python to use something like Django/...
4
votes
5answers
3k views

Is it ineffecient to store data as json in plain text? [duplicate]

We needed a persistent storage for API keys and I came up with reading and writing json in plain text and the user thinks it works but is it very ineffecient compared to a relational dbms? I just ...
0
votes
3answers
838 views

What approaches can be used to convert existing JSON structure to existing XML structure?

I am working on a component for an enterprise message queue that consumes a message from a queue and sends it as a text message. The message is picked up by my consumer in JSON format (I do not have ...
0
votes
1answer
506 views

What would be a proper implementation of a dictionary in java?

The problem: Let's say I want to create a java app (currently using java 8) that works like a dictionary. I want the app to give the user the capacity to add and search for words, every word must ...
2
votes
1answer
430 views

Best Practice for Potentially Large JSON Numeric Vaues

I raised this issue on the github project for RazorJam.Insightly, where as you can see it turns out that an error is occurring because for the particular items that I am retrieving and deserialising ...
-1
votes
2answers
619 views

MySQL 5.7 json type or MongoDB document?

I'am working on a project that use MySQL as RDBMS. Recently, we have to manipulate a big json data. So, the first solution that comes in mind, and for many reasons, is to cooperate mongoDB with Mysql ...
0
votes
1answer
1k views

JSON data with a key/index for easy searching

Is there any reason not to build JSON data that can be indexed by some key? For example in the WhenIWork API below, using the user's id to quickly access the data? The reason I'm asking is because ...
6
votes
4answers
2k views

Is it a good practice to make API response list of values as dictionary?

I have an API endpoint that returns some statistics. Currently the response looks like: Option 1: { "stats": [ { "name": "some-stats-key1", ...