Skip to content

Latest commit

 

History

History
82 lines (61 loc) · 2.39 KB

README.md

File metadata and controls

82 lines (61 loc) · 2.39 KB

motation-spec

Validate Locally (Command Line)

Using this project: https://github.com/ajv-validator/ajv-cli

Installation in Linux (Ubuntu 20.04)

Install Node.js and npm from the Ubuntu repository

  sudo apt update
  sudo apt install nodejs npm

Install ajv-cli

  npm install -g ajv-cli

Test if tool was successfully installed

  ajv help

Troubleshoot:

If you get this error:

npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'

Follow the steps on this specific answer (not the accepted, but this one): https://stackoverflow.com/a/55274930

Validating JSON with ajv-cli

From the project root directory:

Motation

  ajv validate --strict=false -s ./schema/motation-schema.json -r ./schema/common-schema.json -r ./schema/content-schema.json -d ./examples/motation/example-motation.json

category

  ajv validate --strict=false -s ./schema/category-motation-dependency-schema.json -r ./schema/common-schema.json -d ./examples/motation/example-category-motation-dependency.json

definition

  ajv validate --strict=false -s ./schema/definition-motation-dependency-schema.json -r ./schema/common-schema.json -d ./examples/motation/example-definition-motation-dependency.json

domain

  ajv validate --strict=false -s ./schema/domain-motation-dependency-schema.json -r ./schema/common-schema.json -d ./examples/motation/example-domain-motation-dependency.json

folder

  ajv validate --strict=false -s ./schema/folder-motation-dependency-schema.json -r ./schema/common-schema.json -d ./examples/motation/example-folder-motation-dependency.json

language

  ajv validate --strict=false -s ./schema/language-motation-dependency-schema.json -r ./schema/common-schema.json -d ./examples/motation/example-language-motation-dependency.json

relationship

  ajv validate --strict=false -s ./schema/relationship-motation-dependency-schema.json -r ./schema/common-schema.json -d ./examples/motation/example-relationship-motation-dependency.json

tag

  ajv validate --strict=false -s ./schema/tag-motation-dependency-schema.json -r ./schema/common-schema.json -d ./examples/motation/example-tag-motation-dependency.json