Quarkus - OpenAPI Generator - Server - Apicurio
Quarkus' extension for generation of server Stubs based on OpenAPI specification files.
This server extension has support for two code generation tools:
|
This extension is for REST code generation for server side only. |
Want to contribute? Great! We try to make it easy, and all contributions, even the smaller ones, are more than welcome. This includes bug reports, fixes, documentation, examples… But first, read this page.
Apicurio vs OpenAPITools
The following table compares the Apicurio and OpenAPITools code generators.
| Aspect | Apicurio Code Generator | OpenAPITools Code Generator |
|---|---|---|
How it is selected |
Explicit via |
Explicit via |
Customization mechanism |
OpenAPI specification extensions ( |
Configuration properties |
Customization location |
OpenAPI document (root, paths, schemas, properties) |
Not supported |
Fine-grained control per operation |
Yes ( |
Yes ( |
Fine-grained control per schema |
Yes ( |
Not supported |
Add annotations to generated beans |
Yes ( |
Yes ( |
Add annotations to method parameters |
Yes ( |
Not supported |
Async / reactive support |
Per operation via |
Global via |
Custom return types |
Yes ( |
|
Context root configuration |
Via OpenAPI ( |
Not supported |
Date/time formatting control |
Yes ( |
Not supported |
Inline schemas instead of generating classes |
Yes ( |
Not supported |
Override generated Java type |
Yes ( |
Not supported |
Extend a base class |
Yes ( |
Not supported |
Package customization |
Per schema via |
Globally via |
OpenAPI spec location |
|
|
Supported OpenAPI formats |
JSON, YAML, YML |
JSON, YAML, YML |
Generated sources location |
|
|
Customization philosophy |
Spec-driven, fine-grained, declarative |
Property-driven, coarse-grained |
Extension maturity |
Preview |
Experimental / early development |
Both generators support multi-file OpenAPI documents with relative $ref entries. Keep the referenced files under the same input base directory as the entry spec so they can be resolved during generation.
You can also generate multiple server stubs in a single project by configuring one block per spec under quarkus.openapi.generator.server.spec.<id>.*. The <id> can either be the sanitized relative file name, such as petstore_openapi_json, or an alias when you also set quarkus.openapi.generator.server.spec.<id>.spec=<file>.
|
When using per-spec configuration ( |
Configuration Properties
Configuration property fixed at build time - All other configuration properties are overridable at runtime
Configuration property |
Type |
Default |
|---|---|---|
This property is deprecated: Use The OpenAPI specification filename. Environment variable: |
string |
|
This property is deprecated: Use The input base dir where the OpenAPI specification is. Environment variable: |
string |
|
This property is deprecated: Use Whether it must generate with reactive code. Environment variable: |
boolean |
|
This property is deprecated: Whether it must generate builders for properties. Environment variable: |
boolean |
|
This property is deprecated: Use The base package to be used to generated sources. Environment variable: |
string |
|
This property is deprecated: Use Whether it must generate resources and beans using bean validation (JSR-303). Environment variable: |
boolean |
|
The generator to be used for generating the server code. Possible values are: By default, is Environment variable: |
string |
|
The OpenAPI specification filename. Environment variable: |
string |
|
The input base dir where the OpenAPI specification is. Environment variable: |
string |
|
Whether it must generate with reactive code. Environment variable: |
boolean |
|
Whether it must generate builders for properties. Environment variable: |
boolean |
|
The base package to be used to generated sources. Environment variable: |
string |
|
Whether it must generate resources and beans using bean validation (JSR-303). Environment variable: |
boolean |
|
Whether the generated server methods should use Environment variable: |
boolean |
|
Whether to skip generation when the persisted fingerprint of the OpenAPI specification and relevant generation configuration matches the previous run. Environment variable: |
boolean |
|
List of OpenAPI file names to include for code generation. When set, only the listed files are processed by the auto-discovery mechanism. Environment variable: |
list of string |
|
List of OpenAPI file names to exclude from code generation. When set, the listed files are skipped by the auto-discovery mechanism. This is useful for excluding shared reference files (e.g., Environment variable: |
list of string |
|
The name of the method parameter that should be used to return the response from the operation. Environment variable: |
string |
required |