Fix external tilesets extensions validation #305
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.
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 theextensionsUsed
when it came to external tilesets. Specifically, in this configuration:tileset.json
refers to anexternal.json
tileset.json
contains anVENDOR_example_extension
tileset.json
declares theVENDOR_example_extension
in itsextensionsUsed
In this case, the validator erroneously reported an
EXTERNAL_TILESET_VALIDATION_ERROR
, stating thatThis 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.