node-convict icon indicating copy to clipboard operation
node-convict copied to clipboard

Create a JSON schema for the config file format so that tooling can verify convict JSON

Open markFromMST opened this issue 6 years ago • 2 comments

If you leave out a default on an item in the convict JSON, it will not work. If there was a schema that defined a proper convict JSON file that included defining that default is mandatory, and that doc, format, env are whatever they should be in terms of optional/required and also type, then editors such as WebStorm could be used to edit the JSON and verify it and assist with writing it correctly (WebStorm allows you to configure JSON schema). Also, verification checks could be run in build systems using the same schema to verify that a convict JSON file was written correctly which would help those not using WebStorm.

A tutorial on JSON schemas can be found here: http://json-schema.org/example1.html

markFromMST avatar Oct 19 '17 15:10 markFromMST

Hello @markFromMST, are you talking about a generic Convict JSON schema that would match any config file, or about a dynamic generation of a JSON schema for each given config format?

Sorry for the long delay in answering and everything. Time is too short 😕

madarche avatar Jan 07 '18 09:01 madarche

https://json-schema.org/implementations.html#utilities

A-312 avatar Apr 11 '20 05:04 A-312