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

Fix external tilesets extensions validation #305

Merged
merged 3 commits into from
Mar 25, 2024

Conversation

javagl
Copy link
Contributor

@javagl javagl commented Mar 25, 2024

There are some open questions and tricky corner cases for the validation of extensionsUsed in a tileset. Some of this is tracked in #231 . But in the current state, this part of the validation contained a clear-cut bug for the validation of the extensionsUsed when it came to external tilesets. Specifically, in this configuration:

  • A tileset.json refers to an external.json
  • The tileset.json contains an VENDOR_example_extension
  • The tileset.json declares the VENDOR_example_extension in its extensionsUsed

In this case, the validator erroneously reported an EXTERNAL_TILESET_VALIDATION_ERROR, stating that

The extension 'VENDOR_example_extension' was found, but not declared in 'extensionsUsed'

This is a bug. The extension does not have to be declared as extensionsUsed in the external tileset when it is only used in the main tileset.

This PR fixes this issue:

When the validation of an external tileset starts, then the 'extensionsFound' (which track the extensions that are actually contained in that tileset) will start with the empty set. It is then filled with the extensions that are found, and checked for consistency with the extensionsUsed only within that external tileset.
Afterwards, the 'extensionsFound' from the external tileset will be added to the 'extensionsFound' of main tileset (because when they are found in an external one, they also have to be declared in the extensionsUsed of the main one).

Further test cases have been added, in order to have a reasonable test coverage for the possible cases. These are summarized in the externalTilesetExtensions/README.md file.

@lilleyse
Copy link
Contributor

Thanks @javagl

@lilleyse lilleyse merged commit 8a3607b into main Mar 25, 2024
2 checks passed
@lilleyse lilleyse deleted the fix-external-tilesets-extensions-validation branch March 25, 2024 15:12
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.

2 participants