Skip to content

Commit 7906e2a

Browse files
authored
Update to latest version of spec (#6)
* Update to latest version of spec * Bump to 0.1.2
1 parent adb9f32 commit 7906e2a

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "jtd"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = "A Rust implementation of JSON Type Definition"
55
authors = ["JSON Type Definition Contributors"]
66
edition = "2018"

src/schema.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub enum ValidateError {
2424
NonRootDefinitions,
2525
EmptyEnum,
2626
RepeatedProperty(String),
27+
MappingNullable,
2728
MappingNotPropertiesForm,
2829
}
2930

@@ -139,8 +140,15 @@ impl Schema {
139140

140141
match &schema.form {
141142
form::Form::Properties(form::Properties {
142-
required, optional, ..
143+
required,
144+
optional,
145+
nullable,
146+
..
143147
}) => {
148+
if *nullable {
149+
return Err(ValidateError::MappingNullable);
150+
}
151+
144152
if required.contains_key(discriminator)
145153
|| optional.contains_key(discriminator)
146154
{

0 commit comments

Comments
 (0)