Skip to content

feat(amp-config): add JSON schema generation for ampd config#1747

Merged
mitchhs12 merged 2 commits intomainfrom
mitchhs12/gen-config-schema
Feb 13, 2026
Merged

feat(amp-config): add JSON schema generation for ampd config#1747
mitchhs12 merged 2 commits intomainfrom
mitchhs12/gen-config-schema

Conversation

@mitchhs12
Copy link
Contributor

Enable external validation and editor tooling for the ampd TOML config file by generating a JSON schema from Rust types using schemars behind a feature gate.

  • Add amp-config-gen crate with build script that generates schema from ConfigFile
  • Add feature-gated schemars dependency chain across config, worker-core, common, and monitoring crates
  • Implement manual JsonSchema for ConfigDuration, Overflow, and Redacted<T> types
  • Integrate into just gen workflow and add standalone just gen-config-schema target

Closes #1693

@mitchhs12 mitchhs12 marked this pull request as draft February 12, 2026 20:49
@mitchhs12 mitchhs12 force-pushed the mitchhs12/gen-config-schema branch from 7a3cd8e to 0bbf8bc Compare February 12, 2026 20:58
@mitchhs12 mitchhs12 marked this pull request as ready for review February 12, 2026 21:01
Enable external validation and editor tooling for the ampd TOML config file
by generating a JSON schema from Rust types using schemars behind a feature gate.

- Add `amp-config-gen` crate with build script that generates schema from `ConfigFile`
- Add feature-gated `schemars` dependency chain across config, worker-core, common, and monitoring crates
- Implement manual `JsonSchema` for `ConfigDuration`, `Overflow`, and `Redacted<T>` types
- Integrate into `just gen` workflow and add standalone `just gen-config-schema` target

Signed-off-by: Mitchell Spencer <mitchellhspencer@gmail.com>
@mitchhs12 mitchhs12 force-pushed the mitchhs12/gen-config-schema branch from 0bbf8bc to b18f8b5 Compare February 12, 2026 21:02
@mitchhs12 mitchhs12 self-assigned this Feb 12, 2026
Copy link
Contributor

@LNSD LNSD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

Please. Check my comments

Remove redundant explicit feature declarations and improve schema metadata per review.

- Remove redundant `[features] schemars` from `common` and `monitoring` Cargo.toml (implicit feature from `optional = true` suffices)
- Add `default = "default_compression_str"` to compression field schemars attribute
- Add `default_compression_str()` helper to provide serializable default for JSON schema

Signed-off-by: Mitchell Spencer <mitchellhspencer@gmail.com>
@mitchhs12 mitchhs12 force-pushed the mitchhs12/gen-config-schema branch from 376484a to 0d04912 Compare February 13, 2026 18:19
@mitchhs12 mitchhs12 merged commit 3793266 into main Feb 13, 2026
7 checks passed
@mitchhs12 mitchhs12 deleted the mitchhs12/gen-config-schema branch February 13, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate ampd config schema via schemars (schema-rs) and wire into codegen

2 participants