feat: add zeroclaw config schema for JSON Schema export
Add a `config schema` subcommand that dumps the full configuration schema as JSON Schema (draft 2020-12) to stdout. This enables downstream consumers (like PankoAgent) to programmatically validate configs, generate forms, and stay in sync with zeroclaw's evolving config surface without hand-maintaining copies of the schema. - Add schemars 1.2 dependency and derive JsonSchema on all config structs/enums (schema.rs, policy.rs, email_channel.rs) - Add `Config` subcommand group with `Schema` sub-command - Output is valid JSON Schema with $defs for all 56 config types
This commit is contained in:
parent
d44dc5a048
commit
996f66b6a7
6 changed files with 156 additions and 63 deletions
|
|
@ -20,6 +20,7 @@ use lettre::{Message, SmtpTransport, Transport};
|
|||
use mail_parser::{MessageParser, MimeHeaders};
|
||||
use rustls::{ClientConfig, RootCertStore};
|
||||
use rustls_pki_types::DnsName;
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashSet;
|
||||
use std::sync::Arc;
|
||||
|
|
@ -35,7 +36,7 @@ use uuid::Uuid;
|
|||
use super::traits::{Channel, ChannelMessage, SendMessage};
|
||||
|
||||
/// Email channel configuration
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
|
||||
pub struct EmailConfig {
|
||||
/// IMAP server hostname
|
||||
pub imap_host: String,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue