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>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.inject.visitor.TypeElementVisitor
io.micronaut.inject.visitor.TypeElementVisitor.VisitorKind -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringexpandProperties(String s, List<Pair<String, String>> properties, io.micronaut.inject.visitor.VisitorContext context) voidfinish(@NonNull io.micronaut.inject.visitor.VisitorContext context) voidfinishCompilation(@NonNull io.micronaut.inject.visitor.VisitorContext context) Notes that every round of the compilation is over.intgetOrder()static voidremoveUnusedSchemas(io.swagger.v3.oas.models.OpenAPI openApi) static booleanremoveUnusedSchemasIter(io.swagger.v3.oas.models.OpenAPI openApi) static StringreplacePlaceholders(String value, io.micronaut.inject.visitor.VisitorContext context) static tools.jackson.databind.JsonNoderesolvePlaceholders(tools.jackson.databind.JsonNode node, UnaryOperator<String> propertyExpander) static tools.jackson.databind.JsonNoderesolvePlaceholders(tools.jackson.databind.node.ArrayNode anode, UnaryOperator<String> propertyExpander) static tools.jackson.databind.JsonNoderesolvePlaceholders(tools.jackson.databind.node.ObjectNode objNode, UnaryOperator<String> propertyExpander) voidstart(@NonNull io.micronaut.inject.visitor.VisitorContext context) voidvisitClass(@NonNull io.micronaut.inject.ast.ClassElement element, @NonNull io.micronaut.inject.visitor.VisitorContext context) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.util.Toggleable
isEnabledMethods inherited from interface io.micronaut.inject.visitor.TypeElementVisitor
getClassType, getElementType, getVisitorKind, query, visitConstructor, visitEnumConstant, visitField, visitMethod
-
Field Details
-
DEFAULT_OPENAPI_TITLE
- See Also:
-
DEFAULT_OPENAPI_VERSION
- See Also:
-
DEFAULT_DOCUMENT_TITLE
- See Also:
-
PREFIX_DUMMY_FILE
- See Also:
-
-
Constructor Details
-
OpenApiApplicationVisitor
public OpenApiApplicationVisitor()
-
-
Method Details
-
start
-
getSupportedOptions
-
getSupportedAnnotationNames
-
visitClass
-
resolvePlaceholders
public static tools.jackson.databind.JsonNode resolvePlaceholders(tools.jackson.databind.node.ArrayNode anode, UnaryOperator<String> propertyExpander) -
resolvePlaceholders
public static tools.jackson.databind.JsonNode resolvePlaceholders(tools.jackson.databind.node.ObjectNode objNode, UnaryOperator<String> propertyExpander) -
resolvePlaceholders
public static tools.jackson.databind.JsonNode resolvePlaceholders(tools.jackson.databind.JsonNode node, UnaryOperator<String> propertyExpander) -
expandProperties
-
replacePlaceholders
-
finishCompilation
public void finishCompilation(@NonNull io.micronaut.inject.visitor.VisitorContext context) Notes that every round of the compilation is over. What the visitors keep of the compilation in static fields is released at the end of the call tofinish(VisitorContext)that follows, the last one of the compilation, rather than here: KSP and Groovy callfinishonce, after this method, and that call writes the document. This visitor finishes after the extra schema visitor, which reads that state in its ownfinish.Without the release, a compiler that keeps the classes of the processors for the next compilation, as a daemon or development mode does, would start the next document with the extra schemas and schema names of this one: an extra schema removed would stay, and a class renamed would get its schema name with a suffix.
Micronaut calls this method from 5.3.0, where
TypeElementVisitordeclares it. Earlier versions never call it, and the state stays with the classes as before.- Parameters:
context- The visitor context
-
finish
-
getOrder
public int getOrder()- Specified by:
getOrderin 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)
-