Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for validating single content files #285

Merged
merged 9 commits into from
Oct 16, 2023

Conversation

javagl
Copy link
Contributor

@javagl javagl commented Oct 12, 2023

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 a CONTENT_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 a tileContentsDirectory to validate all files in a directory. But ... this could easily be misused. For example: When running this on a directory that contains a tileset.json that refers to all files, then all files would be validated twice, once as "input files", and once as "contents of the tileset.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.

@javagl
Copy link
Contributor Author

javagl commented Oct 16, 2023

This has been updated to build on #284 (even though it is largely independent of the actual validation functionality, and only affects the CLI), and the README.md has been updated with an example of the new CLI command.

@javagl javagl marked this pull request as ready for review October 16, 2023 14:32
@lilleyse lilleyse merged commit 3b3e32b into main Oct 16, 2023
2 checks passed
@lilleyse lilleyse deleted the cli-content-file-validation branch October 16, 2023 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow validation of tile content files
2 participants