pub struct Config {
pub root: bool,
pub exclude: Vec<String>,
pub schemas: HashMap<String, String>,
pub registries: Vec<String>,
pub rewrite: HashMap<String, String>,
pub overrides: Vec<Override>,
}Fields§
§root: boolIf true, stop walking up the directory tree. No parent lintel.toml
files will be merged.
exclude: Vec<String>Glob patterns for files to exclude from validation.
schemas: HashMap<String, String>Custom schema mappings. Keys are glob patterns matching file paths; values are schema URLs to use for those files.
These take priority over catalog matching but are overridden by
inline $schema properties and YAML modeline comments.
registries: Vec<String>Additional schema catalog URLs to fetch alongside SchemaStore.
Each URL should point to a JSON file with the same format as
the SchemaStore catalog ({"schemas": [...]}).
rewrite: HashMap<String, String>Schema URI rewrite rules. Keys are prefixes to match; values are
replacements. For example, "http://localhost:8000/" = "//schemas/"
rewrites any schema URI starting with http://localhost:8000/ so that
prefix becomes //schemas/.
overrides: Vec<Override>Per-file overrides. Earlier entries (child configs) take priority.
Implementations§
Source§impl Config
impl Config
Sourcepub fn find_schema_mapping(&self, path: &str, file_name: &str) -> Option<&str>
pub fn find_schema_mapping(&self, path: &str, file_name: &str) -> Option<&str>
Find a custom schema mapping for the given file path.
Matches against the [schemas] table using glob patterns.
Returns the schema URL if a match is found.
Sourcepub fn should_validate_formats(&self, path: &str, schema_uris: &[&str]) -> bool
pub fn should_validate_formats(&self, path: &str, schema_uris: &[&str]) -> bool
Check whether format validation should be enabled for a given file.
path is the instance file path. schema_uris is a slice of schema
URIs to match against (typically the original URI before rewrites and
the resolved URI after rewrites + // resolution).
Returns false if any matching [[override]] sets
validate_formats = false. Defaults to true when no override matches.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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>,
Source§impl JsonSchema for Config
impl JsonSchema for Config
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more