-
Notifications
You must be signed in to change notification settings - Fork 8
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
Allow unknown shapes/layers #47
base: main
Are you sure you want to change the base?
Conversation
Re-opening this for comments and will address doc generation breakages if people approve this approach. Doc breakages have some assumptions around fields in the shape and that all shapes should be present in the doc. Will need to investigate more how to fix these. |
perhaps the values could be generated? |
Probably somewhere in the generation scripts, I'm not too familiar with those if you have any pointers on this. There are ~15 shapes/layers on https://lottiefiles.github.io/lottie-docs/ that are not added, I originally thought it was only a few but given that number, it may be worth it. Note, running the schema on a sample animation should catch issues with forgetting to update this enum as the new shape would now pass two schemas in the oneOf and fail validation. |
json_data: dict, | ||
path_parts | ||
): | ||
objects = ts.from_path(SchemaPath("#/$defs/" + "/".join(path_parts))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd pass ts
as an argument rather than referencing the global object (or alternatively pass objects
as argument)
Allow for unknown shapes and layers by adding an unknown element that has a type we don't know about.
This allows for animations to have shapes and layers that are not currently specced and still pass schema validation. This is useful for features we know we won't get to in 1.0 (such as text) or any future features in the RFC process.
There will be some toil to keep the list of unknown types updated as new shapes and layers are added, but I couldn't figure out a way to avoid that.