pub struct FieldSchema {
pub field_type: String,
pub required: bool,
pub default_value: Option<Value>,
pub allowed_values: Option<Vec<Value>>,
pub custom_properties: HashMap<String, Value>,
}
Expand description
Custom field schema definition for Jira fields
This allows you to define validation rules and metadata for custom fields that your application uses with Jira.
Fields§
§field_type: String
The type of field (string, number, enum, etc.)
required: bool
Whether this field is required
default_value: Option<Value>
Default value for the field
allowed_values: Option<Vec<Value>>
Allowed values (for enum-type fields)
custom_properties: HashMap<String, Value>
Custom properties for validation
Implementations§
Source§impl FieldSchema
impl FieldSchema
Sourcepub fn number(required: bool, min: Option<f64>, max: Option<f64>) -> Self
pub fn number(required: bool, min: Option<f64>, max: Option<f64>) -> Self
Create a number field schema with optional min/max validation
§Panics
This function will panic if min is greater than max
Sourcepub fn integer(required: bool, min: Option<i64>, max: Option<i64>) -> Self
pub fn integer(required: bool, min: Option<i64>, max: Option<i64>) -> Self
Create an integer field schema with optional min/max validation
§Panics
This function will panic if min is greater than max
Sourcepub fn enumeration<V: Serialize>(
required: bool,
allowed_values: Vec<V>,
) -> Result<Self>
pub fn enumeration<V: Serialize>( required: bool, allowed_values: Vec<V>, ) -> Result<Self>
Create an enum field schema with allowed values
Sourcepub fn with_default<V: Serialize>(self, default: V) -> Result<Self>
pub fn with_default<V: Serialize>(self, default: V) -> Result<Self>
Set a default value for the field
Sourcepub fn with_property<V: Serialize>(self, key: &str, value: V) -> Result<Self>
pub fn with_property<V: Serialize>(self, key: &str, value: V) -> Result<Self>
Add a custom property to the schema
Trait Implementations§
Source§impl Clone for FieldSchema
impl Clone for FieldSchema
Source§fn clone(&self) -> FieldSchema
fn clone(&self) -> FieldSchema
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FieldSchema
impl Debug for FieldSchema
Source§impl<'de> Deserialize<'de> for FieldSchema
impl<'de> Deserialize<'de> for FieldSchema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FieldSchema
impl RefUnwindSafe for FieldSchema
impl Send for FieldSchema
impl Sync for FieldSchema
impl Unpin for FieldSchema
impl UnwindSafe for FieldSchema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more