-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Consistent JSON schema version for core and extensions #2049
Comments
Yes, the extension specs need to be upgraded:
|
I'm trying to get a bit up to date with the latest schema, and I hope that the following is closely enough related to this topic that it is OK to bring that up here: Section https://json-schema.org/understanding-json-schema/structuring.html#id says
Right now, the Similarly, section https://json-schema.org/understanding-json-schema/structuring.html#ref points out
This can be a problem for the extensions (even though they are not "anonymous" - they only refer to a different context than the one that is implied by their base URL). Specifically, I wondered whether extensions that currently contain relative references like
should actually contain absolute references. Again, imagining the full path there ...
looks a bit strange, but could be justified: If someone placed his own |
For now, I'd say that extension schema files are "located" in the same folder as the core schema files for the purposes of reference resolution. Long-term, we should plan for exposing all of them with absolute URIs on the https://schema.khronos.org/ website. |
For what it's worth, VSCode goes the extra mile and links the core schema out to the extension schemas in the appropriate places. For example the core "material" schema is shown here referencing material extensions, which allows VSCode's auto-complete, hover tooltips, and schema validation to find these extended schemas even while validating starting from the root. These modified schemas are auto-generated by a tool that resolves all the paths while placing the extensions in subfolders. There is a map of which extensions plug in where. I did a quick test to ensure that this tool continues to work with 2020-12, and it does, although I have not yet pushed a new version of its output to GitHub. |
Also for what it's worth, I have no plans to convert VSCode to use absolute references back to GitHub. For my users' purposes VSCode needs to be able to function disconnected from the Internet, validating schemas against local copies only. |
I also don't like the absolute paths, but when they can just be the |
The JSON-Schema |
@emackey
|
Sounds good. Do whatever is right for glTF spec in general here, of course. Later I'll check how the VSCode implementation handles this, and if it doesn't work I'll adapt it using the schema importer script that's already adapting the local path references. |
As a 'bump' due to several related issues and discussions:
And derived from that: Will there be guidelines for how the schema should be structured, in terms of 'best practices'? Regarding the update of the extensions to |
2 yeas past. Still expecting this change. I want to generate extensions' typescript declaration files from schemas. Currently the relative |
There are different workarounds for that.
But... of course, having the schemas published in https://schema.khronos.org/ would be preferable... |
@shrinktofit This isn't official, but check out my own copy of the glTF schemas that I use with VSCode here: https://github.com/AnalyticalGraphicsInc/gltf-vscode/tree/master/schemas/gltf-2.0 The above schemas are auto-generated from the official ones with some transformations applied by a NodeJS script, causing the extensions to be fully wired into the main schema. The process is described in more detail here: https://github.com/AnalyticalGraphicsInc/gltf-vscode/tree/master/util I think you could generate Typescript defs from there, and they would be compatible. |
The JSON Schema version of the core specification has been updated from
draft-04
todraft/2020-12
(via #2031 and #2034).This raises some questions about the consistency of the specification. The core specification now uses
draft/2020-12
, whereas the extensions usually usedraft-04
. Without any guidelines or further actions, this could cause considerable fragmentation and inconsistencies.Will the existing extension specifications be updated to also use
draft/2020-12
? (Who will do that, and how?)Is there any guideline for the schema versions that extension specifications should use? (The section at https://github.com/KhronosGroup/glTF/tree/main/extensions#creating-extensions does not say anything).
The text was updated successfully, but these errors were encountered: