public class OpenApiDataObjectScanner extends Object
Schema
from the entities encountered.
A depth first search is performed, with the following precedence (high to low):
Well-known types, such as Collection, Map, Date, etc, are handled in a custom manner.
Jandex-indexed objects from the user's deployment are traversed until a terminal type is
met (such as a primitive, boxed primitive, date, etc), or an entity is encountered that is not
well-known or is not in the Jandex IndexView.
Current Limitations:
If a type is not available in the provided IndexView then it is not accessible. Excepting
well-known types, this means non-deployment objects may not be scanned.
Future work could consider making the user's deployment classes available to this classloader, with additional code to traverse non-Jandex types reachable from this classloader. But, this is troublesome for performance, security and initialisation reasons -- particular caution would be needed to avoid accidental initialisation of classes that may have externally visible side-effects.
Schema Annotation,
Schema Object| Constructor and Description |
|---|
OpenApiDataObjectScanner(org.jboss.jandex.IndexView index,
org.jboss.jandex.Type classType)
Constructor for data object scanner.
|
| Modifier and Type | Method and Description |
|---|---|
org.eclipse.microprofile.openapi.models.media.Schema |
process()
Build the Schema
|
static org.eclipse.microprofile.openapi.models.media.Schema |
process(org.jboss.jandex.IndexView index,
org.jboss.jandex.ParameterizedType pType)
Build a Schema with
ParameterizedType as root. |
static org.eclipse.microprofile.openapi.models.media.Schema |
process(org.jboss.jandex.IndexView index,
org.jboss.jandex.Type type)
Build a Schema with ClassType as root.
|
static org.eclipse.microprofile.openapi.models.media.Schema |
process(org.jboss.jandex.PrimitiveType primitive)
Build a Schema with PrimitiveType as root.
|
public OpenApiDataObjectScanner(org.jboss.jandex.IndexView index,
org.jboss.jandex.Type classType)
process() to build and return the Schema.index - index of types to scanclassType - root to begin scanpublic static org.eclipse.microprofile.openapi.models.media.Schema process(org.jboss.jandex.IndexView index,
org.jboss.jandex.Type type)
index - index of types to scantype - root to begin scanpublic static org.eclipse.microprofile.openapi.models.media.Schema process(org.jboss.jandex.PrimitiveType primitive)
primitive - root to begin scanpublic static org.eclipse.microprofile.openapi.models.media.Schema process(org.jboss.jandex.IndexView index,
org.jboss.jandex.ParameterizedType pType)
ParameterizedType as root.index - index of types to scanpType - root to begin scanpublic org.eclipse.microprofile.openapi.models.media.Schema process()
Copyright © 2018 JBoss by Red Hat. All rights reserved.