Add support for validating single content files #285
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #283 :
This adds a
--tileContentFile
command line argument for validating single content files (that are not part of a tileset JSON). For example,npx ts-node .\src\main.ts --tileContentFile ./specs/data/tilesets/tiles/glTF/TriangleWithWarnings/TriangleWithWarnings.gltf
will generate a report including the warnings from the glTF validator.
The function will just call the "content validation" infrastructure that is otherwise used for the
content.uri
fields of the tileset JSON. So it will support all "known" content types (and create aCONTENT_VALIDATION_WARNING
for content types that are not supported).The fact that this function can also be applied to tileset JSON files is... 😬 ... well, a result of the fact that tileset JSON files also are tile content.
We could consider to build a larger infrastructure around this. For example: Right now, there's also the
tilesetsDirectory
option that validates all tilesets in a directory. And we could consider adding atileContentsDirectory
to validate all files in a directory. But ... this could easily be misused. For example: When running this on a directory that contains atileset.json
that refers to all files, then all files would be validated twice, once as "input files", and once as "contents of thetileset.json
". Given the primary goal of this function (to validate glTFs with metadata extensions, after #280 ), the scope could/should be limited to single files for now.To do (in the current state): Update the README.md with documentation for the new command line option.