Enforce strict .ograf.json file extension for manifest files#7
Enforce strict .ograf.json file extension for manifest files#7Richardpwe wants to merge 1 commit intoSuperFlyTV:mainfrom
Conversation
|
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 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:
|
|
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. |
|
@didikunz that was exactly my thought as well. 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. |
|
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. |

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: