Skip to main content

Override

Struct Override 

Source
pub struct Override {
    pub files: Vec<String>,
    pub schemas: Vec<String>,
    pub validate_formats: Option<bool>,
}
Expand description

Conditional settings applied to files or schemas matching specific patterns.

Each [[override]] block targets files by path glob, schemas by URI glob, or both. When a file matches, the settings in that block override the top-level defaults. Earlier entries (from child configs) take priority over later entries (from parent configs).

In TOML, override blocks are written as [[override]] (double brackets) to create an array of tables.

Fields§

§files: Vec<String>

Glob patterns matched against instance file paths (relative to the working directory).

Use standard glob syntax: * matches any single path component, ** matches zero or more path components, and ? matches a single character.

§schemas: Vec<String>

Glob patterns matched against schema URIs.

Each pattern is tested against both the original URI (before rewrite rules) and the resolved URI (after rewrites and // prefix resolution), so you can match on either form.

§validate_formats: Option<bool>

Enable or disable JSON Schema format keyword validation for matching files.

When true, string values are validated against built-in formats such as date-time, email, uri, etc. When false, format annotations are ignored during validation. When omitted, this override does not affect the format validation setting and the next matching override (or the default of true) applies.

Trait Implementations§

Source§

impl Debug for Override

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Override

Source§

fn default() -> Override

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Override

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Override

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,