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
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    expandProperties(String s, List<Pair<String,String>> properties, io.micronaut.inject.visitor.VisitorContext context)
     
    void
    finish(io.micronaut.inject.visitor.VisitorContext context)
     
    int
     
     
    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)
    Processes SecurityScheme 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

  • Constructor Details

    • OpenApiApplicationVisitor

      public OpenApiApplicationVisitor()
  • Method Details

    • start

      public void start(io.micronaut.inject.visitor.VisitorContext context)
      Specified by:
      start in interface io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
    • getSupportedOptions

      public Set<String> getSupportedOptions()
      Specified by:
      getSupportedOptions in interface io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
    • visitClass

      public void visitClass(io.micronaut.inject.ast.ClassElement element, io.micronaut.inject.visitor.VisitorContext context)
      Specified by:
      visitClass in interface io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
    • 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

      public static String expandProperties(String s, List<Pair<String,String>> properties, io.micronaut.inject.visitor.VisitorContext context)
    • replacePlaceholders

      public static String replacePlaceholders(String value, io.micronaut.inject.visitor.VisitorContext context)
    • finish

      public void finish(io.micronaut.inject.visitor.VisitorContext context)
      Specified by:
      finish in interface io.micronaut.inject.visitor.TypeElementVisitor<Object,Object>
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface io.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)
      Processes SecurityScheme annotations.
      Parameters:
      element - The element
      context - 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.