diff --git a/src/api2/access/domain.rs b/src/api2/access/domain.rs index 2b082939..a2fd746d 100644 --- a/src/api2/access/domain.rs +++ b/src/api2/access/domain.rs @@ -18,8 +18,7 @@ use crate::api2::types::*; description: "User configuration (without password).", properties: { realm: { - description: "Realm ID.", - type: String, + schema: REALM_ID_SCHEMA, }, comment: { schema: SINGLE_LINE_COMMENT_SCHEMA, diff --git a/src/api2/types/mod.rs b/src/api2/types/mod.rs index 2838a609..9d24f620 100644 --- a/src/api2/types/mod.rs +++ b/src/api2/types/mod.rs @@ -514,6 +514,12 @@ pub const BLOCKDEVICE_NAME_SCHEMA: Schema = StringSchema::new("Block device name .max_length(64) .schema(); +pub const REALM_ID_SCHEMA: Schema = StringSchema::new("Realm name.") + .format(&PROXMOX_SAFE_ID_FORMAT) + .min_length(2) + .max_length(32) + .schema(); + // Complex type definitions #[api(