From 9939c79fb9c7352df37ec30580cdf102593179c2 Mon Sep 17 00:00:00 2001 From: LisaRivalin Date: Tue, 26 Mar 2019 14:04:31 -0700 Subject: [PATCH] Added JSON schema description to 8.2.2 of the Specification document (for #58) --- specification/source/codeGeneration.rst | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/specification/source/codeGeneration.rst b/specification/source/codeGeneration.rst index bf86945e..91478070 100644 --- a/specification/source/codeGeneration.rst +++ b/specification/source/codeGeneration.rst @@ -228,8 +228,23 @@ until only elementary CDL blocks are present in the JSON file. Various examples of CDL converted to JSON can be found at https://github.com/lbl-srg/modelica-json/tree/master/test/FromModelica. -.. todo:: Add a JSON-schema definition for the simplified JSON representation, - see http://json-schema.org. +The simplified JSON representation of a CDL sequence must be compliant with the +corresponding JSON Schema. A JSON Schema describes the data format and file structure, +lists the required or optional properties, and set limitations on values such as +patterns for strings or extremums for numbers. + +The raw CDL Schema can be found `here `_ . + +`modelica-json `_ automatically tests +the JSON representation parsed from a CDL file against the schema right after its +generation. + +The validation of an existing JSON representation of a CDL file against the schema +can be done executing the command : + +.. code-block:: bash + + node modelica-json/validation.js -f filename.json .. _sec_cdl_ssp: