-
Notifications
You must be signed in to change notification settings - Fork 63
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
Unclear messages in corner cases #68
Comments
The second message is "expected" although an unfortunate side-effect of an early design decision. Early on I wanted this project to handle both glTF 1.0 and 2.0 schemas, but, VSCode's JSON validation has but a single contribution point, and there's no way for a VSCode extension at runtime to control which of two different schemas gets applied. Thus, "the Chooser" was born. Behold and weep:
With this construct in play, a glTF file in VSCode must match enough of one of the glTF schemas that VSCode's built-in JSON validation can figure out which of the two schemas is being used. For "real-world" files, this isn't a problem, because almost every child of root is an object in 1.0 and an array in 2.0. So the moment any real content is added to the file, the choice of schema becomes clear. Although we've added the official validator, I still need to keep the "dumb" JSON schema validation around for now, because it supplies hover-descriptions, enum auto-completion, etc., and it's the only way to validate glTF 1.0. Sometimes, if you commit a simple JSON schema violation in VSCode, you'll see duplicate error messages, one marked As for the first message, that one comes directly from server.ts on this line. The "glTF Language Server" built-in to this extension is attempting to parse the JSON document, which it needs to do to gather a map of JSON pointers to document locations. It won't even call the glTF Validator if this parsing fails, and instead just reports its own error, since it knows it wouldn't be able to make heads or tails of anything reported by the validator. This one does get marked If needed, we could change the |
Could
{
"asset": {
"version": "2.0"
},
"extensionsUsed": [
"EXT_demo"
],
"extensions": {
"EXT_demo": {}
}
}
No strong opinion here. Users don't have to precisely understand internal layers of validation routines. |
The 1.0 schema didn't require |
|
I tried hand-editing my copy of the glTF 1.0 schema to have a
Unfortunately this doesn't seem to work. Your |
That's because our v1
v2 "version" : {
"type" : "string",
"description" : "The glTF version that this asset targets.",
"pattern" : "^2\\.[0-9]+$"
}, Your snippet above seems to be from |
Doh. That's the problem. |
Fixing this upstream in KhronosGroup/glTF#1168. |
Published as |
Output on totally empty file shouldn't be attributed to glTF Validator:
Output on an asset with version
2.1
:The text was updated successfully, but these errors were encountered: