Class ParamUtils

java.lang.Object
io.micronaut.openapi.visitor.ParamUtils

@Internal public final class ParamUtils extends Object
Parameter util methods.
Since:
6.16.0
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addVersionParameters(io.swagger.v3.oas.models.Operation swaggerOperation, List<String> names, boolean isHeader)
     
    static String
    calcIn(String path, io.micronaut.http.HttpMethod httpMethod, io.micronaut.inject.ast.ParameterElement methodParam)
     
    static String
    getHeaderName(io.micronaut.inject.ast.TypedElement parameter, String parameterName)
     
    static boolean
    Determines if the parameter is transported as part of the URL or HTTP headers.
    static io.swagger.v3.oas.models.parameters.Parameter.StyleEnum
    paramStyle(io.swagger.v3.oas.annotations.enums.ParameterStyle paramAnnStyle, String in)
     
    static io.swagger.v3.oas.models.parameters.Parameter.StyleEnum
     
    static List<io.swagger.v3.oas.models.parameters.Parameter>
    readClassHeaders(io.micronaut.inject.ast.ClassElement classEl)
    Reads Header annotations from the class element and converts them to OpenAPI parameters.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isTextualIn

      public static boolean isTextualIn(String in)
      Determines if the parameter is transported as part of the URL or HTTP headers. In these locations, binary data (like byte arrays) must be represented as a Base64-encoded string (format: "byte") to comply with the OpenAPI specification, as raw binary data (format: "binary") is not supported in these textual contexts.
      Parameters:
      in - the parameter location (e.g., "path", "query", "header", "cookie")
      Returns:
      true if the parameter location requires textual encoding (Base64) for binary data
    • calcIn

      public static String calcIn(String path, io.micronaut.http.HttpMethod httpMethod, io.micronaut.inject.ast.ParameterElement methodParam)
    • paramStyle

      public static io.swagger.v3.oas.models.parameters.Parameter.StyleEnum paramStyle(io.swagger.v3.oas.annotations.enums.ParameterStyle paramAnnStyle, String in)
    • paramStyleByFormat

      public static io.swagger.v3.oas.models.parameters.Parameter.StyleEnum paramStyleByFormat(String format, String in)
    • getHeaderName

      public static String getHeaderName(io.micronaut.inject.ast.TypedElement parameter, String parameterName)
    • addVersionParameters

      public static void addVersionParameters(io.swagger.v3.oas.models.Operation swaggerOperation, List<String> names, boolean isHeader)
    • readClassHeaders

      public static List<io.swagger.v3.oas.models.parameters.Parameter> readClassHeaders(io.micronaut.inject.ast.ClassElement classEl)
      Reads Header annotations from the class element and converts them to OpenAPI parameters.
      Parameters:
      classEl - The class element (controller) to inspect
      Returns:
      A list of Parameter objects with "header" location