metalbear-co / mirrord

Connect your local process and your cloud environment, and run local code in cloud conditions.
https://mirrord.dev
MIT License
3.58k stars 98 forks source link

Validate JSON snippets in `configuration.md` (or directly in the rust docs) #2525

Open t4lz opened 2 weeks ago

t4lz commented 2 weeks ago

We generate the documentation for mirrord's configuration from the doc comments in the rust code of the configuration, using medschool.

In this documentation, we usually include examples in the form of JSON.

Currently there is nothing preventing us from including invalid JSON file snippets in this documentation. Those invalid snippets then make it into configuration.md via medschool, and at some point into https://github.com/metalbear-co/mirrord.dev.

It would be nice to have a validation mechanism that would prevent us from merging invalid JSON snippets into main.

We could also consider validating the one full mirrord configuration at the top of the documentation against our JSON schema, to make sure it is always valid and up to date, even when we make changes to our configuration schema. But this should probably be a separate PR at a later time.