public class SchemaRouterImpl extends Object implements SchemaRouter
| Constructor and Description |
|---|
SchemaRouterImpl(Vertx vertx,
HttpClient client,
FileSystem fs,
SchemaRouterOptions options) |
| Modifier and Type | Method and Description |
|---|---|
SchemaRouter |
addJson(URI uri,
JsonObject object)
Add one or more json documents including schemas on top or inner levels.
|
SchemaRouter |
addSchema(Schema schema,
JsonPointer... aliasScope)
Add a parsed schema to this router.
|
SchemaRouter |
addSchemaAlias(Schema schema,
String alias)
Add an alias to a schema already registered in this router (this alias can be solved only from schema scope).
|
SchemaRouter |
addSchemaWithScope(Schema schema,
JsonPointer scope)
Add a parsed schema to this router.
|
void |
insertRouterNode(JsonPointer pointer,
io.vertx.json.schema.common.RouterNode nodeToWrite) |
void |
insertSchema(JsonPointer pointer,
io.vertx.json.schema.common.RouterNode initialNode,
Schema schema) |
List<Schema> |
registeredSchemas() |
Future<Void> |
resolveAllSchemas() |
Schema |
resolveCachedSchema(JsonPointer refPointer,
JsonPointer scope,
SchemaParser parser)
Resolve cached schema based on refPointer.
|
Future<Schema> |
resolveRef(JsonPointer pointer,
JsonPointer scope,
SchemaParser schemaParser)
Resolve $ref.
|
void |
resolveRef(JsonPointer pointer,
JsonPointer scope,
SchemaParser schemaParser,
Handler<AsyncResult<Schema>> handler)
Like
SchemaRouter.resolveRef(JsonPointer, JsonPointer, SchemaParser) but with a direct callback. |
Future<Schema> |
solveAllSchemaReferences(Schema schema)
Deeply resolve all references of the provided
schema |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddJson, create, createpublic SchemaRouterImpl(Vertx vertx, HttpClient client, FileSystem fs, SchemaRouterOptions options)
public List<Schema> registeredSchemas()
registeredSchemas in interface SchemaRouterpublic Schema resolveCachedSchema(JsonPointer refPointer, JsonPointer scope, SchemaParser parser)
SchemaRouterresolveCachedSchema in interface SchemaRouterpublic void resolveRef(JsonPointer pointer, JsonPointer scope, SchemaParser schemaParser, Handler<AsyncResult<Schema>> handler)
SchemaRouterSchemaRouter.resolveRef(JsonPointer, JsonPointer, SchemaParser) but with a direct callback.resolveRef in interface SchemaRouterpublic Future<Schema> resolveRef(JsonPointer pointer, JsonPointer scope, SchemaParser schemaParser)
SchemaRouterSchemaException or an IllegalArgumentExceptionresolveRef in interface SchemaRouterSchema or failed with a SchemaException or an IllegalArgumentExceptionpublic SchemaRouter addSchema(Schema schema, JsonPointer... aliasScope)
SchemaRouterSchema.getScope() and,
if you provide additional aliasScopes, this method register links to this schema with these scopes.
This method is automatically called by SchemaParser when a new schema is parsedaddSchema in interface SchemaRouterschema - schema to addpublic SchemaRouter addSchemaWithScope(Schema schema, JsonPointer scope)
SchemaRouterSchema.getScope(). This may be useful to register links to singleton schemas.
This method is automatically called by SchemaParser when a new schema is parsedaddSchemaWithScope in interface SchemaRouterschema - schema to addpublic SchemaRouter addSchemaAlias(Schema schema, String alias)
SchemaRouteraddSchemaAlias in interface SchemaRouterschema - schema to addalias - the schema aliaspublic SchemaRouter addJson(URI uri, JsonObject object)
SchemaRouter
You can use this schema if you have externally loaded some json document and you want to register to the schema router.
You can later parse and retrieve a schema from this json structure using this#resolveCachedSchema(JsonPointer, JsonPointer, SchemaParser),
providing the correct refPointer
addJson in interface SchemaRouterpublic Future<Schema> solveAllSchemaReferences(Schema schema)
schemaschema - public void insertSchema(JsonPointer pointer, io.vertx.json.schema.common.RouterNode initialNode, Schema schema)
public void insertRouterNode(JsonPointer pointer, io.vertx.json.schema.common.RouterNode nodeToWrite)
Copyright © 2022 Eclipse. All rights reserved.