Class ParamUtils
java.lang.Object
io.micronaut.openapi.visitor.ParamUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddVersionParameters(io.swagger.v3.oas.models.Operation swaggerOperation, List<String> names, boolean isHeader) static StringcalcIn(String path, io.micronaut.http.HttpMethod httpMethod, io.micronaut.inject.ast.ParameterElement methodParam) static StringgetHeaderName(io.micronaut.inject.ast.TypedElement parameter, String parameterName) static booleanisTextualIn(String in) Determines if the parameter is transported as part of the URL or HTTP headers.static io.swagger.v3.oas.models.parameters.Parameter.StyleEnumparamStyle(io.swagger.v3.oas.annotations.enums.ParameterStyle paramAnnStyle, String in) static io.swagger.v3.oas.models.parameters.Parameter.StyleEnumparamStyleByFormat(String format, String in) static List<io.swagger.v3.oas.models.parameters.Parameter> readClassHeaders(io.micronaut.inject.ast.ClassElement classEl) ReadsHeaderannotations from the class element and converts them to OpenAPI parameters.
-
Method Details
-
isTextualIn
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
-
paramStyle
public static io.swagger.v3.oas.models.parameters.Parameter.StyleEnum paramStyle(io.swagger.v3.oas.annotations.enums.ParameterStyle paramAnnStyle, String in) -
paramStyleByFormat
-
getHeaderName
-
addVersionParameters
-
readClassHeaders
public static List<io.swagger.v3.oas.models.parameters.Parameter> readClassHeaders(io.micronaut.inject.ast.ClassElement classEl) ReadsHeaderannotations from the class element and converts them to OpenAPI parameters.- Parameters:
classEl- The class element (controller) to inspect- Returns:
- A list of
Parameterobjects with "header" location
-