pub struct CompileOptions {
pub default_dialect: Dialect,
pub assert_format: Option<bool>,
pub assert_format_in_legacy_drafts: bool,
pub assert_content: bool,
pub formats: HashMap<String, FormatValidator>,
pub resolve_document: Option<DocumentResolver>,
pub base_uri: Option<String>,
pub entry_point: Option<String>,
pub max_depth: u32,
}Expand description
Options for compiling a schema.
Fields§
§default_dialect: DialectThe dialect for documents without $schema. Defaults to 2020-12.
assert_format: Option<bool>Whether format is asserted. None (the default) follows the vocabularies: the 2020-12 format-assertion
vocabulary asserts, everything else annotates.
assert_format_in_legacy_drafts: boolWhen assert_format is None, assert format in draft 4 to 7 too.
assert_content: boolAssert contentEncoding/contentMediaType in draft 7 (the only draft that asserts them). Defaults to true.
formats: HashMap<String, FormatValidator>Custom format assertions, by format name; they take precedence over the built-in set.
resolve_document: Option<DocumentResolver>Resolves remote documents. The standard metaschemas are always available.
base_uri: Option<String>The base URI of the root document.
entry_point: Option<String>A reference (relative to the root) to evaluate from, e.g. #/$defs/item. Defaults to the root.
max_depth: u32Maximum depth of in-place recursion on a cycle before evaluation is abandoned. Defaults to 128.