Skip to content

Commit 4ea4de4

Browse files
committed
fix(api-types): Allow empty domain description
description is Option<String>; validator's length(min=1) fired on Some("") the same as an actual too-short value, rejecting the empty string devstack sends on its idempotent domain-create/update calls with a 400. Drop the min bound, keep max=255. Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
1 parent 2137281 commit 4ea4de4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

crates/api-types/src/v3/domain.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub struct Domain {
6161
/// The description of the domain.
6262
#[cfg_attr(feature = "builder", builder(default))]
6363
#[serde(skip_serializing_if = "Option::is_none")]
64-
#[cfg_attr(feature = "validate", validate(length(min = 1, max = 255)))]
64+
#[cfg_attr(feature = "validate", validate(length(max = 255)))]
6565
pub description: Option<String>,
6666

6767
/// If set to true, domain is enabled. If set to false, domain is disabled.
@@ -105,7 +105,7 @@ pub struct Domain {
105105
pub struct DomainCreate {
106106
/// The description of the domain.
107107
#[cfg_attr(feature = "builder", builder(default))]
108-
#[cfg_attr(feature = "validate", validate(length(min = 1, max = 255)))]
108+
#[cfg_attr(feature = "validate", validate(length(max = 255)))]
109109
#[serde(skip_serializing_if = "Option::is_none")]
110110
pub description: Option<String>,
111111

@@ -174,7 +174,7 @@ pub struct DomainCreateRequest {
174174
pub struct DomainUpdate {
175175
/// The description of the domain.
176176
#[cfg_attr(feature = "builder", builder(default))]
177-
#[cfg_attr(feature = "validate", validate(length(min = 1, max = 255)))]
177+
#[cfg_attr(feature = "validate", validate(length(max = 255)))]
178178
pub description: Option<String>,
179179

180180
/// If set to true, domain is enabled. If set to false, domain is disabled.

0 commit comments

Comments
 (0)