public class SchemaRegistry extends Object
Modifier and Type | Method and Description |
---|---|
static org.eclipse.microprofile.openapi.models.media.Schema |
checkRegistration(org.jboss.jandex.Type type,
TypeResolver resolver,
org.eclipse.microprofile.openapi.models.media.Schema schema)
Check if the entityType is eligible for registration using the
typeResolver.
|
static SchemaRegistry |
currentInstance()
Retrieve the
SchemaRegistry previously created by
newInstance for the current thread, or null if none has yet
been created. |
boolean |
has(org.jboss.jandex.Type instanceType) |
org.eclipse.microprofile.openapi.models.media.Schema |
lookupRef(org.jboss.jandex.Type instanceType) |
static SchemaRegistry |
newInstance(OpenApiConfig config,
org.eclipse.microprofile.openapi.models.OpenAPI oai,
org.jboss.jandex.IndexView index)
Create a new instance of a
SchemaRegistry on this thread. |
org.eclipse.microprofile.openapi.models.media.Schema |
register(org.jboss.jandex.Type entityType,
org.eclipse.microprofile.openapi.models.media.Schema schema)
Register the provided
Schema for the provided Type . |
static void |
remove() |
boolean |
schemaReferenceSupported() |
public static SchemaRegistry newInstance(OpenApiConfig config, org.eclipse.microprofile.openapi.models.OpenAPI oai, org.jboss.jandex.IndexView index)
SchemaRegistry
on this thread. The
registry returned by this method may also be obtained by subsequent calls
to currentInstance()
. Additional calls of this method will
replace the registry in the current thread context with a new instance.config
- current runtime configurationoai
- the OpenAPI being constructed by the scanindex
- indexed class informationpublic static SchemaRegistry currentInstance()
SchemaRegistry
previously created by
newInstance
for the current thread, or null
if none has yet
been created.SchemaRegistry
instance or nullpublic static void remove()
public static org.eclipse.microprofile.openapi.models.media.Schema checkRegistration(org.jboss.jandex.Type type, TypeResolver resolver, org.eclipse.microprofile.openapi.models.media.Schema schema)
CLASS
PARAMETERIZED_TYPE
TYPE_VARIABLE
WILDCARD_TYPE
mp.openapi.extensions.schema-references.enable
, and the
resolved type is available in the registry's IndexView
then the
schema can be registered.
Only if the type has not already been registered earlier will it be
added.type
- the Type
the Schema
applies toresolver
- a TypeResolver
that will be used to resolve
parameterized and wildcard typesschema
- Schema
to add to the registrypublic org.eclipse.microprofile.openapi.models.media.Schema register(org.jboss.jandex.Type entityType, org.eclipse.microprofile.openapi.models.media.Schema schema)
Schema
for the provided Type
. If an
existing schema has already been registered for the type, it will be
replaced by the schema given in this method.entityType
- the type the Schema
applies toschema
- Schema
to add to the registrySchema
public org.eclipse.microprofile.openapi.models.media.Schema lookupRef(org.jboss.jandex.Type instanceType)
public boolean has(org.jboss.jandex.Type instanceType)
public boolean schemaReferenceSupported()
Copyright © 2018–2020. All rights reserved.