public class SchemaRepository extends Object
This is to be used when multiple schema objects compose the global schema to be used for validation.
NOTE: This class has been automatically generated from theoriginal
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<SchemaRepository> |
__TYPE_ARG |
Constructor and Description |
---|
SchemaRepository(Object delegate) |
SchemaRepository(SchemaRepository delegate) |
Modifier and Type | Method and Description |
---|---|
static SchemaRepository |
create(JsonSchemaOptions options)
Create a repository with some initial configuration.
|
static SchemaRepository |
create(JsonSchemaOptions options,
JsonFormatValidator jsonFormatValidator)
Create a repository with some initial configuration.
|
SchemaRepository |
dereference(JsonSchema schema)
Dereferences a schema to the repository.
|
SchemaRepository |
dereference(String uri,
JsonSchema schema)
Dereferences a schema to the repository.
|
boolean |
equals(Object o) |
JsonSchema |
find(String pointer)
Look up a schema using a JSON pointer notation
|
SchemaRepository |
getDelegate() |
int |
hashCode() |
static SchemaRepository |
newInstance(SchemaRepository arg) |
SchemaRepository |
preloadMetaSchema(FileSystem fs)
Preloads the repository with the meta schemas for the related @link
Draft version. |
SchemaRepository |
preloadMetaSchema(FileSystem fs,
Draft draft)
Preloads the repository with the meta schemas for the related draft version.
|
JsonObject |
resolve(JsonObject schema)
Resolve all
$ref in the given . |
JsonObject |
resolve(JsonSchema schema)
Tries to resolve all internal and repository local references.
|
JsonObject |
resolve(String ref)
Tries to resolve all internal and repository local references.
|
String |
toString() |
Validator |
validator(JsonSchema schema)
A new validator instance using this repository options.
|
Validator |
validator(JsonSchema schema,
JsonSchemaOptions options)
A new validator instance overriding this repository options.
|
Validator |
validator(JsonSchema schema,
JsonSchemaOptions options,
boolean dereference)
A new validator instance overriding this repository options.
|
Validator |
validator(String ref)
A new validator instance using this repository options.
|
Validator |
validator(String ref,
JsonSchemaOptions options)
A new validator instance overriding this repository options.
|
public static final io.vertx.lang.rx.TypeArg<SchemaRepository> __TYPE_ARG
public SchemaRepository(SchemaRepository delegate)
public SchemaRepository(Object delegate)
public SchemaRepository getDelegate()
public static SchemaRepository create(JsonSchemaOptions options)
options
- the initial configurationpublic static SchemaRepository create(JsonSchemaOptions options, JsonFormatValidator jsonFormatValidator)
options
- the initial configurationjsonFormatValidator
- public SchemaRepository dereference(JsonSchema schema)
schema
- a new schema to listpublic SchemaRepository dereference(String uri, JsonSchema schema)
uri
- the source of the schema used for de-referencing, optionally relative to JsonSchemaOptions
.schema
- a new schema to listpublic SchemaRepository preloadMetaSchema(FileSystem fs)
Draft
version. The related draft version
is determined from the JsonSchemaOptions
, in case that no draft is set in the options an
IllegalStateException
is thrown.fs
- The Vert.x file system to load the related schema meta files from classpathpublic SchemaRepository preloadMetaSchema(FileSystem fs, Draft draft)
fs
- The Vert.x file system to load the related schema meta files from classpathdraft
- The draft version of the meta files to loadpublic Validator validator(JsonSchema schema)
schema
- the start validation schemapublic Validator validator(String ref)
ref
- the start validation reference in JSON pointer formatpublic Validator validator(String ref, JsonSchemaOptions options)
ref
- the start validation reference in JSON pointer formatoptions
- the options to be using on the validator instancepublic Validator validator(JsonSchema schema, JsonSchemaOptions options)
schema
- the start validation schemaoptions
- the options to be using on the validator instancepublic Validator validator(JsonSchema schema, JsonSchemaOptions options, boolean dereference)
schema
- the start validation schemaoptions
- the options to be using on the validator instancedereference
- if true the schema will be dereferenced before validationpublic JsonObject resolve(JsonObject schema)
$ref
in the given . The resolution algrithm is not aware of other
specifications. When resolving OpenAPI documents (which only allow $ref
at specific locations) you
should validate if the document is valid before performing a resolution.
It is important to note that any sibling elements of a $ref
is ignored. This is because $ref
works by replacing itself and everything on its level with the definition it is pointing at.schema
- the JSON object to resolve.$ref
replaced by actual object references.public JsonObject resolve(String ref)
The result is an object where all references have been resolved. Resolution of circular references is shallow. This should normally not be a problem for this use case.
ref
- the start resolution reference in JSON pointer format$ref
s replaced by their value.public JsonObject resolve(JsonSchema schema)
The result is an object where all references have been resolved. Resolution of circular references is shallow. This should normally not be a problem for this use case.
schema
- $ref
s replaced by their value.public JsonSchema find(String pointer)
pointer
- the JSON pointerpublic static SchemaRepository newInstance(SchemaRepository arg)
Copyright © 2024 Eclipse. All rights reserved.