Package io.micronaut.openapi.visitor
Class OpenApiApplicationVisitor
java.lang.Object
io.micronaut.openapi.visitor.OpenApiApplicationVisitor
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,io.micronaut.core.util.Toggleable
,io.micronaut.inject.visitor.TypeElementVisitor<Object,
Object>
public class OpenApiApplicationVisitor
extends Object
implements io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
Visits the application class.
- Since:
- 1.0
- Author:
- graemerocher
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.inject.visitor.TypeElementVisitor
io.micronaut.inject.visitor.TypeElementVisitor.VisitorKind
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
expandProperties
(String s, List<Pair<String, String>> properties, io.micronaut.inject.visitor.VisitorContext context) void
finish
(io.micronaut.inject.visitor.VisitorContext context) int
getOrder()
protected <T,
A extends Annotation>
List<T>processOpenApiAnnotation
(io.micronaut.inject.ast.Element element, io.micronaut.inject.visitor.VisitorContext context, Class<A> annotationType, Class<T> modelType, List<T> tagList) Converts annotation to model.protected void
processSecuritySchemes
(io.micronaut.inject.ast.ClassElement element, io.micronaut.inject.visitor.VisitorContext context) ProcessesSecurityScheme
annotations.static void
removeUnusedSchemas
(io.swagger.v3.oas.models.OpenAPI openApi) static boolean
removeUnusedSchemasIter
(io.swagger.v3.oas.models.OpenAPI openApi) static String
replacePlaceholders
(String value, io.micronaut.inject.visitor.VisitorContext context) static com.fasterxml.jackson.databind.JsonNode
resolvePlaceholders
(com.fasterxml.jackson.databind.JsonNode node, UnaryOperator<String> propertyExpander) static com.fasterxml.jackson.databind.JsonNode
resolvePlaceholders
(com.fasterxml.jackson.databind.node.ArrayNode anode, UnaryOperator<String> propertyExpander) static com.fasterxml.jackson.databind.JsonNode
resolvePlaceholders
(com.fasterxml.jackson.databind.node.ObjectNode onode, UnaryOperator<String> propertyExpander) void
start
(io.micronaut.inject.visitor.VisitorContext context) void
visitClass
(io.micronaut.inject.ast.ClassElement element, io.micronaut.inject.visitor.VisitorContext context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.util.Toggleable
isEnabled
Methods inherited from interface io.micronaut.inject.visitor.TypeElementVisitor
getClassType, getElementType, getSupportedAnnotationNames, getVisitorKind, visitConstructor, visitEnumConstant, visitField, visitMethod
-
Field Details
-
DEFAULT_OPENAPI_TITLE
- See Also:
-
DEFAULT_OPENAPI_VERSION
- See Also:
-
-
Constructor Details
-
OpenApiApplicationVisitor
public OpenApiApplicationVisitor()
-
-
Method Details
-
start
public void start(io.micronaut.inject.visitor.VisitorContext context) -
getSupportedOptions
-
visitClass
public void visitClass(io.micronaut.inject.ast.ClassElement element, io.micronaut.inject.visitor.VisitorContext context) -
resolvePlaceholders
public static com.fasterxml.jackson.databind.JsonNode resolvePlaceholders(com.fasterxml.jackson.databind.node.ArrayNode anode, UnaryOperator<String> propertyExpander) -
resolvePlaceholders
public static com.fasterxml.jackson.databind.JsonNode resolvePlaceholders(com.fasterxml.jackson.databind.node.ObjectNode onode, UnaryOperator<String> propertyExpander) -
resolvePlaceholders
public static com.fasterxml.jackson.databind.JsonNode resolvePlaceholders(com.fasterxml.jackson.databind.JsonNode node, UnaryOperator<String> propertyExpander) -
expandProperties
-
replacePlaceholders
-
finish
public void finish(io.micronaut.inject.visitor.VisitorContext context) -
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceio.micronaut.core.order.Ordered
-
removeUnusedSchemas
public static void removeUnusedSchemas(io.swagger.v3.oas.models.OpenAPI openApi) -
removeUnusedSchemasIter
public static boolean removeUnusedSchemasIter(io.swagger.v3.oas.models.OpenAPI openApi) -
processSecuritySchemes
protected void processSecuritySchemes(io.micronaut.inject.ast.ClassElement element, io.micronaut.inject.visitor.VisitorContext context) ProcessesSecurityScheme
annotations.- Parameters:
element
- The elementcontext
- The visitor context
-
processOpenApiAnnotation
protected <T,A extends Annotation> List<T> processOpenApiAnnotation(io.micronaut.inject.ast.Element element, io.micronaut.inject.visitor.VisitorContext context, Class<A> annotationType, Class<T> modelType, List<T> tagList) Converts annotation to model.- Type Parameters:
T
- The model type.A
- The annotation type.- Parameters:
element
- The element to process.context
- The context.annotationType
- The annotation type.modelType
- The model type.tagList
- The initial list of models.- Returns:
- A list of model objects.
-