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

52
votes
12answers
7k views

Can we replace XML with JSON entirely? [closed]

I'm sure lots of developers are familiar with XML and JSON, and they've used both of them. Thus no point in explaining what they are, and what is their purpose, even in brief. If we try to map their ...
23
votes
10answers
4k views

RESTful API design. What should I return if there are no rows?

I'm currently coding an API for a social network with the Slim Framework. My question is: What are the best practices when there are no rows to return in the json structure? Lets say that this call ...
13
votes
6answers
498 views

Is saying “JSON Object” redundant?

If JSON stands for JavaScript Object Notation, then when you say JSON object, aren't you really saying "JavaScript Object Notation Object"? Would saying "JSON string" be more correct? Or would it be ...
12
votes
2answers
1k views

Query language for JSON

I have a server which is returning very big JSON message and my client application is only dependent on part of this response. Client application needs to check if "xyz" property exist in JSON message ...
11
votes
4answers
2k views

Should I include HTML markup in my JSON response?

In an e-commerce site, when adding an item to a cart, I'd like to show a popup window with the options you can choose. Imagine you're ordering an iPod Shuffle and now you have to choose the color and ...
10
votes
5answers
848 views

Should I use JSON just to use JSON

I'm building a blogging site for learning, with a PHP/MySQl back-end. All of the user input is handled with forms sent in POST requests. Will using JSON somehow make it cleaner, or easier to maintain ...
7
votes
9answers
1k views

Is it worth Learning XML as a web developer when JSON is better for AJAX?

Is it worth Learning XML as a web developer when JSON is better for AJAX? or is it better to concentrate on JSON/Javascript for AJAX?
6
votes
7answers
788 views

Is using something other than XML advisable for my configuration file?

I have a small tool I'm designing which would require a configuration file of some sort. The configuration file in my case is really more of a database, but it needs to be lightweight, and if needed ...
6
votes
8answers
843 views

Should all new web projects build their backend based on xml/json result sets? [closed]

If you were building a new Saas project, would it make sense to start with all of the backend services returning xml/json? Because these days you need to build for both the web and mobile devices, ...
6
votes
4answers
614 views

Building a web application that is almost completely rendered by Javascript, while back end only delivers Json. Do or don't?

As a programmer, and taking into account the overall "funness" of the process, I'm tempted to start a project in Sinatra where the back end's sole concern is the logic, and returning a Json API, and ...
6
votes
2answers
198 views

How can I share data across several websites?

I am trying to develop a simple system for sharing data across several websites. Most of them are developed in PHP while some are developed in Wordpress/Drupal. Redundant information is spread across ...
5
votes
3answers
1k views

Can a webservice that uses JSON over POST be classified as RESTful?

Recently I have started using a new(to me) paradigm for web services. I use the controller to accept JSON strings sent over POST, process it and return JSON strings. GET, PUT, DELETE and other methods ...
5
votes
2answers
332 views

Logging in JSON Effect on Performance

I see more and more articles about logging in JSON. You can also find one on NodeJS blog. Why does everyone like it so much? I can only see more operations getting involved: A couple new objects ...
5
votes
2answers
556 views

Proper Use Of HTML Data Attributes

I'm writing several JavaScript plugins that are run automatically when the proper HTML markup is detected on the page. For example, when a tabs class is detected, the tabs plugin is loaded dynamically ...
5
votes
3answers
4k views

Best method of communication between your app and your website? PHP, Web service, etc

I am creating an application which I would like to have communicate with my website. The app will have to get data for a particular app user from the website's database. I am unclear as to the best ...
5
votes
3answers
630 views

Looking for the tool that generated JSON Rail-Road grammar descriptions [closed]

I am currently working on a little language, and I'd like to express its grammar more rigorously. I know about EBNF and it's great to generate parsers (Bison/Yacc), however it's not that easy to ...
4
votes
3answers
2k views

Is it OK to return HTML from a JSON API?

On my current project I am responsible for the implementation of a service which involves the consumption of newly created RESTful APIs, documented as solely supporting JSON. The client consistently ...
4
votes
3answers
2k views

Would a NoSQL DB be more efficient than a relational DB for storing JSON objects?

I am using a library that returns a JSON object (as a string, but I think that's standard), and I would like to store the contents of this object into a local database. I'm fairly fresh-faced in ...
4
votes
4answers
3k views

Always return single objects in an array for REST API JSON payloads?

For a REST API that I am working on, I want to return JSON in a consistent layout: { "Data" : { "Id" : 123, "Email" : "charlie@somewhere.com" "Firstname" : "Charlie", "Surname" ...
4
votes
1answer
642 views

Building a Graph Editor - How to create a data driven graph

I am developing a graph-editor that uses drag and drop to build hierarchical graphs (containing nodes and links). Each node in the graph should be linked to a table in our database (SQL Server). I did ...
4
votes
1answer
246 views

Advice on JavaScript library for visualizing Yahoo Pipe Output

I'm currently writing a JavaScript library. It is a project for school were I need to make it easier to visualize data from Yahoo Pipes. The data format is a JSON string, which can contain anything, ...
3
votes
3answers
282 views

Feedback on this back-end stack

I'm planning to setup an scalable architecture capable of providing web services on a REST interface where JSON will be sent as a result. The web services will be quite simple for a CRUD web 2.0 app. ...
3
votes
2answers
130 views

Shoud I directly return a string message or rather a i18n key when dealing with JSON api?

Suppose a rest api returning this json: { "status" : "fail", "data" : { "title" : "A title is required" } } Since the client application would always adapt the error message, would it be ...
3
votes
2answers
1k views

Why is NoSQL better for this scenario?

Hypothetical scenario: Let's say we are downloading JSON from Facebook with details of a user's friend's checkins, posts, etc... These come in as one document per friend per activity, so with 8 ...
3
votes
4answers
269 views

Making simple forms in web applications [closed]

How do you work with forms in your web applications? I am not talking about RESTful applications, I don't want to build heavy front-end using frameworks like Backbone. For example, I need to add ...
3
votes
2answers
4k views

xml parser vs JSON parser performance in Java / C / C++

I am trying to understand which data format is better on embedded device communicating with Server over REST API. XML or JSON?. Is JSON parsing faster than XML parsing in Java / C and C++? I ...
3
votes
3answers
398 views

Use of Abstract Syntax Notation (ASN.1)

The problem of Electronic Data Interchange over networks is well known and understood. Today, the most common formats for data interchange are things like XML and JSON. There are various pros and ...
3
votes
1answer
1k views

Should web service response use a base class or generic class?

In my RESTful WCF web service I have something like the following response object. public class WebResponse<T> { public bool Success { get; set; } public T Data { get; set; } ...
3
votes
1answer
203 views

Design considerations on JSON schema for scalars with a consistent attachment property

I'm trying to create a JSON schema for the results of doing statistical analysis based on disparate pieces of data. The current schema I have looks something like this: { // Basic key ...
3
votes
1answer
286 views

Is it possible to protect json api scraping using random tokens?

I have built a restful json api for an online store using Laravel. I now wish to create an AngularJS app to run the front-end web application. Product prices for my store need to update every second, ...
3
votes
1answer
67 views

An extensible logging architecture for Android?

The end goal is to have a variety of data sets that can all be graphically plotted against eachother. All data should correspond to a date, so that when plotted against each other, they show the ...
3
votes
1answer
746 views

synchronization web service methodologies or papers

I am building a web service (PHP+JSON) to sync with my iphone app. The main goals are: Backup Provide a web view for printing / sorting, manipulating. allow a group sync up and down. I am aware of ...
2
votes
3answers
7k views

Fastest way to set up a JSON server on my local machine [closed]

I am a front-end developer. For many experiements I do I need to have a server that talks JSON with my client side app. Normally that server is a simple server that response to my POSTs and GETs. For ...
2
votes
4answers
326 views

What arguments can I use to justify the use of either XML or JSON to store and transmit object data?

My project lead considers both of these approaches to be unnecessary overhead. I have been involved in and have witnessed a lot of talk around XML vs JSON, but this is the first time that I have heard ...
2
votes
3answers
656 views

What do you think of this Exception handling practice

I'm working on a project that includes a lot of creating/manipulating and reading JSONObjects and arrays but not in a systematic way. So there is JSON code everywhere. It is ok for me except that ...
2
votes
6answers
222 views

Using a relational database vs JSON objects for event/activity data

I am working on a project where I am trying to decide between using a standard SQL relational database or JSON objects to store data about an event or activity. The project will store data on ...
2
votes
4answers
461 views

Should an API platform enforce only receiving JSON requests?

I am building an API platform. I have already ensured that the platform always returns JSON responses. My question is Should my API platform enforce the rule that all requests must be JSON? What ...
2
votes
2answers
747 views

Which is simpler for REST client call to return JSON - JQuery/JavaScript or Spring RestTemplate? [closed]

I've been trying to hack up an annotated Spring MVC web app but it's proving pretty hard to call a URL of my web app which fires a request to a remote API (UK Police data) and recieves a reply which I ...
2
votes
2answers
1k views

An ideal way to decode JSON documents in C?

Assuming I have an API to consume that uses JSON as a data transmission method, what is an ideal way to decode the JSON returned by each API resource? For example, in Java I'd create a class for each ...
2
votes
1answer
410 views

Pros and cons of sending data from android to php in string and/or json

I have seen some tutorials and some stackoverflow discussions on how to send data from android to php page. most of the cases i have seen people sending data in string format but returning in json ...
2
votes
1answer
420 views

How best to merge/sort/page through tons of JSON arrays?

Here's the scenario: Say you have millions of JSON documents stored as text files. Each JSON document is an array of "activity" objects, each of which contain a "created_datetime" attribute. What is ...
2
votes
1answer
94 views

Naming library which generates a JSON-req to a REST-API?

How would you call a library which generates a JSON-req to a REST-API so that you just work on object-level for creating a request? Many company wants to define it as an SDK, but is it a suitable ...
2
votes
2answers
333 views

How to get around the Circular Reference issue with JSON and Entity

I have been experimenting with creating a website that leverages MVC with JSON for my presentation layer and Entity framework for data model/database. My Issue comes into play with serializing my ...
2
votes
1answer
231 views

Use a search box that calls on a JSON file? [closed]

I use a JSON file to populate several drop down lists. The format is: { "value" :"lightyear", "name" :"Light Year(yl)" }, { "value" :"astronomicalUnit", ...
2
votes
1answer
3k views

Automatically adding data from JSON to SQL

I'm really new to this sort of stuff; my background is in C# mainly. Could anyone point me in the right direction? I need to set a script to automatically parse some JSON into an SQL database ...
2
votes
1answer
184 views

Consuming JSON stream into AWS Database on the cheap [closed]

I'm working on a project that needs to consume a JSON stream (approximately 1MB / minute), and parse and insert objects into a database. Amazon's DynamoDB or SimpleDB seem like attractive options for ...
1
vote
2answers
249 views

XML/HTML: Do we need the element name in closing tags?

Compared to other serialization languages, one of the main criticisms directed at XML is its verbosity; JSON's more terse and readable for most cases, but not all. But it seems to me that we could ...
1
vote
2answers
1k views

Is it wise to store a big lump of json on a database row

I have this project which stores product details from amazon into the database. Just to give you an idea on how big it is: [{"title":"Genetic Engineering (Opposing ...
1
vote
4answers
258 views

Why returning XML/JSON for API requests, can't we just directly process request and return the modified web page (HTML/CSS/JS)?

Let's say that a user requests for some piece of data. Usually the data is processed via a server and then returned in XML/JSON format. Im guessing another piece of processing happens to convert it ...
1
vote
2answers
275 views

JSON vs Foreign Keys

I'm developing an enterprise website, and I have to define some sections like this: I have many sections and each section have many (or one) sub-pages. The number of sub-pages vary per section. ...