Skip to content
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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

b-wils
Copy link
Contributor

@b-wils b-wils commented May 30, 2024

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.

@b-wils b-wils closed this May 30, 2024
@b-wils b-wils reopened this May 30, 2024
@b-wils
Copy link
Contributor Author

b-wils commented May 30, 2024

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.

@mbasaglia
Copy link
Member

perhaps the values could be generated?

@b-wils
Copy link
Contributor Author

b-wils commented May 30, 2024

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.

@b-wils b-wils modified the milestone: 1.0 Jul 2, 2024
@b-wils b-wils requested a review from mbasaglia July 2, 2024 17:48
@b-wils b-wils marked this pull request as draft July 3, 2024 20:09
json_data: dict,
path_parts
):
objects = ts.from_path(SchemaPath("#/$defs/" + "/".join(path_parts)))
Copy link
Member

@mbasaglia mbasaglia Jul 4, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants