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.

learn more… | top users | synonyms

0
votes
1answer
7 views

Secure authentication using JWT

I read about JWT and how they can provide secure authentication for calling api routes over http. I naively implemented it and here is how it goes : a client posts username and password to a login ...
-1
votes
3answers
102 views

What is a correct way to exchange information between “frontend” and “backend”? [closed]

I am not so experienced in client-server applications and I could not find exactly answer to my question anywhere in google. I am developing part of application on server side and my collegue who ...
1
vote
0answers
27 views

How do I minimize the number of database queries in a GeoJson API (of countries, and smaller areas) with custom data?

The general version of the question is above - a a little more detail, I am using Django Rest Framework, but am happy for answers to be dealing with the problem in abstract. So, I have data with ~200 ...
1
vote
1answer
103 views

Suggestions for structuring complex json structures?

I can't find many tips for how to design complex json structures beyond the obvious tips of not trying to nest too deeply, using defined data types, etc. For example, if I have a location that needs ...
0
votes
2answers
77 views

JSON API specification : When do I need to return a 404 not found?

I'm working on a REST api following the JSON api specification and I'm struggling with the "no data" responses (described here). A server MUST respond with 404 Not Found when processing a request ...
0
votes
1answer
223 views

Best way to represent multiple JSON response in a REST service? [closed]

I am working on a REST service in which I am trying to come up with a JSON response that I am supposed to return back. Below is the design I am able to come up with in which each line is a response ...
1
vote
0answers
65 views

Best way to structure a complicated web-based quiz [closed]

I have a web project that requires I build a quiz and am having some difficulty working out how to efficiently code it. I'd like to create some sort of json template system so that the quizzes can be ...
1
vote
2answers
150 views

Declarative parser for JSON and DOM

I am parsing many JSONs and DOMs in PHP. The problem is that the my knowledge about the structure of the JSON/DOM is mixed with code. For example, suppose that I have few sources of first and last ...
1
vote
3answers
168 views

Differences between XML and JSON for data exchange

I'm wondering about the differences between XML and JSON. Without any regard to existing processing tools and backend systems and merely as a means of representing data is there anything JSON does ...
0
votes
1answer
51 views

Summing values from JSON end point based on category [closed]

I have a JSON end point for projects in a county. I am able to call a list of any of the object properties. What I want to do is to add together either all the values of budget property or the ...
0
votes
2answers
78 views

How to handle translations in JSON? [closed]

I am wondering what would be the most appropriate method to handle translations in JSON files in terms of arrays and objects. Considering an object has properties related to itself, is a translation ...
2
votes
3answers
564 views

Cache Json on disk with fast read back in java/android

summary: I need a way to cache a large JSONArray on disk, and be able to quickly read AND CONVERT it back to JSONArray at a later time. NOTE: my output MUST be a >>JASONarray<<, and not a ...
1
vote
0answers
41 views

Generate, edit, store and export documents in web application [closed]

So i was thinking about writing a document (layout?) system. Why reinvent the wheel? Well, I want a wheel that fits my cart. Im doing a “larger” web-based application and need to ...
1
vote
2answers
194 views

How can I represent a flowchart, complete with conditional logic using JSON or XML?

One part of a project I'm working on is interactive scripts for call centre staff. Pretty much every possibility I can think of in this case can be represented on paper as a flowchart, which is why ...
1
vote
2answers
143 views

WCF service design

I am rather new to WCF (or rest, or Json for that matter) and I'd like to have some expert opinions on which methods to define. Some short introduction to give an idea of what the webservice should ...
1
vote
1answer
204 views

Best way to deal with Hibernate 1->Many relationship over REST/JSON service

Problem: A Hibernate bi-directional One-to-Many relationship does not map easily to JSON. If default (Jackson) mapping is used there is an infinite recursion issue as the parent contains the children ...
0
votes
1answer
86 views

How to Handle Duplicate Web Requests on Server

I'm running a Twisted web server and trying to figure out a good way to handle retries from the client. In normal operation the client makes a request of the server with some JSON data and receives a ...
2
votes
0answers
278 views

Is it rational to convert protobuf into json to send it to a web server?

Protobuf is a good thing, it allows c++ devs to not bother with class serialization/deserialization, is fast and .proto format is very nice. It also allows automatic data validation. But the messages ...
5
votes
2answers
300 views

How Should I Design JSON Serializable Data Classes To Respect Future @NonNull Fields

I have an app that uses Gson to serialize/deserialize data classes and persist data between runs. My code uses @NonNull annotations for many fields/parameters/method returns and one thing that was ...
1
vote
0answers
74 views

Saving and retrieving multiple cached json/txt data files

I am working on some numerical programming and need to generate the results for a model given a variety of input parameters. Since the model takes a while to run, I was planning to save the data to ...
-1
votes
1answer
75 views

Relational Model to NoSQL model

I'm trying to switch my brain in to a NoSQL mode (document oriented database). I created a JSON datastructure that looks a little bit like this { "listInstances" : [ { "listClassId" : 1, ...
0
votes
3answers
1k views

Is it bad to store data in JSON form or should I use mySQL? [closed]

I've been building an application and the whole thing is built around a simple data storage system. Create an array. Convert it into JSON. Add <?php die() at the beginning to prevent access. ...
-3
votes
1answer
131 views

Less PHP request to REST API

I had an argument with my PHP developer today who tried to convince me that REST API has to provide all the request from PHP since a server is faster than client devices such as desktop. As I am a ...
0
votes
0answers
127 views

Passing Data Between Tiers in 3-Tier Architecture

Assuming we are talking physical tiers, my understanding is that in order to pass data from say the data tier to the business logic tier the JSON format is used (or XML), so say I have an ORM ...
4
votes
0answers
131 views

inserting json document with `.` in key to mongodb

Firstly, this is more of a design question than a programming question. I am creating an application where I have to fetch existing json data and insert it into mongoDB. I found that some of the the ...
5
votes
5answers
2k views

What's the best way to return an array as a response in a RESTful API?

Assume we have resources like this, book: type: object properties: author: {type: string} isbn: {type: string} title: {type: string} books: type: array items: ...
3
votes
1answer
1k views

null vs missing key in REST API Response [closed]

Say in my application, some users give us their last name, and others do not. In a REST API response, which body is preferred: With a "null" value: {"firstName": "Bob", "lastName": null} Or just ...
1
vote
2answers
236 views

Design consideration on JSON schema for an API

I have an API endpoint that retrieve data from 3 SQL tables on the server-side. At the moment, I do a SELECT with joins, consolidate/reorganize the selected data based on a JSON schema, and then send ...
1
vote
1answer
97 views

Documenting MVC JSON API

I've got an MVC5 application that we're using an a JSON API for various clients (mobile apps, other web applications, etc.) as well as a traditional web application. Controller actions that return ...
5
votes
1answer
506 views

JSON Web Token - why is the payload public?

I can't understand the reasoning for making the claims/payload of a JWT publicly visible after base64 decoding it. Why? It seems like it'd be much more useful to have it encrypted with the secret. ...
1
vote
0answers
1k views

Android, PHP session and JSON object retrieval

I am working on an app in android studio.. it currently has a login and registration system that are linked to a database and both work perfectly. I am now trying to carry over the user id value ...
3
votes
1answer
39 views

Should I omit database and server communication (after initial response)?

I have a project that I'm working on where a user uploads a big file which gets parsed by the backend, and then returns the data back in a friendlier format. Now I'm wondering whether I actually need ...
0
votes
0answers
101 views

Is it possible to use Protocol Buffers natively for message passing between a Go web service and an Android app?

I want to connect an Android app to a Go web service (I have a small social network in mind) and would like to pass data to and from the web service using Protocol Buffers, since it recently seems to ...
0
votes
1answer
81 views

JSON schema design for variable response

I am drafting a JSON schema for an API. One of the responses aims to show all the updates to different properties of an given entity. The number of updates may vary from one response to another. For ...
3
votes
2answers
704 views

Transforming XML to JSON in C++ [closed]

Working with XML in C++ seems a bit of a pain and I'm looking at a way to output JSON. I've stumbled on two different approaches: A) XSLT transformations: ...
-1
votes
1answer
456 views

How deeply can a JSON object be nested?

I was watching a video on a website that said json objects can be nested deeply. How far can a JSON object be nested before it will create an error?
0
votes
1answer
258 views

Calling RESTful service from browser and handling 4xx class responses

I have a resource called Logins, and I invoke a GET via AJAX from the browser. The current behavior is to return a 404 when the specific login cannot be found. I'm using this to check whether a ...
0
votes
1answer
261 views

Making a database and related operators using files and JSON in java [closed]

I'm trying to write a program that reads operations from a file. these operators look like below : CREATE TABLE student(id:integer, gpa:decimal, name:string, family:string,isMale:Boolean) INSERT ...
1
vote
3answers
103 views

Representing a “Belongs to” relationship in an API endpoint

Consider the following pseudo code models: class Post int Id string Title int CategoryId Category Category class Category int Id string Name Note that Post belongs to ...
3
votes
3answers
210 views

Anything wrong with direct evaluation of JSON if your own code created it?

Suppose I have a server-side variable containing JSON (named strJSON) that my own code created. In JavaScript I can consume it like this: var data = <%= strJSON %>; or use a JSON parsing ...
2
votes
1answer
193 views

How to deal with server-side and client-side naming conventions that clash? [closed]

I have a project that uses the underscore naming convention for the MySQL database and PHP scripts but uses camelCase for the javascript application (a common scenario I'm sure). However, once JSON ...
0
votes
1answer
883 views

Best strategy for storing static data : json file vs DB (mongo) vs redis [closed]

I'm currently designing a set of webservices related to travel industry. one of this service need to be take in input a airport code and a locale, and return the localized city name. fn(cityCode) ...
0
votes
3answers
74 views

Data inter-exchange with C

I'm developing a system in which a C coded TCP server is listening for new connections from clients, on connection parse the data & store into database. I'm familiar with JSON, and would like to ...
4
votes
2answers
4k views

REST API - Should API Return Nested JSON Objects?

When it comes to JSON APIs is it good practice to flatten out responses and avoid nested JSON objects? As an example lets say we have an API similar to IMDb but for video games. There are a couple ...
0
votes
1answer
340 views

Dynamic model based on JSON received from web service

I am creating a MVC web application which receives some data from a web service in JSON format. I get the different content type structures and data items related to that structure. Using that JSON I ...
1
vote
4answers
2k views

Use JSON objects or POJOs in back end service?

I'm building a back end service for mobile clients. The requirement is that the mobile clients will pass me a token, I'll use that token to talk to other systems (behind the company firewall) in my ...
0
votes
1answer
170 views

JSON or protocol buffer to replace the custom TCP message

Originally, We have two applications communication with TCP/IP, and both of them are implemented by C++. The messages between them are custom message type. Now the client program will be changed to ...
0
votes
1answer
185 views

Does a Form describing JSON “Standard” exist?

I joined a project were we sell services for different providers through web, iOS and android apps. I am working on iOS. I was ask to display a purchase form via a web view and react by what is ...
1
vote
1answer
254 views

A very simple database system with JSON

If we need to store some data in a database, but without the need of advanced SQL features, can we use this scheme (written here in Javascript / node.js) : // the DB will be in RAM ! var myDb = {}; ...
16
votes
4answers
2k views

Should a front-end developer ever specify JSON format for back-end developers?

I am taking the front-end role in a project. Should I be specifying for my back-end teammates the exact format of JSON that their PHP returns to my JavaScript? For example, should I be telling them ...