pub struct FieldConstraint {
pub field: String,
pub min: Option<u64>,
pub max: Option<u64>,
pub pattern: Option<String>,
pub enum_values: Vec<String>,
pub required: bool,
pub is_uuid: bool,
pub is_numeric: bool,
pub signed_min: Option<i64>,
pub signed_max: Option<i64>,
}Expand description
A single field’s validation constraints, mapped to JSON Schema.
Fields§
§field: StringField name in camelCase (gnostic output format).
min: Option<u64>minLength for strings, minimum for integers.
max: Option<u64>maxLength for strings, maximum for integers.
pattern: Option<String>Regex pattern (from validate.rules.string.pattern).
enum_values: Vec<String>Enum of allowed string values (from validate.rules.string.in).
required: boolWhether this is a message.required field → goes into schema required array.
is_uuid: boolWhether this is a UUID field (from validate.rules.string.uuid = true).
is_numeric: boolProto field type: true if numeric (int32/uint32/uint64), false if string.
signed_min: Option<i64>minimum for signed integers (int32). Mutually exclusive with min.
When present, the JSON Schema should use this instead of min.
signed_max: Option<i64>maximum for signed integers (int32). Mutually exclusive with max.
When present, the JSON Schema should use this instead of max.
Trait Implementations§
Source§impl Clone for FieldConstraint
impl Clone for FieldConstraint
Source§fn clone(&self) -> FieldConstraint
fn clone(&self) -> FieldConstraint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more