pub struct FieldDefinition {Show 15 fields
pub field_type: FieldType,
pub widget: Option<Widget>,
pub required: bool,
pub default: Option<Value>,
pub format: Option<String>,
pub enum_values: Option<Vec<String>>,
pub items: Option<Box<FieldDefinition>>,
pub one_of: Option<Vec<FieldDefinition>>,
pub description: Option<String>,
pub label: Option<String>,
pub label_key: Option<String>,
pub score: u8,
pub source: Option<String>,
pub group: Option<String>,
pub file_kinds: Option<Vec<ExtKind>>,
}Expand description
A single field definition in the frontmatter schema.
Fields§
§field_type: FieldTypeThe data type of the field.
widget: Option<Widget>Which UI widget to render for this field.
None for sub-definitions (e.g. array item types) that have
no direct UI representation.
required: boolWhether this field is required.
default: Option<Value>Default value for the field.
format: Option<String>Format hint (e.g. “date” for YYYY-MM-DD).
enum_values: Option<Vec<String>>Allowed values for select/enum fields.
items: Option<Box<FieldDefinition>>Item definition for array fields.
one_of: Option<Vec<FieldDefinition>>Member variants for a OneOf union field. Each member is a full
FieldDefinition carrying its own field_type + widget. Only set
when field_type == OneOf. The specta override mirrors items to dodge
the self-referential type (the chip bar reads members structurally from
JSON; it needs no nominal TS type).
description: Option<String>Human-readable description of the field.
label: Option<String>Optional human-readable label for the chip bar. When None, the frontend
falls back to using the field key.
label_key: Option<String>i18n key for the chip bar label, resolved by the TypeScript registry.
None when no key is registered (frontend falls back to field name).
score: u8Display score for chip bar ordering and add-property search list ordering. Lower values appear first / sort higher in the list. Formula: score = 100 - (Frequency6 + Importance4); see schema_fields.rs. 0 means unset (skip-schema or plugin-contributed fields, sort to end). Serialized as “priority” for backwards compatibility with the frontend.
source: Option<String>Source of this field definition.
None for builtin fields, Some("review") for plugin-contributed fields.
Used by the frontend to group fields by source in the editor form.
See docs/reference/plugin-schema-contributions.md.
group: Option<String>UI group name for the add-property dropdown (e.g. “Common”, “Children”).
None for plugin-contributed fields (shown in “Other” group).
file_kinds: Option<Vec<ExtKind>>For Widget::FilePicker fields, the extension kinds the picker should
restrict search results to (e.g. cover -> image/video, logo ->
image only). None means unrestricted. Mirrors
schema_fields::BuiltinField::file_kinds — see that field’s doc comment.
Trait Implementations§
Source§impl Clone for FieldDefinition
impl Clone for FieldDefinition
Source§fn clone(&self) -> FieldDefinition
fn clone(&self) -> FieldDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more