#12883·cargo

Publish `.cargo/config.toml` jsonschema to `schemastore.org` for editor

Author: loynoirCreated Oct 27, 2023Updated Sep 16, 2026
LabelsA-configurationC-feature-requestS-needs-design

Problem

.cargo/config.toml does not have jsonshema.

So editor can not use schemastore to support tab-completion and validation.

Proposed Solution

cargo team implement jsonschema, publish and maintain related jsonschema in https://github.com/SchemaStore/schemastore.

So editor can use schemastore to support tab-completion and validation.

Tasks

  • #14683
    • To generate the manifest.schema.json file, under the crates/cargo-util-schemas directory, run
      bash
      SNAPSHOTS=overwrite cargo test -F unstable-schema dump_manifest_schema
  • Add a config mod to cargo-util-schemas that has a top-level struct and re-exports any types shared with other parts of the crate, generating a schema
  • Migrate what structs we can from Cargo to cargo-util-schemas, being careful of non-trivial types, particularly InternedString

Future possibilities

  • Similarly migrate the Index and cargo metadata into their respective mods in cargo-util-schemas

Notes

  • doc

https://doc.rust-lang.org/cargo/reference/config.html

  • vcpkg

https://github.com/microsoft/vcpkg/issues/34706