public class OpenApiApplicationVisitor extends Object implements TypeElementVisitor<io.swagger.v3.oas.annotations.OpenAPIDefinition,Object>
Modifier and Type | Field and Description |
---|---|
static String |
MICRONAUT_OPENAPI_TARGET_FILE
System property that enables setting the target file to write to.
|
Constructor and Description |
---|
OpenApiApplicationVisitor() |
Modifier and Type | Method and Description |
---|---|
protected io.swagger.v3.oas.models.media.Schema |
bindSchemaAnnotationValue(VisitorContext context,
Element element,
io.swagger.v3.oas.models.media.Schema schemaToBind,
AnnotationValue<io.swagger.v3.oas.annotations.media.Schema> schemaAnn)
Binds the schema for the given element.
|
protected io.swagger.v3.oas.models.media.Schema |
bindSchemaForElement(VisitorContext context,
Element element,
ClassElement elementType,
io.swagger.v3.oas.models.media.Schema schemaToBind)
Binds the schema for the given element.
|
void |
finish(VisitorContext visitorContext)
Called once when visitor processing finishes.
|
protected void |
normalizeEnumValues(Map<CharSequence,Object> paramValues,
Map<String,Class<? extends Enum>> enumTypes)
Normalizes enum values stored in the map.
|
protected void |
processSchemaProperty(VisitorContext context,
Element element,
ClassElement elementType,
io.swagger.v3.oas.models.media.Schema parentSchema,
io.swagger.v3.oas.models.media.Schema propertySchema)
Processes a schema property.
|
protected void |
processSecuritySchemes(ClassElement element,
VisitorContext context)
Processes
SecurityScheme annotations. |
protected io.swagger.v3.oas.models.Components |
resolveComponents(io.swagger.v3.oas.models.OpenAPI openAPI)
Resolve the components.
|
protected io.swagger.v3.oas.models.media.Schema |
resolveSchema(io.swagger.v3.oas.models.OpenAPI openAPI,
Element definingElement,
ClassElement type,
VisitorContext context,
String mediaType)
Resolves the schema for the given type element.
|
protected Map<CharSequence,Object> |
toValueMap(Map<CharSequence,Object> values,
VisitorContext context)
Convert the values to a map.
|
void |
visitClass(ClassElement element,
VisitorContext context)
Executed when a class is encountered that matches the
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
start, visitConstructor, visitField, visitMethod
public static final String MICRONAUT_OPENAPI_TARGET_FILE
public void visitClass(ClassElement element, VisitorContext context)
TypeElementVisitor
visitClass
in interface TypeElementVisitor<io.swagger.v3.oas.annotations.OpenAPIDefinition,Object>
element
- The elementcontext
- The visitor contextpublic void finish(VisitorContext visitorContext)
TypeElementVisitor
finish
in interface TypeElementVisitor<io.swagger.v3.oas.annotations.OpenAPIDefinition,Object>
visitorContext
- The visitor contextprotected Map<CharSequence,Object> toValueMap(Map<CharSequence,Object> values, VisitorContext context)
values
- The valuescontext
- The visitor context@Nullable protected io.swagger.v3.oas.models.media.Schema resolveSchema(io.swagger.v3.oas.models.OpenAPI openAPI, @Nullable Element definingElement, ClassElement type, VisitorContext context, @Nullable String mediaType)
openAPI
- The OpenAPI objectdefiningElement
- The defining elementtype
- The type elementcontext
- The contextmediaType
- An optional media typeprotected io.swagger.v3.oas.models.Components resolveComponents(io.swagger.v3.oas.models.OpenAPI openAPI)
openAPI
- The open APIprotected void processSchemaProperty(VisitorContext context, Element element, ClassElement elementType, io.swagger.v3.oas.models.media.Schema parentSchema, io.swagger.v3.oas.models.media.Schema propertySchema)
context
- The visitor contextelement
- The elementelementType
- The elemen typeparentSchema
- The parent schemapropertySchema
- The property schemaprotected io.swagger.v3.oas.models.media.Schema bindSchemaForElement(VisitorContext context, Element element, ClassElement elementType, io.swagger.v3.oas.models.media.Schema schemaToBind)
context
- The contextelement
- The elementelementType
- The element typeschemaToBind
- The schema to bindprotected io.swagger.v3.oas.models.media.Schema bindSchemaAnnotationValue(VisitorContext context, Element element, io.swagger.v3.oas.models.media.Schema schemaToBind, AnnotationValue<io.swagger.v3.oas.annotations.media.Schema> schemaAnn)
context
- The contextelement
- The elementschemaToBind
- The schema to bindschemaAnn
- The schema annotationprotected void processSecuritySchemes(ClassElement element, VisitorContext context)
SecurityScheme
annotations.element
- The elementcontext
- The visitor context