public interface SchemaParser
this#withValidatorFactory(ValidatorFactory)| Modifier and Type | Method and Description |
|---|---|
static SchemaParser |
createDraft201909SchemaParser(SchemaRouter router)
Create a new
SchemaParser for Json Schema Draft2019-09 schemas |
static SchemaParser |
createDraft7SchemaParser(SchemaRouter router)
Create a new
SchemaParser for Json Schema Draft-7 schemas |
static SchemaParser |
createOpenAPI3SchemaParser(SchemaRouter router)
Create a new
SchemaParser for OpenAPI schemas |
SchemaRouter |
getSchemaRouter()
Get schema router registered to this schema parser
|
Schema |
parse(Boolean jsonSchema)
Builds a true of false schema assigning a random scope
|
Schema |
parse(Boolean jsonSchema,
JsonPointer schemaPointer)
Builds a true of false schema
|
Schema |
parse(JsonObject jsonSchema)
Build a schema from provided json assigning a random scope.
|
Schema |
parse(JsonObject jsonSchema,
JsonPointer schemaPointer)
Build a schema from provided json.
|
Schema |
parseFromString(String unparsedJson)
Build a schema from provided unparsed json assigning a random scope.
|
Schema |
parseFromString(String unparsedJson,
JsonPointer schemaPointer)
Build a schema from provided unparsed json.
|
SchemaParser |
withStringFormatValidator(String formatName,
java.util.function.Predicate<String> predicate)
Add a custom format validator
|
SchemaParser |
withValidatorFactory(ValidatorFactory factory)
Add a
ValidatorFactory to this schema parser to support custom keywords |
Schema parse(JsonObject jsonSchema)
jsonSchema - JSON representing the schemaIllegalArgumentException - If scope is relativeSchemaException - If schema is invalidSchema parse(JsonObject jsonSchema, JsonPointer schemaPointer)
jsonSchema - JSON representing the schemaschemaPointer - Scope of schema. Must be a JSONPointer with absolute URIIllegalArgumentException - If scope is relativeSchemaException - If schema is invalidSchema parse(Boolean jsonSchema)
jsonSchema - JSON representing the schemaIllegalArgumentException - If scope is relativeSchemaException - If schema is invalidSchema parse(Boolean jsonSchema, JsonPointer schemaPointer)
jsonSchema - JSON representing the schemaschemaPointer - Scope of schema. Must be a JSONPointer with absolute URIIllegalArgumentException - If scope is relativeSchemaException - If schema is invalidSchema parseFromString(String unparsedJson)
unparsedJson - Unparsed JSON representing the schema.IllegalArgumentException - If scope is relativeSchemaException - If schema is invalidSchema parseFromString(String unparsedJson, JsonPointer schemaPointer)
unparsedJson - Unparsed JSON representing the schema.schemaPointer - Scope of schema. Must be a JSONPointer with absolute URIIllegalArgumentException - If scope is relativeSchemaException - If schema is invalidSchemaRouter getSchemaRouter()
SchemaParser withValidatorFactory(ValidatorFactory factory)
ValidatorFactory to this schema parser to support custom keywordsfactory - new factorySchemaParser withStringFormatValidator(String formatName, java.util.function.Predicate<String> predicate)
formatName - format namepredicate - predicate for the new formatstatic SchemaParser createOpenAPI3SchemaParser(SchemaRouter router)
SchemaParser for OpenAPI schemasrouter - static SchemaParser createDraft7SchemaParser(SchemaRouter router)
SchemaParser for Json Schema Draft-7 schemasrouter - static SchemaParser createDraft201909SchemaParser(SchemaRouter router)
SchemaParser for Json Schema Draft2019-09 schemasrouter - Copyright © 2022 Eclipse. All rights reserved.