Package io.micronaut.openapi.visitor
Class Utils
java.lang.Object
io.micronaut.openapi.visitor.Utils
Some util methods.
- Since:
- 4.4.0
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clean()
static <T> List<T>
findAndRemoveDuplicates
(List<T> elements, BiPredicate<T, T> predicate) Find and remove duplicates in lists.static Map<String,
List<EndpointInfo>> static JavadocParser
static io.micronaut.context.env.PropertyPlaceholderResolver
static String
static String
static io.swagger.v3.oas.models.OpenAPI
static Map<Pair<String,
String>, OpenApiInfo> static String
static boolean
static <T extends Enum<T>>
voidnormalizeEnumValues
(Map<CharSequence, Object> paramValues, Map<String, Class<T>> enumTypes) Normalizes enum values stored in the map.static String
Return stacktrace for throwable and message.static io.swagger.v3.oas.models.Components
resolveComponents
(io.swagger.v3.oas.models.OpenAPI openAPI) Resolve the components.static io.swagger.v3.oas.models.OpenAPI
resolveOpenApi
(io.micronaut.inject.visitor.VisitorContext context) Resolve theOpenAPI
instance.static void
setAllKnownGroups
(Set<String> allKnownGroups) static void
setAllKnownVersions
(Set<String> allKnownVersions) static void
setEndpointInfos
(Map<String, List<EndpointInfo>> endpointInfos) static void
setIncludedClassesGroups
(Map<String, List<String>> includedClassesGroups) static void
setIncludedClassesGroupsExcluded
(Map<String, List<String>> includedClassesGroupsExcluded) static void
setJavadocParser
(JavadocParser javadocParser) static void
setOpenApis
(Map<String, io.swagger.v3.oas.models.OpenAPI> openApis) static void
setTestFileName
(String testFileName) static void
setTestJsonReference
(String testJsonReference) static void
setTestReference
(io.swagger.v3.oas.models.OpenAPI testReference) static void
setTestReferences
(Map<Pair<String, String>, OpenApiInfo> testReferences) static void
setTestYamlReference
(String testYamlReference)
-
Field Details
-
PLACEHOLDER_PREFIX
- See Also:
-
PLACEHOLDER_POSTFIX
- See Also:
-
ATTR_OPENAPI
- See Also:
-
ATTR_TEST_MODE
- See Also:
-
ATTR_VISITED_ELEMENTS
- See Also:
-
DEFAULT_MEDIA_TYPES
-
-
Method Details
-
getPropertyPlaceholderResolver
public static io.micronaut.context.env.PropertyPlaceholderResolver getPropertyPlaceholderResolver()- Returns:
- An Instance of default
PropertyPlaceholderResolver
to resolve placeholders.
-
normalizeEnumValues
public static <T extends Enum<T>> void normalizeEnumValues(Map<CharSequence, Object> paramValues, Map<String, Class<T>> enumTypes) Normalizes enum values stored in the map.- Type Parameters:
T
- enum class- Parameters:
paramValues
- The valuesenumTypes
- The enum types.
-
findAndRemoveDuplicates
Find and remove duplicates in lists.- Type Parameters:
T
- elements class- Parameters:
elements
- list of elementspredicate
- predicate for calculating duplicate element- Returns:
- list of elements without duplicates
-
resolveComponents
public static io.swagger.v3.oas.models.Components resolveComponents(io.swagger.v3.oas.models.OpenAPI openAPI) Resolve the components.- Parameters:
openAPI
- The open API- Returns:
- The components
-
resolveOpenApi
public static io.swagger.v3.oas.models.OpenAPI resolveOpenApi(io.micronaut.inject.visitor.VisitorContext context) Resolve theOpenAPI
instance.- Parameters:
context
- The context- Returns:
- The
OpenAPI
instance
-
printStackTrace
Return stacktrace for throwable and message.- Parameters:
t
- throwable- Returns:
- stacktrace
-
isTestMode
public static boolean isTestMode() -
getTestReference
public static io.swagger.v3.oas.models.OpenAPI getTestReference() -
setTestReference
public static void setTestReference(io.swagger.v3.oas.models.OpenAPI testReference) -
getTestReferences
-
setTestReferences
-
getTestYamlReference
-
setTestYamlReference
-
getTestJsonReference
-
getTestFileName
-
setTestFileName
-
setTestJsonReference
-
getJavadocParser
-
setJavadocParser
-
getAllKnownVersions
-
setAllKnownVersions
-
getAllKnownGroups
-
setAllKnownGroups
-
getEndpointInfos
-
setEndpointInfos
-
getOpenApis
-
setOpenApis
-
getIncludedClassesGroups
-
setIncludedClassesGroups
-
getIncludedClassesGroupsExcluded
-
setIncludedClassesGroupsExcluded
-
clean
public static void clean()
-