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

1
vote
1answer
35 views

Transfer flattened entities instead of DTOs?

I wonder, if the below idea makes sense for our web application. We show various lists of entities, which typically refer to other entities and so on. In the table view, there are columns showing some ...
-1
votes
0answers
20 views

AJV Validator for JSON

I have the following JSON validation var schema = { "type": "object", "required": [ "name", "profession" ], "properties": { "name": { "type": "string" }, "profession" : { "oneOf": [ ...
2
votes
0answers
37 views

Best way to build a JSON API coupled with HTML views in a Rails project

I've got a Rails eCommerce project communicating with an iOS app. The iOS app receives JSON data from the Rails back-end, but there's also HTML rendering when a user comes to the project from his ...
0
votes
2answers
77 views

JSON or XML or other - most time efficient for largely “read” of structured data

Considering that using a relational DB or other hierarchical or such databases is not an option, looking for the alternative approach using a simple (but very fast, efficient, distributed KV-store). ...
2
votes
2answers
197 views

Is it a bad practice to use JSON strings as keys of objects?

On languages such as Haskell, most datatypes have instances which allow their values to be used as keys of structures such as Maps. JavaScript has reasonably fast maps, there called objects, but those ...
0
votes
2answers
38 views

Modelling a REST Object Question (Python)

I have a REST API that I want to model in a class so I can access the properties using the dot notation (JS list notation). I explicately defined the properties on my class using the @property tags ...
-3
votes
0answers
129 views

How to return Custom JSON Response using Web API

I am pretty new to Web Api, how can I return customized JSON response? I want to achieve something like this: In the case where there was an error from the server side, the return will be: ...
2
votes
3answers
123 views

What is the least bad way of knowing the type of a key from Json file

in our app we have a Json file that contains several properties used for menu configuration. One of the keys should tell us if a menu item should be displayed. The thing is that the value for this ...
2
votes
2answers
148 views

Reversible Functions

Currently writing a JSON Importer and creating some POJOs based on the data. I also have a requirement to write an JSON Exporter which take the information in the POJOs and exports a JSON doc. To me ...
-1
votes
3answers
99 views

Dealing with API rate limits

I've been using a simple json to the steam API to get player inventory, but now I have discovered that steam impose a rate limit to the number of requests allowed. A rate I feel is not enough for my ...
3
votes
1answer
45 views

Whether to embed linked resources in REST API

I am building a REST API where clients can query user-sent messages, like this: GET http://example.com/api/v1/messages?from=0&to=100 Response: [ { "id": 12345, "text": ...
0
votes
1answer
61 views

multiple api calls vs more complex apis

I have been providing a Web API (.NET MVC 5) of an Oracle Database to people who are making a mobile app. I have to admit that I am not very good at it. I have found that I can easily produce Data ...
-1
votes
1answer
54 views

Considerations about returning text instead of JSON in a JSON compliant API [closed]

I'm using Spring-Boot + Jackson to implement a Rest API. When I return some object from my methods the controllers are building a JSON compliant response. However, that's not happening when I return ...
1
vote
1answer
68 views

JsonAPI - Updating the relationship for a resource

I am having trouble understanding http://jsonapi.org/. Say, I have the following endpoints in my API for authors and articles. /authors /authors/:id/articles If I wanted to fetch the ...
0
votes
2answers
50 views

How to model a property with two different formats and ranges

I am designing a JSON based data schema to describe the visual appearance of blocks similar to HTML elements. It should feel familiar for somebody knowledgable in HTML/CSS but is more restrictive due ...
1
vote
0answers
39 views

How are JSON Web Token validators tested?

JSON Web Tokens (JWTs) are an open, industry standard method for representing claims securely between two parties. There are numerous implementations for JWT verification, but it looks like each ...
1
vote
1answer
80 views

Parsing JSON and creating analytics out of the data, what is the best way to do it?

I am on a project where I call an API and I want to make statistics with the data returned. It returns a big .json object. As that is not possible to flatten, and I am not interested on all the data ...
2
votes
2answers
126 views

Why use JSON dataset rather than SQL Query?

A colleague was asking me to explain a system information flow, as they are having problems with the wrong information being presented. It seems that what they have created is a custom built website, ...
0
votes
2answers
31 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
141 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
32 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 ...
2
votes
1answer
134 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
129 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
658 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
107 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
171 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
231 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
101 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
835 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
45 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 ...
3
votes
3answers
350 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
201 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
3answers
419 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
142 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 ...
3
votes
0answers
486 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
391 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
86 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
79 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
2k 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
141 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
140 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
179 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 ...
7
votes
5answers
3k 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
2k 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
256 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
103 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 ...
7
votes
1answer
790 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
2k 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 ...