-
Notifications
You must be signed in to change notification settings - Fork 155
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
Drafts for extensions validation #230
Conversation
A short brain dump: Some questions for the validation of extensions are not trivial to answer, and the S2 bounding volume extension (fortunately?) shows some of them. The initial approach sketched above was:
This does not sensibly cover the case that there is a bounding volume that has the S2 bounding volume and a
I.e. it should only skip the More generically, it's hard or impossible to define exactly which aspect of the default validation should be omitted due to the presence of an extension. One "obvious" way of tackling this is:
This still raises questions for the more general case, or for future extensions. For example, consider a future
I'd like to avoid constraining what extensions are allowed to do - except for that extensions may not cause a valid object to become invalid. But considering all possible ways of how an extension may cause an (otherwise) invalid object to become valid (and how this affects the overall validation process) is not entirely trivial. I'll update this PR soon, but wanted to sort my thoughts here. |
Instead of validating onyl the actual extensions, it now validates the extended objects (including the extensions).
The current state contains a basic implementation of a plugin concept for validating extensions, and various cleanups and generalizations for further working towards that goal. There are two high-level points that are part of this PR: It is possible to register a
(Note that this is a validator for the objects that contain the extensions. and not for the extension objects themself - although the validation of these objects should be part of the registered validator, of course). Whenever the validator encounters an object that may contain extensions, it passes it to the One example of such a validator is the Note: This sort of validation has a scope that is still too narrow. There are some forms of extensions and associated validation that can not be covered with this approach:
The last point (namely, extensions that refer to content types) was the reason for another generalization that is applied in this PR. Until now, the There now is a An example for how the current set of content data validators is registered is shown in the current state of the The actual Note: There are still a few questions that are not fully resolved. One question is about the connection between 1. an extension that allows a new content type and 2. the actual validator for that new content type. Roughly:
The latter is particularly difficult for JSON-based content types. Iff we already had 3D Tiles 2.0, then a valid 3D Tiles 2.0 file (with |
A basic infrastructure for the validation for extended objects (and extensions) is added with this PR. There are still some open questions about the interface of how certain types of extension validators will be added or registered. Edit: These questions are now summarized in #227 (comment) |
Addressing #227 : This PR adds a mechanism for adding validators for extensions. Some technical details are described in the issue, and still have to be resolved here.
This is only a basic draft, with support for the
3DTILES_bounding_volume_S2
extension: By default, a tileset with S2 bounding volumes would cause a validation issue, because the bounding volume neither has neitherbox
,region
, norsphere
. But with the extensions validation support, it would be possible to register a validator for S2 bounding volumes. The registration is currently drafted like this:And afterwards, the original issue would no longer be reported. Instead, it would report validation issues for the S2 bounding volumes accordingly - like
S2_TOKEN_INVALID
or so...Adding a general support for extensions will require some refactorings of the current validator state. These refactorings should be "small" in terms of the amount of code that has to be changed, but they may affect the interfaces, and therefore several parts of the code. Further technical details will be added here soon.