• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.networknt.schema;
2 
3 import java.util.Arrays;
4 
5 /**
6  * Draft 6 dialect.
7  */
8 public class Version6 implements JsonSchemaVersion {
9     private static final String IRI = SchemaId.V6;
10     // Draft 6 uses "$id"
11     private static final String ID = "$id";
12 
13     private static class Holder {
14         private static final JsonMetaSchema INSTANCE;
15         static {
16             INSTANCE = JsonMetaSchema.builder(IRI)
17                     .specification(SpecVersion.VersionFlag.V6)
18                     .idKeyword(ID)
19                     .formats(Formats.DEFAULT)
20                     .keywords(ValidatorTypeCode.getKeywords(SpecVersion.VersionFlag.V6))
21                     // keywords that may validly exist, but have no validation aspect to them
22                     .keywords(Arrays.asList(
23                             new NonValidationKeyword("$schema"),
24                             new NonValidationKeyword("$id"),
25                             new AnnotationKeyword("title"),
26                             new AnnotationKeyword("description"),
27                             new AnnotationKeyword("default"),
28                             new NonValidationKeyword("additionalItems"),
29                             new NonValidationKeyword("definitions"),
30                             new AnnotationKeyword("examples")
31                     ))
32                     .build();
33         }
34     }
35 
getInstance()36     public JsonMetaSchema getInstance() {
37         return Holder.INSTANCE;
38     }
39 }
40