Package io.micronaut.openapi.generator
Interface MicronautCodeGeneratorBuilder
public interface MicronautCodeGeneratorBuilder
A code generator builder.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a configured code generator.default MicronautCodeGeneratorBuilderConfigures the code generator to create a client.forClient(Consumer<? super JavaMicronautClientOptionsBuilder> clientOptionsSpec) Configures the code generator to create a client.<B extends GeneratorOptionsBuilder,G extends MicronautCodeGenerator<B>>
MicronautCodeGeneratorBuilderforCodeGenerator(G generator, Consumer<? super B> configuration) Sets the code generator which should be used (e.g server or client).default MicronautCodeGeneratorBuilderConfigures the code generator to create a server.forServer(Consumer<? super JavaMicronautServerOptionsBuilder> serverOptionsSpec) Configures the code generator to create a server.withDefinitionFile(URI definitionFile) Sets the URI to the OpenAPI definition file.withOptions(Consumer<? super MicronautCodeGeneratorOptionsBuilder> optionsConfigurer) Configures the code generation options.withOutputDirectory(File outputDirectory) Sets the directory where to output the generated sources.withOutputs(MicronautCodeGeneratorEntryPoint.OutputKind... elements) Sets which output files should be generated.
-
Method Details
-
forCodeGenerator
<B extends GeneratorOptionsBuilder,G extends MicronautCodeGenerator<B>> MicronautCodeGeneratorBuilder forCodeGenerator(G generator, Consumer<? super B> configuration) Sets the code generator which should be used (e.g server or client).- Type Parameters:
B- the type of the builder used to configure the options specific to this generatorG- the type of the generator- Parameters:
generator- the generatorconfiguration- the configuration block for this generator- Returns:
- this builder
-
forClient
Configures the code generator to create a client.- Returns:
- this builder
-
forClient
MicronautCodeGeneratorBuilder forClient(Consumer<? super JavaMicronautClientOptionsBuilder> clientOptionsSpec) Configures the code generator to create a client.- Parameters:
clientOptionsSpec- the client options- Returns:
- this builder
-
forServer
Configures the code generator to create a server.- Returns:
- this builder
-
forServer
MicronautCodeGeneratorBuilder forServer(Consumer<? super JavaMicronautServerOptionsBuilder> serverOptionsSpec) Configures the code generator to create a server.- Parameters:
serverOptionsSpec- the server options- Returns:
- this builder
-
withDefinitionFile
Sets the URI to the OpenAPI definition file. It is recommended to use a local path instead of using a remote URI.- Parameters:
definitionFile- the definition file- Returns:
- this builder
-
withOutputDirectory
Sets the directory where to output the generated sources.- Parameters:
outputDirectory- the generated sources output directory- Returns:
- this builder
-
withOutputs
Sets which output files should be generated.- Parameters:
elements- the different elements to generate- Returns:
- this builder
-
withOptions
MicronautCodeGeneratorBuilder withOptions(Consumer<? super MicronautCodeGeneratorOptionsBuilder> optionsConfigurer) Configures the code generation options.- Parameters:
optionsConfigurer- the configuration- Returns:
- this builder
-
build
MicronautCodeGeneratorEntryPoint build()Returns a configured code generator.- Returns:
- the configured code generator
-