airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validating JSON Files as Lottie Animations

kkatsi opened this issue · comments

Hey!

I'm trying to figure out a straightforward way to confirm/validate if a JSON file is actually a Lottie animation using js. One idea I had is to check for certain key properties like "v", "w", "h", "fr", and "layers", but it doesn't sound safe enough.

Would love to hear any suggestions or thoughts on this. Thanks!

For a very fast validation the approach you suggested should work fine. We use the same at LottieFiles for the first layer of checks.

For more in-depth validation, there are a few options