Package com.networknt.schema
Class JsonMetaSchema
- java.lang.Object
-
- com.networknt.schema.JsonMetaSchema
-
public class JsonMetaSchema extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJsonMetaSchema.Builder
-
Field Summary
Fields Modifier and Type Field Description static List<Format>COMMON_BUILTIN_FORMATS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JsonMetaSchema.Builderbuilder(String uri)Builder without keywords or formats.static JsonMetaSchema.Builderbuilder(String uri, JsonMetaSchema blueprint)StringgetIdKeyword()Map<String,Keyword>getKeywords()com.fasterxml.jackson.databind.JsonNodegetNodeByFragmentRef(String ref, com.fasterxml.jackson.databind.JsonNode node)StringgetUri()static JsonMetaSchemagetV201909()static JsonMetaSchemagetV202012()static JsonMetaSchemagetV4()static JsonMetaSchemagetV6()static JsonMetaSchemagetV7()JsonValidatornewValidator(ValidationContext validationContext, String schemaPath, String keyword, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema, String customMessage)StringreadId(com.fasterxml.jackson.databind.JsonNode schemaNode)
-
-
-
Method Detail
-
getV4
public static JsonMetaSchema getV4()
-
getV6
public static JsonMetaSchema getV6()
-
getV7
public static JsonMetaSchema getV7()
-
getV201909
public static JsonMetaSchema getV201909()
-
getV202012
public static JsonMetaSchema getV202012()
-
builder
public static JsonMetaSchema.Builder builder(String uri)
Builder without keywords or formats.Use
getV4()for the Draft 4 Metaschema, or if you need a builder based on Draft4, useJsonMetaSchema.builder("http://your-metaschema-uri", JsonSchemaFactory.getDraftV4()).build();- Parameters:
uri- the URI of the metaschema that will be defined via this builder.- Returns:
- a builder instance without any keywords or formats - usually not what one needs.
-
builder
public static JsonMetaSchema.Builder builder(String uri, JsonMetaSchema blueprint)
- Parameters:
uri- the URI of your new JsonMetaSchema that will be defined via this builder.blueprint- the JsonMetaSchema to base your custom JsonMetaSchema on.- Returns:
- a builder instance preconfigured to be the same as blueprint, but with a different uri.
-
getIdKeyword
public String getIdKeyword()
-
readId
public String readId(com.fasterxml.jackson.databind.JsonNode schemaNode)
-
getNodeByFragmentRef
public com.fasterxml.jackson.databind.JsonNode getNodeByFragmentRef(String ref, com.fasterxml.jackson.databind.JsonNode node)
-
getUri
public String getUri()
-
newValidator
public JsonValidator newValidator(ValidationContext validationContext, String schemaPath, String keyword, com.fasterxml.jackson.databind.JsonNode schemaNode, JsonSchema parentSchema, String customMessage)
-
-