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.
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.
This project contains:
JSS's inspired by DataScript, which is used to describe binary data.
There are other alternatives, like JSON Schema.