Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.37 KB

File metadata and controls

54 lines (37 loc) · 1.37 KB

JsonScript

JsonScript(JSS) is a markup language to describe the structure of JSON data.

Together with Sphinx-Docs, JSS provides an easy-and-powerful way to document the structure of JSON data. It has been widely used in our department to document online service for many years.

A Simple Example

To document a JSON file:

{
   "dataVersion" : "NaviInfo.2019.03",
   "routeLength" : 1300.0,
   "eta" : 240
}

We can use a JSS:

/* The brief of a route */
RouteBrief =
{
   dataVersion : "NaviInfo.2019.03",   // the version of the map data
   routeLength : 1300.0,  // The length of the route, in meters
   eta : int  // Estimated Time of Arrival, in seconds.
}

As you can see, literal values are often used instead of types(string, int, float). And it allows adding C++ style comments.

In This Project

This project contains:

Notes

JSS's inspired by DataScript, which is used to describe binary data.

There are other alternatives, like JSON Schema.