mirror of
https://github.com/telemt/telemt.git
synced 2026-11-22 23:36:36 +03:00
API: add dry-run validation with change preview and runtime guards
This commit is contained in:
@@ -104,6 +104,14 @@ pub(in crate::api) fn config_schema() -> Result<&'static ConfigSchemaData, ApiFa
|
||||
.map_err(|error| ApiFailure::internal(error.clone()))
|
||||
}
|
||||
|
||||
pub(super) fn field_paths() -> Result<Vec<&'static str>, ApiFailure> {
|
||||
Ok(config_schema()?
|
||||
.fields
|
||||
.iter()
|
||||
.map(|field| field.spec.path.as_str())
|
||||
.collect())
|
||||
}
|
||||
|
||||
fn field_specs() -> Result<Vec<FieldSpec>, String> {
|
||||
serde_json::from_str(include_str!("fields.json"))
|
||||
.map_err(|error| format!("invalid compiled config field catalog: {error}"))
|
||||
|
||||
Reference in New Issue
Block a user