valico 4.0.0

JSON Schema validator and JSON coercer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use serde_json::Value;

use super::super::schema;
use super::super::validators;

#[allow(missing_copy_implementations)]
pub struct Const;
impl super::Keyword for Const {
    fn compile(&self, def: &Value, _ctx: &schema::WalkContext) -> super::KeywordResult {
        let const_ = keyword_key_exists!(def, "const");

        Ok(Some(Box::new(validators::Const {
            item: const_.clone(),
        })))
    }
}