[][src]Trait jsonschema_valid::schemas::Draft

pub trait Draft {
    fn get_validator(
        &self,
        key: &str
    ) -> Option<fn(cfg: &'a Config<'a>, instance: &'a Value, schema: &'a Value, parent_schema: Option<&'a Value>, ref_context: Context<'a>) -> ErrorIterator<'a>>;
fn get_schema(&self) -> &'static Value;
fn get_format_checker(
        &self,
        format: &str
    ) -> Option<fn(cfg: &Config, value: &str) -> bool>;
fn get_draft_number(&self) -> u8; }

The validator can validate JSON data against different versions of JSON Schema.

Required methods

fn get_validator(
    &self,
    key: &str
) -> Option<fn(cfg: &'a Config<'a>, instance: &'a Value, schema: &'a Value, parent_schema: Option<&'a Value>, ref_context: Context<'a>) -> ErrorIterator<'a>>

Get a validator function for the given item.

fn get_schema(&self) -> &'static Value

Get the JSON representation of the schema document.

fn get_format_checker(
    &self,
    format: &str
) -> Option<fn(cfg: &Config, value: &str) -> bool>

Get a format check function.

fn get_draft_number(&self) -> u8

Return the draft's number.

Loading content...

Implementors

impl Draft for Draft4[src]

impl Draft for Draft6[src]

impl Draft for Draft7[src]

Loading content...