diff --git a/Cargo.toml b/Cargo.toml index 53de677..9fa971e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jtd" -version = "0.1.1" +version = "0.1.2" description = "A Rust implementation of JSON Type Definition" authors = ["JSON Type Definition Contributors"] edition = "2018" diff --git a/json-typedef-spec b/json-typedef-spec index af1e463..7108b38 160000 --- a/json-typedef-spec +++ b/json-typedef-spec @@ -1 +1 @@ -Subproject commit af1e4637944c79b21efbefc37506eadc2527132b +Subproject commit 7108b38558a5107663a07a83b7fd8b2f45f63a6c diff --git a/src/schema.rs b/src/schema.rs index bce0b10..000d536 100644 --- a/src/schema.rs +++ b/src/schema.rs @@ -24,6 +24,7 @@ pub enum ValidateError { NonRootDefinitions, EmptyEnum, RepeatedProperty(String), + MappingNullable, MappingNotPropertiesForm, } @@ -139,8 +140,15 @@ impl Schema { match &schema.form { form::Form::Properties(form::Properties { - required, optional, .. + required, + optional, + nullable, + .. }) => { + if *nullable { + return Err(ValidateError::MappingNullable); + } + if required.contains_key(discriminator) || optional.contains_key(discriminator) {