webdoc-labs / webdoc

Documentation generator for the web
https://www.webdoclabs.com
Other
79 stars 9 forks source link

Add JSON Schema for the CLI config object #87

Closed lazarljubenovic closed 2 years ago

lazarljubenovic commented 3 years ago

Currently we just hope that the developer provided a valid configuration object, without checking it. We should add a runtime check for this, and throw a nice error. As is, providing the configuration to the CLI is prone to typos and difficult-to-debug missing behaviors, given that there's no autocomplete in IDEs for the webdoc.conf.json file.

Both of these issues can be solved by providing and exposing a JSON schema -- IDEs could use it to autocomplete and show hints to the developer, and we could use it internally to validate the object against it. It's also a universal documentation language which serves as the source of truth for what the configuration should and shouldn't contain.

ShukantPal commented 2 years ago

Thanks @lazarljubenovic - will go out in 2.0.0