Package io.micronaut.openapi.generator
Interface KotlinMicronautClientOptionsBuilder
- All Superinterfaces:
GeneratorOptionsBuilder
The client generator options builder.
-
Method Summary
Modifier and TypeMethodDescriptionwithAdditionalClientTypeAnnotations
(List<String> additionalClientTypeAnnotations) Sets annotations for client type (class level annotations).withAuthConfigName
(String authConfigName) Authorization config name.withAuthFilter
(boolean authFilter) Generate AuthorizationFilter or not.withAuthFilterClientIds
(List<String> authFilterClientIds) Sets serviceId annotation property for AuthorizationFilter.withAuthFilterExcludedClientIds
(List<String> authFilterExcludedClientIds) The list of client IDs, for which this filter will NOT be used.withAuthorization
(boolean useAuth) If set to true the client will be configured for authorization.withAuthorizationFilterPattern
(String authorizationFilterPattern) Sets the authorization filter pattern.withAuthorizationFilterPatternStyle
(String authorizationFilterPatternStyle) Sets the authorization filter pattern style.withBasePathSeparator
(String basePathSeparator) Sets the separator to use between the application name and base path when referencing the property.withClientId
(String clientId) Sets the client id.withClientPath
(boolean clientPath) If set to true, Api annotation @Client will be with `path` attribute.withCoroutines
(boolean coroutines) If set to true, generated code will be with suspend methods.withFluxForArrays
(boolean fluxForArrays) If set to true, generated code will be with Flux<?> instead Mono<List<?>>.withGenerateAuthClasses
(boolean generateAuthorizationClasses) Generate authorization classes or not.withGeneratedAnnotation
(boolean generatedAnnotation) If set to true, generated code will be with jakarta.annotation.Generated annotation.withKsp
(boolean ksp) If set to true, generated code will be fully compatible with KSP, but not 100% with KAPT.withPlural
(boolean plural) If set to true, the generated code will pluralize parameters and properties for arrays.withUseApiKeyAuth
(boolean useApiKeyAuth) Generate ApiKeyAuthConfig config or not.withUseBasicAuth
(boolean useBasicAuth) Generate HttpBasicAuthConfig class or not.withUseOauth
(boolean useOauth) Generate AuthorizationFilter with support OAuth2.0 or not.
-
Method Details
-
withAuthorization
If set to true the client will be configured for authorization.- Parameters:
useAuth
- the authorization flag- Returns:
- this builder
-
withGenerateAuthClasses
Generate authorization classes or not.- Parameters:
generateAuthorizationClasses
- Generate authorization classes or not.- Returns:
- this builder
-
withAuthFilter
Generate AuthorizationFilter or not.- Parameters:
authFilter
- Generate AuthorizationFilter or not.- Returns:
- this builder
-
withUseOauth
Generate AuthorizationFilter with support OAuth2.0 or not.- Parameters:
useOauth
- if true, then AuthorizationFilter will be created with support OAuth2.0- Returns:
- this builder
-
withUseBasicAuth
Generate HttpBasicAuthConfig class or not.- Parameters:
useBasicAuth
- if true, then HttpBasicAuthConfig class will be generated- Returns:
- this builder
-
withUseApiKeyAuth
Generate ApiKeyAuthConfig config or not.- Parameters:
useApiKeyAuth
- if true, then ApiKeyAuthConfig class will be generated- Returns:
- this builder
-
withAuthorizationFilterPattern
KotlinMicronautClientOptionsBuilder withAuthorizationFilterPattern(String authorizationFilterPattern) Sets the authorization filter pattern. Can be a list of strings, or single string with `;` separator- Parameters:
authorizationFilterPattern
- the filter pattern- Returns:
- this builder
-
withAuthorizationFilterPatternStyle
KotlinMicronautClientOptionsBuilder withAuthorizationFilterPatternStyle(String authorizationFilterPatternStyle) Sets the authorization filter pattern style. Available values: ANT, REGEX.Default: ANT
- Parameters:
authorizationFilterPatternStyle
- the filter pattern style. Default: ANT- Returns:
- this builder
-
withAuthFilterClientIds
Sets serviceId annotation property for AuthorizationFilter. Usefully, when use one filter for several clients. Can be a list of strings, or single string with `;` separator.By default, if you don't set any authFilterClientIds, value will be a list with one element - `clientId` property value. If you don't want to add any serviceId annotation property for AuthorizationFilter, just set empty list (not null!).
- Parameters:
authFilterClientIds
- the list of client IDs, for which this filter will be used- Returns:
- this builder
-
withAuthFilterExcludedClientIds
KotlinMicronautClientOptionsBuilder withAuthFilterExcludedClientIds(List<String> authFilterExcludedClientIds) The list of client IDs, for which this filter will NOT be used. Can be a list of strings, or single string with `;` separator (if you set this property, by additionalProperties)- Parameters:
authFilterExcludedClientIds
- the list of client IDs, for which this filter will NOT be used- Returns:
- this builder
-
withAuthConfigName
Authorization config name. Using in config properties for HttpBasicAuthConfig and ApiKeyAuthConfig. If not set, clientId value will be used.- Parameters:
authConfigName
- the client id- Returns:
- this builder
-
withClientId
Sets the client id.- Parameters:
clientId
- the client id- Returns:
- this builder
-
withAdditionalClientTypeAnnotations
KotlinMicronautClientOptionsBuilder withAdditionalClientTypeAnnotations(List<String> additionalClientTypeAnnotations) Sets annotations for client type (class level annotations). Can be a list of strings, or single string with `;` separator- Parameters:
additionalClientTypeAnnotations
- the type annotations- Returns:
- this builder
-
withBasePathSeparator
Sets the separator to use between the application name and base path when referencing the property.- Parameters:
basePathSeparator
- the base path separator- Returns:
- this builder
-
withPlural
If set to true, the generated code will pluralize parameters and properties for arrays.- Parameters:
plural
- generate pluralized parameters and properties for arrays- Returns:
- this builder
-
withFluxForArrays
If set to true, generated code will be with Flux<?> instead Mono<List<?>>.- Parameters:
fluxForArrays
- generate code with Flux<?> instead Mono<List<?>> or not- Returns:
- this builder
-
withGeneratedAnnotation
If set to true, generated code will be with jakarta.annotation.Generated annotation.- Parameters:
generatedAnnotation
- generate code with jakarta.annotation.Generated annotation or not- Returns:
- this builder
-
withClientPath
If set to true, Api annotation @Client will be with `path` attribute.- Parameters:
clientPath
- do we need add path attribute to @Client annotation- Returns:
- this builder
-
withKsp
If set to true, generated code will be fully compatible with KSP, but not 100% with KAPT.- Parameters:
ksp
- do we need to generate code compatible only with KSP- Returns:
- this builder
-
withCoroutines
If set to true, generated code will be with suspend methods.- Parameters:
coroutines
- do we need to generate suspend methods- Returns:
- this builder
-