Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .github/workflows/samples-java-client-jdk17.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
- samples/client/others/java/restclient-enum-in-multipart/**
- samples/client/others/java/restclient-sealedInterface/**
- samples/client/others/java/restclient-jackson-default-impl/**
- samples/client/others/java/restclient-useAbstractionForFiles/**
- samples/client/petstore/java/jersey3-oneOf/**
- samples/client/petstore/java/jersey3-jackson3/**
Expand All @@ -37,6 +38,7 @@ on:
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
- samples/client/others/java/restclient-enum-in-multipart/**
- samples/client/others/java/restclient-sealedInterface/**
- samples/client/others/java/restclient-jackson-default-impl/**
- samples/client/others/java/restclient-useAbstractionForFiles/**
- samples/client/petstore/java/jersey3-oneOf/**
- samples/client/petstore/java/jersey3-jackson3/**
Expand Down Expand Up @@ -72,6 +74,7 @@ jobs:
- samples/client/petstore/java/webclient-useSingleRequestParameter
- samples/client/others/java/restclient-enum-in-multipart
- samples/client/others/java/restclient-sealedInterface
- samples/client/others/java/restclient-jackson-default-impl
- samples/client/others/java/restclient-useAbstractionForFiles
- samples/client/petstore/java/jersey3-oneOf
- samples/client/petstore/java/jersey3-jackson3
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/samples-jdk17.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
- samples/openapi3/server/petstore/springboot-3-include-http-request-context/**
- samples/server/petstore/springboot-x-implements-skip/**
- samples/server/petstore/java-camel/**
- samples/server/petstore/java-camel-oneof-jackson-default-impl/**
- samples/server/petstore/java-helidon-server/v3/mp/**
- samples/server/petstore/java-helidon-server/v3/se/**
- samples/server/petstore/jaxrs-spec-sealed/**
Expand All @@ -45,6 +46,7 @@ on:
- samples/openapi3/server/petstore/springboot-3-include-http-request-context/**
- samples/server/petstore/springboot-x-implements-skip/**
- samples/server/petstore/java-camel/**
- samples/server/petstore/java-camel-oneof-jackson-default-impl/**
- samples/server/petstore/java-helidon-server/v3/mp/**
- samples/server/petstore/java-helidon-server/v3/se/**
- samples/server/petstore/jaxrs-spec-sealed/**
Expand Down Expand Up @@ -76,6 +78,7 @@ jobs:
- samples/openapi3/server/petstore/springboot-3-include-http-request-context
- samples/server/petstore/springboot-x-implements-skip
- samples/server/petstore/java-camel/
- samples/server/petstore/java-camel-oneof-jackson-default-impl
- samples/server/petstore/java-helidon-server/v3/mp/
- samples/server/petstore/java-helidon-server/v3/se
- samples/server/petstore/jaxrs-spec-sealed
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/samples-kotlin-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- samples/client/others/kotlin-jvm-spring-3-restclient-nullable-return/**
- samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization*/**
- samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization*/**
- samples/client/others/kotlin-oneof-jackson-default-impl/**
pull_request:
paths:
- 'samples/client/petstore/kotlin*/**'
Expand All @@ -17,6 +18,7 @@ on:
- samples/client/others/kotlin-jvm-spring-3-restclient-nullable-return/**
- samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization*/**
- samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization*/**
- samples/client/others/kotlin-oneof-jackson-default-impl/**

jobs:
build:
Expand Down Expand Up @@ -82,6 +84,7 @@ jobs:
- samples/client/others/kotlin-integer-enum
- samples/client/petstore/kotlin-allOf-discriminator-kotlinx-serialization
- samples/client/others/kotlin-oneOf-discriminator-kotlinx-serialization
- samples/client/others/kotlin-oneof-jackson-default-impl
- samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization
- samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization-nonPublicApi
- samples/client/others/kotlin-oneOf-anyOf-kotlinx-serialization-explicitApi
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/samples-kotlin-server-jdk17.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- 'samples/server/petstore/kotlin-spring-sealed-interfaces/**'
- 'samples/server/petstore/kotlin-springboot-sort-validation/**'
- 'samples/server/petstore/kotlin-springboot-paged-model/**'
- 'samples/server/petstore/kotlin-spring-oneof-jackson-default-impl/**'
- 'samples/server/petstore/kotlin-server/ktor-delegate-pattern/generated/**'
# comment out due to gradle build failure
# - samples/server/petstore/kotlin-spring-default/**
Expand All @@ -30,6 +31,7 @@ on:
- 'samples/server/petstore/kotlin-spring-sealed-interfaces/**'
- 'samples/server/petstore/kotlin-springboot-sort-validation/**'
- 'samples/server/petstore/kotlin-springboot-paged-model/**'
- 'samples/server/petstore/kotlin-spring-oneof-jackson-default-impl/**'
- 'samples/server/petstore/kotlin-server/ktor-delegate-pattern/generated/**'
# comment out due to gradle build failure
# - samples/server/petstore/kotlin-spring-default/**
Expand Down Expand Up @@ -75,6 +77,7 @@ jobs:
- samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped
- samples/server/petstore/kotlin-spring-declarative-interface-wrapped
- samples/server/petstore/kotlin-spring-sealed-interfaces
- samples/server/petstore/kotlin-spring-oneof-jackson-default-impl
- samples/server/petstore/kotlin-springboot-sort-validation
- samples/server/petstore/kotlin-springboot-paged-model
# comment out due to gradle build failure
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/samples-spring-jdk17.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
- samples/server/others/springboot-pre-authorize/**
- samples/openapi3/server/petstore/spring-boot-oneof-sealed/**
- samples/openapi3/server/petstore/spring-boot-oneof-interface/**
- samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/**
- samples/client/petstore/spring-http-interface-oauth/**
pull_request:
paths:
Expand All @@ -42,6 +43,7 @@ on:
- samples/server/others/springboot-pre-authorize/**
- samples/openapi3/server/petstore/spring-boot-oneof-sealed/**
- samples/openapi3/server/petstore/spring-boot-oneof-interface/**
- samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/**
- samples/client/petstore/spring-http-interface-oauth/**
jobs:
build:
Expand Down Expand Up @@ -71,6 +73,7 @@ jobs:
- samples/server/others/springboot-pre-authorize
- samples/openapi3/server/petstore/spring-boot-oneof-sealed
- samples/openapi3/server/petstore/spring-boot-oneof-interface
- samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl
- samples/client/petstore/spring-http-interface-oauth
steps:
- uses: actions/checkout@v7
Expand Down
25 changes: 25 additions & 0 deletions bin/configs/java-camel-oneof-jackson-default-impl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
generatorName: java-camel
outputDir: samples/server/petstore/java-camel-oneof-jackson-default-impl
inputSpec: modules/openapi-generator/src/test/resources/3_0/jackson-default-impl-oneof.yaml
templateDir: modules/openapi-generator/src/main/resources/java-camel-server
globalProperties:
apiTests: "false"
modelTests: "false"
additionalProperties:
hideGenerationTimestamp: true
artifactId: java-camel-oneof-jackson-default-impl
camelRestBindingMode: "auto"
performBeanValidation: true
camelDataformatProperties: "json.out.disableFeatures=WRITE_DATES_AS_TIMESTAMPS"
jackson: true
camelUseDefaultValidationErrorProcessor: true
camelRestClientRequestValidation: true
camelSecurityDefinitions: true
implicitHeaders: true
useSpringBoot3: false
useOneOfInterfaces: "true"
useDeductionForOneOfInterfaces: "true"
generateJsonIncludeAnnotations: "true"
generateJsonSetterNullsAnnotations: "true"
typeInfoDefaultImpls:
Fruit: Apple
12 changes: 12 additions & 0 deletions bin/configs/java-restclient-jackson-default-impl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
generatorName: java
outputDir: samples/client/others/java/restclient-jackson-default-impl
library: restclient
inputSpec: modules/openapi-generator/src/test/resources/3_0/jackson-default-impl-oneof.yaml
templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: restclient-jackson-default-impl
hideGenerationTimestamp: "true"
useOneOfInterfaces: "true"
useDeductionForOneOfInterfaces: "true"
typeInfoDefaultImpls:
Fruit: Apple
12 changes: 12 additions & 0 deletions bin/configs/kotlin-oneof-jackson-default-impl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
generatorName: kotlin
outputDir: samples/client/others/kotlin-oneof-jackson-default-impl
inputSpec: modules/openapi-generator/src/test/resources/3_0/jackson-default-impl-oneof.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
artifactId: kotlin-oneof-jackson-default-impl
serializationLibrary: jackson
library: jvm-retrofit2
enumUnknownDefaultCase: true
useOneOfInterfaces: "true"
typeInfoDefaultImpls:
Fruit: Apple
18 changes: 18 additions & 0 deletions bin/configs/kotlin-spring-oneof-jackson-default-impl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
generatorName: kotlin-spring
outputDir: samples/server/petstore/kotlin-spring-oneof-jackson-default-impl
library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/3_0/jackson-default-impl-oneof.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring
additionalProperties:
artifactId: kotlin-spring-oneof-jackson-default-impl
documentationProvider: none
annotationLibrary: none
useSwaggerUI: "false"
interfaceOnly: "true"
useSpringBoot3: "true"
useOneOfInterfaces: "true"
useDeductionForOneOfInterfaces: "true"
generateJsonIncludeAnnotations: "true"
generateJsonSetterNullsAnnotations: "true"
typeInfoDefaultImpls:
Fruit: Apple
16 changes: 16 additions & 0 deletions bin/configs/spring-boot-oneof-jackson-default-impl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl
inputSpec: modules/openapi-generator/src/test/resources/3_0/jackson-default-impl-oneof.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
documentationProvider: springdoc
artifactId: springboot-oneof-jackson-default-impl
snapshotVersion: "true"
hideGenerationTimestamp: "true"
useOneOfInterfaces: "true"
useDeductionForOneOfInterfaces: "true"
generateJsonIncludeAnnotations: "true"
generateJsonSetterNullsAnnotations: "true"
typeInfoDefaultImpls:
Fruit: Apple
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ additionalProperties:
# performBeanValidation should default to "false" when not specified
useResponseEntity: "false"
useSpringBoot3: "true"
useTags: "true"

2 changes: 1 addition & 1 deletion bin/configs/spring-http-interface-reactive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ additionalProperties:
# useBeanValidation should default to "false" when not specified
# performBeanValidation should default to "false" when not specified
useSpringBoot3: "true"

useTags: "true"
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ additionalProperties:
performBeanValidation: "true"
useHttpServiceProxyFactoryInterfacesConfigurator: "true"
useSpringBoot3: "true"
useTags: "true"
1 change: 1 addition & 0 deletions bin/configs/spring-http-interface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ additionalProperties:
# useBeanValidation should default to "false" when not specified
# performBeanValidation should default to "false" when not specified
useSpringBoot3: "true"
useTags: "true"
2 changes: 2 additions & 0 deletions docs/generators/java-camel.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|substituteGenericPagedModel|Detect schemas that represent paginated responses (an object with a 'content' array property and a 'page' pagination-metadata property) and replace their generated references with PagedModel<T>. By default this uses a generated type in the config package (default 'org.openapitools.configuration'), but `importMappings.PagedModel` can override it to a custom/FQCN-mapped type. The detected page schemas and the pagination metadata schema are suppressed from code generation.| |false|
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|title|server title name or client service name| |OpenAPI Spring|
|typeInfoDefaultImpls|Map of schema name to default Jackson deserialization class for @JsonTypeInfo(defaultImpl=...). Applies to both deduction-based and discriminator-based oneOf interfaces. Overrides x-jackson-default-impl when both are set for the same schema. Example: yaml `typeInfoDefaultImpls: {PostRegistrationRequest: PostRegistrationBasicRequest}`| |empty map|
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
|useBeanValidation|Use BeanValidation API annotations| |true|
|useDeductionForOneOfInterfaces|Annotate discriminator-free oneOf interfaces with Jackson's @JsonTypeInfo(use = Id.DEDUCTION) and @JsonSubTypes so the concrete subtype is resolved from the JSON field set rather than a type-tag property. Has no effect when a discriminator is present (name-based resolution is used instead). Requires subtypes to have structurally distinct sets of properties.| |false|
Expand Down Expand Up @@ -159,6 +160,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|x-minimum-message|Add this property whenever you need to customize the invalidation error message for the minimum value of a variable|FIELD, OPERATION_PARAMETER|null
|x-maximum-message|Add this property whenever you need to customize the invalidation error message for the maximum value of a variable|FIELD, OPERATION_PARAMETER|null
|x-spring-api-version|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).|OPERATION|null
|x-jackson-default-impl|Specifies the default implementation class name for Jackson @JsonTypeInfo(defaultImpl=...) on a oneOf interface schema (deduction-based or discriminator-based). Can be overridden per-schema by the `typeInfoDefaultImpls` generator option.|MODEL|null
|x-jackson-json-include-policy|Manually override the resolved Jackson `@JsonInclude` policy for this property. Must be one of `ALWAYS`, `NON_NULL`, `NON_ABSENT`, `NON_EMPTY`, `NON_DEFAULT`, `USE_DEFAULTS`, `CUSTOM`, or `NONE` to emit no annotation. Always wins over the automatic required/nullable matrix and the `optionalNonNullPropertyJsonInclude` option.|FIELD|resolved automatically per the required/nullable matrix
|x-jackson-json-setter-nulls|Manually override the resolved Jackson `@JsonSetter(nulls = ...)` deserialization null-handling for this property. Must be one of `SKIP` (ignore an explicit JSON null, keeping the default), `FAIL` (reject an explicit JSON null), or `NONE` to emit no annotation. Always wins over the automatic `openApiNullable` default and the `optionalNonNullPropertyJsonSetterNulls` option, and is honored regardless of `generateJsonSetterNullsAnnotations` or whether the property is required/nullable.|FIELD|resolved automatically per the openApiNullable default

Expand Down
2 changes: 2 additions & 0 deletions docs/generators/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|supportUrlQuery|Generate toUrlQueryString in POJO (default to true). Available on `native`, `apache-httpclient` libraries.| |false|
|supportVertxFuture|Also generate api methods that return a vertx Future instead of taking a callback. Only `vertx` supports this option. Requires vertx 4 or greater.| |false|
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|typeInfoDefaultImpls|Map of schema name to default Jackson deserialization class for @JsonTypeInfo(defaultImpl=...). Applies to both deduction-based and discriminator-based oneOf interfaces. Overrides x-jackson-default-impl when both are set for the same schema. Example: yaml `typeInfoDefaultImpls: {PostRegistrationRequest: PostRegistrationBasicRequest}`| |empty map|
|useAbstractionForFiles|Use alternative types instead of java.io.File to allow passing bytes without a file on disk. Available on resttemplate, webclient, restclient, libraries| |false|
|useBeanValidation|Use BeanValidation API annotations| |false|
|useDeductionForOneOfInterfaces|Annotate discriminator-free oneOf interfaces with Jackson's @JsonTypeInfo(use = Id.DEDUCTION) and @JsonSubTypes so the concrete subtype is resolved from the JSON field set rather than a type-tag property. Has no effect when a discriminator is present (name-based resolution is used instead). Requires subtypes to have structurally distinct sets of properties.| |false|
Expand Down Expand Up @@ -131,6 +132,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|x-class-extra-annotation|Custom annotation(s) to be added to model; accepts a string or list of strings|MODEL|null
|x-field-extra-annotation|Custom annotation(s) to be added to property; accepts a string or list of strings|FIELD, OPERATION_PARAMETER|null
|x-webclient-blocking|Specifies if method for specific operation should be blocking or non-blocking(ex: return `Mono<T>/Flux<T>` or `return T/List<T>/Set<T>` & execute `.block()` inside generated method)|OPERATION|false
|x-jackson-default-impl|Specifies the default implementation class name for Jackson @JsonTypeInfo(defaultImpl=...) on a oneOf interface schema (deduction-based or discriminator-based). Can be overridden per-schema by the `typeInfoDefaultImpls` generator option.|MODEL|null


## IMPORT MAPPING
Expand Down
Loading
Loading