data-models

FIWARE Data Model validator

FIWARE Data Model validator is an utility to help the management of NGSI DataModels. Its code leverage on the AJV JSON Schema Validator.

The FIWARE Data Model validator perform the following checks for each Data Model:

Install the validator

To install the validator on your machine, you need Node.js 7.0.0+. Instructions on how to install Node.js are available here.

Once Node.js installed in your system, you can install the validator with the following command:

npm install -g fiware-model-validator

Using the validator

To use the validator, execute it from the root of the DataModel repository:

validate -p DataModel -w ignore -i [common-schema.json,geometry-schema.json]

Command-line available options are:

If you want to execute validate outside the root directory and you want to import the common schemas, you have to import them using the correct path.

If you experience un expected behaviours, you can check the process using the debug functionality, e.g.:

DEBUG=* validate -p .

Default configuration

For a more fine grained configuration you can create a config.json file. An example is provided in the repository.

Options available are:

Compiling the validator

Should you want to change the code of the validator, to install your modified version, you simply need to compile it with the following command:

npm install -g