Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
cli: `rad config schema` emits JSON Schema
Merged did:key:z6MkjFMA...eQnJ opened 1 year ago

Leverage schemars to generate a JSON Schema from our structs for configurations and those occurring within them.

Regarding dependency on an alpha version of schemars: Reading the road to 1.0 issue I don’t expect that we would be affected by breakage. We use pretty standard/core parts of the API that probably are most stable.

The output of rad config schema can be used by editors to provide a smoother editing experience for the configuration file. Discovery of attributes (both keys and values) is greatly improved with the schema helping in the background.

Refer to:

  • https://json-schema.org
  • https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings
  • https://schemastore.org

Original description by did:key:z6MkjFMAoA3hUG6tM7Wprn7dh7bquLpmN1f3yECbwkyweQnJ follows:

This will be a great addition especially for LSP users who dont want to read through all the code to know what options can be changed where and how.

How it works: You simply pipe the output into xyz.json and then add to your config: “$schema”: “/path/to/xyz.json” and if you have a working json LSP you’ll get docs, etc. for your config, meaning we’ll have to write a lot less docs in the future :)

did:key:z6MkjFMA...eQnJ opened with revision 839d70f9 on base f30760d6 +132 -29 1 year ago

Leverage schemars to generate a JSON Schema from our structs for configurations and those occurring within them.

Regarding dependency on an alpha version of schemars: Reading the road to 1.0 issue I don’t expect that we would be affected by breakage. We use pretty standard/core parts of the API that probably are most stable.

The output of rad config schema can be used by editors to provide a smoother editing experience for the configuration file. Discovery of attributes (both keys and values) is greatly improved with the schema helping in the background.

Refer to:

  • https://json-schema.org
  • https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings
  • https://schemastore.org

Original description by did:key:z6MkjFMAoA3hUG6tM7Wprn7dh7bquLpmN1f3yECbwkyweQnJ follows:

This will be a great addition especially for LSP users who dont want to read through all the code to know what options can be changed where and how.

How it works: You simply pipe the output into xyz.json and then add to your config: “$schema”: “/path/to/xyz.json” and if you have a working json LSP you’ll get docs, etc. for your config, meaning we’ll have to write a lot less docs in the future :)

did:key:z6MkjFMA...eQnJ commented on revision 1 0 years ago

thanks a lot for your improvements lorenz

lorenz pushed revision 2 a854a147 on base f30760d6 +1031 -63 0 years ago
did:key:z6MkjFMA...eQnJ commented on revision 1 11 months ago

thanks a lot for your improvements

lorenz pushed revision 3 ac6787bb on base 41f9048d +1062 -59 11 months ago

Make schemars an optional dependency.

fintohaps pushed revision 4 98bf6dfe on base 5a2f26ea +1062 -59 11 months ago

Rebased

fintohaps pushed revision 5 15fcad6e on base 5a2f26ea +1062 -59 11 months ago

Changes:

  • Small fix to spacing in radicle/Cargo.toml
fintohaps merged revision 15fcad6e at b608a788 11 months ago