Skip to content

Enforce strict .ograf.json file extension for manifest files#7

Open
Richardpwe wants to merge 1 commit intoSuperFlyTV:mainfrom
Richardpwe:main
Open

Enforce strict .ograf.json file extension for manifest files#7
Richardpwe wants to merge 1 commit intoSuperFlyTV:mainfrom
Richardpwe:main

Conversation

@Richardpwe
Copy link

Problem

In my opinion the manifest file detection was too permissive and accepted any .json file, leading to false positives where files like lottie-template.json were incorrectly identified as OGraf manifests.

Changes

Updated FileHandler.isManifestFile() to strictly enforce the OGraf specification requirement that manifest files MUST end with .ograf.json.
Before: Accepted any file ending with .manifest, .json, .ograf.json, or .ograf
After: By default, only accepts files ending with .ograf.json (as per spec)

Implementation Details

Inverted the logic of the strict parameter: strict mode is now the default behavior.
Only .ograf.json files are recognized as valid manifests by default Legacy extensions (.manifest, .json, .ograf) are only supported if explicitly passed strict=false.
This aligns with the OGraf specification which states:

"The file name of the manifest file MUST end with .ograf.json (e.g. my-graphic.ograf.json)"

@nytamin
Copy link
Member

nytamin commented Oct 9, 2025

While I agree that the specification defines the manifest file name to be "*.ograf.json", I think that it provides additional value that the DevTool does display legacy manifest files (paired with en error message).

The method isManifestFile only does an initial check to see if the file is "probably" an ograf-manifest file. (It should probably be renamed to isProbablyAManifestFile, on second thought.)

A strict check of the file name is done later in verify.js, any legacy manifest file names will result in a helpful error message displayed, like so:

image

@didikunz
Copy link

While everything concerning verufy.js etc. is correct, it would help to exclude every other json file, that lays around, because it's very confusing, especially if the folder contains a lot of contents.

@Richardpwe
Copy link
Author

@didikunz that was exactly my thought as well.
The main motivation behind this change was to avoid false positives in projects that contain other JSON files besides the manifest, especially Lottie-based templates (like those from StreamShapers or BluePrint), but also many others that include data or configuration JSONs.

So the intention wasn’t to remove legacy support, but simply to ensure that only actual manifest files are picked up by default.

Happy to adjust the logic if we find a better middle ground.

@nytamin
Copy link
Member

nytamin commented Oct 20, 2025

Thanks for clarifying! I'd be happy to adjust the logic of the initial discovey so that it doen't show false positives as much, as long that files that are "probably" ograf-manifests are still included.

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.

3 participants