openapi: 3.0.0 info: title: Example API version: 1.0.0 paths: /hello: get: responses: '200': description: A simple hello world content: text/plain: schema: type: string components: schemas: Pet: type: object required: - name - type properties: name: type: string type: type: string enum: - dog - cat age: type: integer
What to generate
genTypes
HTTP_MODELS - Jackson annotated data classes to represent the schema objects defined in the input.
CONTROLLERS - Spring / Micronaut / Ktor HTTP controllers for each of the endpoints defined in the input.
CLIENT - Simple http rest client.
QUARKUS_REFLECTION_CONFIG - This options generates the reflection-config.json file for quarkus integration projects
Model Options
serializationLibrary
JACKSON - Use Jackson for serialization and deserialization
KOTLINX_SERIALIZATION - Use kotlinx.serialization for serialization and deserialization
modelOptions
X_EXTENSIBLE_ENUMS - This option treats x-extensible-enums as enums
JAVA_SERIALIZATION - This option adds Java Serializable interface to the generated models
QUARKUS_REFLECTION - This option adds @RegisterForReflection to the generated models. Requires dependency "'io.quarkus:quarkus-core:+"
MICRONAUT_INTROSPECTION - This option adds @Introspected to the generated models. Requires dependency "'io.micronaut:micronaut-core:+"
MICRONAUT_REFLECTION - This option adds @ReflectiveAccess to the generated models. Requires dependency "'io.micronaut:micronaut-core:+"
MICRONAUT_SERDEABLE - This option adds @Serdeable to the generated models. Requires dependency "'io.micronaut.serde:micronaut-serde-jackson:+"
INCLUDE_COMPANION_OBJECT - This option adds a companion object to the generated models.
SEALED_INTERFACES_FOR_ONE_OF - This option is deprecated. Sealed interfaces are enabled by default in v26+. Use DISABLE_SEALED_INTERFACES_FOR_ONE_OF to disable.
DISABLE_SEALED_INTERFACES_FOR_ONE_OF - This option disables the default sealed interfaces for oneOf behavior in v26+
NON_NULL_MAP_VALUES - This option makes map values non-null. The default (since v15) and most spec compliant is make map values nullable
FAULT_TOLERANT_ENUMS - This option adds an UNRECOGNIZED enum entry as a fallback for unmapped values, preventing deserialization exceptions. If jackson is used, the deserialization option **READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE** will need to be enabled as well
modelSuffix
typeOverrides
DATETIME_AS_INSTANT - Use Instant as the datetime type. Defaults to OffsetDateTime
DATETIME_AS_LOCALDATETIME - Use LocalDateTime as the datetime type. Defaults to OffsetDateTime
BYTE_AS_STRING - Ignore string format byte and use String as the type
BINARY_AS_STRING - Ignore string format binary and use String as the type
URI_AS_STRING - Ignore string format uri and use String as the type
UUID_AS_STRING - Ignore string format uuid and use String as the type
DATE_AS_STRING - Ignore string format date and use String as the type
DATETIME_AS_STRING - Ignore string format date-time and use String as the type
BYTEARRAY_AS_INPUTSTREAM - Use InputStream as ByteArray type. Defaults to ByteArray
Client Options
clientTarget
OK_HTTP - Generate OkHttp client.
OPEN_FEIGN - Generate OpenFeign client.
SPRING_HTTP_INTERFACE - Generate Spring HTTP Interface.
KTOR - Generate Ktor client.
clientOptions
RESILIENCE4J - Generates a fault tolerance service for the client using the following library "io.github.resilience4j:resilience4j-all:+" (only for OkHttp clients)
SUSPEND_MODIFIER - This option adds the suspend modifier to the generated client functions (only for OpenFeign clients)
SPRING_RESPONSE_ENTITY_WRAPPER - This option adds the Spring-ResponseEntity generic around the response to be able to get response headers and status (only for OpenFeign clients).
SPRING_CLOUD_OPENFEIGN_STARTER_ANNOTATION - This option adds the @FeignClient annotation to generated client interface
Server Options
controllerTarget
SPRING - Generate for Spring framework.
MICRONAUT - Generate for Micronaut framework.
KTOR - Generate for Ktor server.
controllerOptions
SUSPEND_MODIFIER - This option adds the suspend modifier to the generated controller functions
AUTHENTICATION - This option adds the authentication parameter to the generated controller functions
COMPLETION_STAGE - This option makes generated controller functions have Type CompletionStage
(works only with Spring Controller generator). Can be overridden per operation using the OpenAPI extension x-async-support: true|false
SSE_EMITTER - This option makes generated controller functions have Type SseEmitter (works only with Spring Controller generator)
Validation Options
validationLibrary
JAVAX_VALIDATION - Use javax.validation annotations in generated model classes
JAKARTA_VALIDATION - Use jakarta.validation annotations in generated model classes (default)
NO_VALIDATION - Use no validation annotations in generated model classes
External References
externalRefResolutionMode
TARGETED - Generate models only for directly referenced schemas in external API files.
AGGRESSIVE - Referencing any schema in an external API file triggers generation of every external schema in that file.
Output Options
outputOptions
ADD_FILE_DISCLAIMER - This option adds a disclaimer to the generated files.
// Files will appear here
Fabrikt on GitHub
v2e5445b
// Output will appear here