Parts of 3D Tiles, such as tileset.json, Feature Table, and Batch Table, are represented with JSON. The JSON schema is defined using JSON Schema draft v4 in schema subdirectories.
A JSON object can be validated against the schema using a JSON schema validator such as Ajv: Another JSON Schema Validator, which supports JSON Schema draft v4. A command-line tool is available on npm as ajv-cli.
Validating against the schema does not prove full compliance with the 3D Tiles specification since not all requirements can be represented with JSON schema. For full compliance validation, see 3d-tiles-tools.
- Install :
npm install ajv-cli -g
- Validate :
ajv -s schema/i3dm.featureTable.schema.json -r schema/featureTable.schema.json -d examples/i3dm.featureTable.json
- The
-s
flag points to the schema you want to use for validation. - Multiple
-r
flags includes any external dependencies for the schema. - The
-d
flag points to the JSON to validate.