| 1 | use crate::{ |
| 2 | compiler, |
| 3 | keywords::{minmax, CompilationResult}, |
| 4 | }; |
| 5 | use serde_json::{Map, Value}; |
| 6 | |
| 7 | #[inline] |
| 8 | pub(crate) fn compile<'a>( |
| 9 | ctx: &compiler::Context, |
| 10 | parent: &'a Map<String, Value>, |
| 11 | schema: &'a Value, |
| 12 | ) -> Option<CompilationResult<'a>> { |
| 13 | if let Some(Value::Bool(true)) = parent.get("exclusiveMaximum") { |
| 14 | minmax::compile_exclusive_maximum(ctx, parent, schema) |
| 15 | } else { |
| 16 | minmax::compile_maximum(ctx, parent, schema) |
| 17 | } |
| 18 | } |