-
Notifications
You must be signed in to change notification settings - Fork 54
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
Refactoring replaceRef for definitions and circular references #74
Conversation
If someone could explain the difference between |
It might be renamed at some point...
I don't think most folks are still using schema3 (certainly glTF is not). I don't know why schema3's Although this is a draft, I'd like to point out some important information loss apparent in the tests. For example: main nested-keyword.md
This branch nested-keyword.md
One easy way to spot diffs is to check in your source code changes to git, then issue |
This is obsolete due to a larger refactoring at https://github.com/javagl/wetzel/tree/generate-3dtiles The output of this branch for glTF is actually pretty close to the original output, but it involves too many code changes to immediately become a PR here. |
Does this have anything to do with #81 ? It appears that either |
This is a DRAFT for a somewhat broader refactoring of the
replaceRef
function. (It is based on the state from #71, but that could easily be separated).The current
replaceRef
function has some issues:// TODO: $ref could also be absolute.
The changes in this PR are supposed to address these issues. The implementation now tries to keep track of the replacements that have been done, mainly by storing the references in a "schemaRepository", and to properly substitute definitions even when they are across multiple files.
I added some basic test cases for the new functionality. But further tests will have be be done to verify that other changes in the output, compared to the "golden" state that is checked in, are not just "changes", but actually improvements.
The prominent role of
schema.title
for identifying a schema makes it difficult to track the state that the output is generated from. The role of the (undocumented)schema.typeName
is something that I'll still have to wrap my head around. (And although I'm a bit curious to see how things would collapse when an input schema contained a property calledtypeName
, that's probably something that may not be considered to be important in the near future...)