jsonargparse icon indicating copy to clipboard operation
jsonargparse copied to clipboard

Adding possibility to generate a json schema file when calling jsonargparse.ArgumentParser.save

Open martinResearch opened this issue 1 year ago • 2 comments

🚀 Feature request

Add option to generate a json schema alongside the json file when calling jsonargparse.ArgumentParser.save and link to that schema file in the default config json file using the "$schema" key.

Motivation

When I edit json configuration files, it is error prone. I can do spelling mistakes, I do not know what filed are optional, what the possible values for enums are etc.

Pitch

It would be nice if we could generate a json schema alongside the json file when calling jsonargparse.ArgumentParser.save and link to that schema file in the default config json file using the "$schema" key. This would enable the use of a plugin like Json Schema validator in vs code to get auto-completion and validation directly when editing the configuration file.

martinResearch avatar Nov 08 '24 10:11 martinResearch