@@ -141,8 +141,8 @@ This will print the following output:
141
141
Format validators
142
142
-----------------
143
143
144
- Starting from version ` 1.2.0 ` the library supports the ` "format" ` keyword (which is an optional part of the specification),
145
- so you can use the following formats in the schemas:
144
+ Starting from version ` 1.2.0 ` the library supports the [ http://json-schema.org/latest/json-schema-validation.html#anchor104 ] ( ` "format" ` keyword)
145
+ (which is an optional part of the specification), so you can use the following formats in the schemas:
146
146
147
147
* date-time
148
148
* email
@@ -183,11 +183,11 @@ To bind the `EvenCharNumValidator` to a `"format"` value (for example `"evenleng
183
183
to the keyword in the schema loader configuration:
184
184
185
185
``` java
186
- JSONObject rawSchema = new JSONObject (new JSONTokener (inputStream));
187
- SchemaLoader schemaLoader = SchemaLoader . builder()
188
- .schemaJson(rawSchema) // rawSchema is the JSON representation of the schema utilizing the "evenlength" non-standard format
189
- .addFormatValidator(" evenlength" , new EvenCharNumValidator ()) // the EvenCharNumValidator gets bound to the "evenlength" keyword
190
- .build();
191
- Schema schema = schemaLoader. load(). build(); // the schema is created using the above created configuration
192
- schema. validate(jsonDcoument); // the document validation happens here
186
+ JSONObject rawSchema = new JSONObject (new JSONTokener (inputStream));
187
+ SchemaLoader schemaLoader = SchemaLoader . builder()
188
+ .schemaJson(rawSchema) // rawSchema is the JSON representation of the schema utilizing the "evenlength" non-standard format
189
+ .addFormatValidator(" evenlength" , new EvenCharNumValidator ()) // the EvenCharNumValidator gets bound to the "evenlength" keyword
190
+ .build();
191
+ Schema schema = schemaLoader. load(). build(); // the schema is created using the above created configuration
192
+ schema. validate(jsonDcoument); // the document validation happens here
193
193
```
0 commit comments