Compare commits

...

20 Commits

Author SHA1 Message Date
William Cheng
34bc4c02e1 update tests 2025-10-31 14:49:16 +08:00
William Cheng
ba2d025100 Merge remote-tracking branch 'origin/master' into follow-21994 2025-10-31 14:15:52 +08:00
William Cheng
9b8ab659ac update undertow to newer version (#22259) 2025-10-31 13:27:43 +08:00
William Cheng
f9d2b8b579 Prepare v7.18.0 release (#22250)
* Revert "v7.17.0 release (#22248)"

This reverts commit 0120486e62.

* prepare v7.18.0 release

* update samples

* update doc
2025-10-30 01:25:35 +08:00
William Cheng
0120486e62 v7.17.0 release (#22248) 2025-10-30 00:18:40 +08:00
Ivan ROGER
44075c9edf Fix explode query params for typescript-fetch (#22246)
Fixes: #10438
2025-10-29 16:28:00 +01:00
William Cheng
3d4f29eac7 [PYTHON-FASTAPI] update starlette to newer version 0.49.1 (#22243)
* update starlette to newer version 0.49.1

* update fastapi to newer version
2025-10-29 15:18:27 +08:00
William Cheng
351b601368 openapi-normalizer: Add REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT normalize option (#22236)
* fix bug 21680: Introduce REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT normalize option

* Advise to use REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT

* update doc

---------

Co-authored-by: Guillaume ALAMOME <guillaume.alamome@gmail.com>
2025-10-28 13:54:49 +08:00
Jason Frey
2c248e6c93 [ruby] Introduce ApiModelBase (#22052)
The Ruby code that is generated copies numerous methods into every
model. This creates bloat both in file size and run-time memory usage.
This commit introduces a base class for all models to store common
methods. This commit's focus is only on static methods that do not
change between models.
2025-10-28 12:42:51 +08:00
Eddie Sholl
68b0dfe6d1 Expose mtls certificate config params in python and php configuration templates (#22229)
* Expose mtls config params in python template

* Expose certFile and keyFile configuration items to support mtls in php generated client

* Regenerate of examples
2025-10-28 12:33:05 +08:00
Leon Linhart
31e462dc3e Make Gradle properties non-nullable (#22050)
They were never really intended to support null values, so this is kind of a bug. However, this is technically also breaking for users that set these properties to `null` explicitly (instead of leaving them unset).
2025-10-27 15:18:08 +08:00
Elliott Kember
74488fa3c3 Update modelOneOf.mustache (#22220)
Adds booleans to modelOneOf
2025-10-27 15:15:57 +08:00
William Cheng
8c54f18f7c remove BACKTICK_PLAN.md 2025-10-27 14:56:13 +08:00
Anshul Singhvi
57d12811ef [Julia] Fix docstring parameter formatting with backticks (#22190)
* [Julia] Fix docstring parameter formatting with backticks

Wrap parameter names in backticks in generated Julia client docstrings
to prevent markdown from misinterpreting underscores as italic formatting.

This fixes an issue where parameter names like `pet_id`, `api_key`, and
`additional_metadata` would render incorrectly in documentation, with
underscores being treated as markdown italic markers instead of literal
characters.

Related issue: JuliaComputing/OpenAPI.jl#72

* Also wrap data types and return types in backticks

* Regenerate Julia client samples with backticked docstrings

* [Julia] Add backticks to all markdown documentation templates

Extend backtick formatting to markdown documentation templates for
both Julia client and server generators. This ensures consistent
markdown rendering of identifiers with underscores.

Changes:
- julia-client/api_doc.mustache: Add backticks to function signatures,
  parameter names, types, and return types in markdown API docs
- julia-server/api_doc.mustache: Same changes for server API docs
- julia-client/model_doc.mustache: Add backticks to property names and
  types in markdown model documentation
- julia-server/model_doc.mustache: Same changes for server model docs

All generated markdown files now properly display identifiers like
`pet_id`, `Custom_Type`, `update_pet_with_form` with literal
underscores instead of broken italic formatting.

Related to JuliaComputing/OpenAPI.jl#72
2025-10-27 14:55:35 +08:00
lbilger
676efae183 [Java] Add import for java.util.Arrays if there is a set property in a model. Arrays.asList is used when initializing the property if it has a default value. (#22207) 2025-10-27 14:55:10 +08:00
Rens Groothuijsen
a4d05b38f5 [go] Correctly set default array value on query parameters (#22060) 2025-10-27 10:30:08 +08:00
Mattias Sehlstedt
75ae04ecfd Fix so that the x-field-extra-annotation properly split any array items (#22226)
* Fix so that the x-field-extra-annotation properly split any array items

* Add a unit test to show that the annotations are generated as expected
2025-10-27 09:56:38 +08:00
rignicat
808d106e0c [jaxrs] Support jackson option (true by default) (#22169)
* allow configuring jackson, remove jackson import if disabled

* do not generate root resource or application file if generating interface

* change template files to remove jackson if disabled

* updated samples and docs as required by PR checklist
2025-10-27 09:56:07 +08:00
William Cheng
9d810e0fbb update jackson databind nullable to v0.2.8 (#22230) 2025-10-27 00:35:51 +08:00
William Cheng
e8b699120f handle option parameter with ? in kotlin-spring 2025-10-18 17:01:29 +08:00
8250 changed files with 10578 additions and 27037 deletions

View File

@@ -15,7 +15,7 @@
<div align="center">
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.17.0`):
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`7.18.0`):
[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator)
[![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/master?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67)
@@ -148,8 +148,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
| OpenAPI Generator Version | Release Date | Notes |
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
| 7.17.0 (upcoming minor release) [SNAPSHOT](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) | 24.10.2025 | Minor release with breaking changes (with fallback) |
| [7.16.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.16.0) (latest stable release) | 28.09.2025 | Minor release with breaking changes (with fallback) |
| 7.18.0 (upcoming minor release) [SNAPSHOT](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) | 10.12.2025 | Minor release with breaking changes (with fallback) |
| [7.17.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.17.0) (latest stable release) | 29.10.2025 | Minor release with breaking changes (with fallback) |
| [6.6.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.6.0) | 11.05.2023 | Minor release with breaking changes (with fallback) |
| [5.4.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.4.0) | 31.01.2022 | Minor release with breaking changes (with fallback) |
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
@@ -212,16 +212,16 @@ See the different versions of the [openapi-generator-cli](https://search.maven.o
<!-- RELEASE_VERSION -->
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar`
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar`
For **Mac/Linux** users:
```sh
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar -O openapi-generator-cli.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar -O openapi-generator-cli.jar
```
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar
```
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
@@ -456,7 +456,7 @@ openapi-generator-cli version
To use a specific version of "openapi-generator-cli"
```sh
openapi-generator-cli version-manager set 7.16.0
openapi-generator-cli version-manager set 7.17.0
```
Or install it as dev-dependency:
@@ -480,7 +480,7 @@ pip install openapi-generator-cli
To install a specific version
```
pip install openapi-generator-cli==7.16.0
pip install openapi-generator-cli==7.17.0
```
You can also install with [jdk4py](https://github.com/activeviam/jdk4py) instead of java binary. (python>=3.10 is required)
@@ -506,7 +506,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)
<!-- RELEASE_VERSION -->
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar)
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar)
<!-- /RELEASE_VERSION -->
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`

View File

@@ -644,6 +644,13 @@ Example:
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/required-properties.yaml -o /tmp/java-okhttp/ --openapi-normalizer NORMALIZER_CLASS=org.openapitools.codegen.OpenAPINormalizerTest$RemoveRequiredNormalizer
```
- `REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT`: When set to true, remove the "properties" of a schema with type other than "object".
Example:
```
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/required-properties.yaml -o /tmp/java-okhttp/ --openapi-normalizer REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT=true
```
- `FILTER`
The `FILTER` parameter allows selective inclusion of API operations based on specific criteria. It applies the `x-internal: true` property to operations that do **not** match the specified values, preventing them from being generated. Multiple filters can be separated by a semicolon.

View File

@@ -22,7 +22,7 @@ npm install @openapitools/openapi-generator-cli -g
To install a specific version of the tool, pass the version during installation:
<!-- RELEASE_VERSION -->
```bash
openapi-generator-cli version-manager set 7.16.0
openapi-generator-cli version-manager set 7.17.0
```
<!-- /RELEASE_VERSION -->
To install the tool as a dev dependency in your current project:
@@ -119,18 +119,18 @@ docker run --rm \
<!-- RELEASE_VERSION -->
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 11 runtime at a minimum):
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar`
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar`
For **Mac/Linux** users:
```bash
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar -O openapi-generator-cli.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar -O openapi-generator-cli.jar
```
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
```powershell
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.16.0/openapi-generator-cli-7.16.0.jar
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.17.0/openapi-generator-cli-7.17.0.jar
```
<!-- /RELEASE_VERSION -->

View File

@@ -16,7 +16,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>7.16.0</version>
<version>7.17.0</version>
<executions>
<execution>
<goals>

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.17.0-SNAPSHOT</version>
<version>7.18.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -6,7 +6,7 @@
<artifactId>openapi-generator-project</artifactId>
<groupId>org.openapitools</groupId>
<!-- RELEASE_VERSION -->
<version>7.17.0-SNAPSHOT</version>
<version>7.18.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -97,7 +97,7 @@ task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.Valid
[source,group]
----
plugins {
id "org.openapi.generator" version "7.16.0"
id "org.openapi.generator" version "7.17.0"
}
----
@@ -113,7 +113,7 @@ buildscript {
// url "https://plugins.gradle.org/m2/"
}
dependencies {
classpath "org.openapitools:openapi-generator-gradle-plugin:7.16.0"
classpath "org.openapitools:openapi-generator-gradle-plugin:7.17.0"
}
}
@@ -759,7 +759,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath('org.openapitools:openapi-generator-gradle-plugin:7.16.0') {
classpath('org.openapitools:openapi-generator-gradle-plugin:7.17.0') {
exclude group: 'com.google.guava'
}
}

View File

@@ -1,5 +1,5 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.17.0-SNAPSHOT
openApiGeneratorVersion=7.18.0-SNAPSHOT
# /RELEASE_VERSION
# BEGIN placeholders

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.17.0-SNAPSHOT</version>
<version>7.18.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -19,5 +19,5 @@ gradle generateGoWithInvalidSpec # expected outcome: BUILD FAILED
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
```bash
gradle -PopenApiGeneratorVersion=7.16.0 openApiValidate
gradle -PopenApiGeneratorVersion=7.17.0 openApiValidate
```

View File

@@ -1,3 +1,3 @@
# RELEASE_VERSION
openApiGeneratorVersion=7.17.0-SNAPSHOT
openApiGeneratorVersion=7.18.0-SNAPSHOT
# /RELEASE_VERSION

View File

@@ -81,12 +81,12 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
/**
* The template directory holding a custom template.
*/
val templateDir = project.objects.property<String?>()
val templateDir = project.objects.property<String>()
/**
* The template location (which may be a directory or a classpath location) holding custom templates.
*/
val templateResourcePath = project.objects.property<String?>()
val templateResourcePath = project.objects.property<String>()
/**
* Adds authorization headers when fetching the OpenAPI definitions remotely.
@@ -109,7 +109,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
/**
* Specifies if the existing files should be overwritten during the generation.
*/
val skipOverwrite = project.objects.property<Boolean?>()
val skipOverwrite = project.objects.property<Boolean>()
/**
* Package for generated classes (where supported)
@@ -244,32 +244,32 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
/**
* Reference the library template (sub-template) of a generator.
*/
val library = project.objects.property<String?>()
val library = project.objects.property<String>()
/**
* Git host, e.g. gitlab.com.
*/
val gitHost = project.objects.property<String?>()
val gitHost = project.objects.property<String>()
/**
* Git user ID, e.g. openapitools.
*/
val gitUserId = project.objects.property<String?>()
val gitUserId = project.objects.property<String>()
/**
* Git repo ID, e.g. openapi-generator.
*/
val gitRepoId = project.objects.property<String?>()
val gitRepoId = project.objects.property<String>()
/**
* Release note, default to 'Minor update'.
*/
val releaseNote = project.objects.property<String?>()
val releaseNote = project.objects.property<String>()
/**
* HTTP user agent, e.g. codegen_csharp_api_client, default to 'OpenAPI-Generator/{packageVersion}/{language}'
*/
val httpUserAgent = project.objects.property<String?>()
val httpUserAgent = project.objects.property<String>()
/**
* Specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used.
@@ -279,17 +279,17 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
/**
* Specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.
*/
val ignoreFileOverride = project.objects.property<String?>()
val ignoreFileOverride = project.objects.property<String>()
/**
* Remove prefix of operationId, e.g. config_getId => getId
*/
val removeOperationIdPrefix = project.objects.property<Boolean?>()
val removeOperationIdPrefix = project.objects.property<Boolean>()
/**
* Skip examples defined in the operation
*/
val skipOperationExample = project.objects.property<Boolean?>()
val skipOperationExample = project.objects.property<Boolean>()
/**
* Defines which API-related files should be generated. This allows you to create a subset of generated files (or none at all).
@@ -394,7 +394,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
/**
* Templating engine: "mustache" (default) or "handlebars" (beta)
*/
val engine = project.objects.property<String?>()
val engine = project.objects.property<String>()
/**
* Defines whether the output dir should be cleaned up before generating the output.

View File

@@ -55,7 +55,6 @@ import org.openapitools.codegen.config.MergedSpecBuilder
*
* @author Jim Schubert
*/
@Suppress("UnstableApiUsage")
@CacheableTask
open class GenerateTask @Inject constructor(private val objectFactory: ObjectFactory) : DefaultTask() {
@@ -154,14 +153,14 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
@get:Optional
@get:InputDirectory
@get:PathSensitive(PathSensitivity.RELATIVE)
val templateDir = project.objects.property<String?>()
val templateDir = project.objects.property<String>()
/**
* Resource path containing template files.
*/
@get:Optional
@get:Input
val templateResourcePath = project.objects.property<String?>()
val templateResourcePath = project.objects.property<String>()
/**
* Adds authorization headers when fetching the OpenAPI definitions remotely.
@@ -193,7 +192,7 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
*/
@get:Optional
@get:Input
val skipOverwrite = project.objects.property<Boolean?>()
val skipOverwrite = project.objects.property<Boolean>()
/**
* Package for generated classes (where supported)
@@ -384,42 +383,42 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
*/
@get:Optional
@get:Input
val library = project.objects.property<String?>()
val library = project.objects.property<String>()
/**
* Git host, e.g. gitlab.com.
*/
@get:Optional
@get:Input
val gitHost = project.objects.property<String?>()
val gitHost = project.objects.property<String>()
/**
* Git user ID, e.g. openapitools.
*/
@get:Optional
@get:Input
val gitUserId = project.objects.property<String?>()
val gitUserId = project.objects.property<String>()
/**
* Git repo ID, e.g. openapi-generator.
*/
@get:Optional
@get:Input
val gitRepoId = project.objects.property<String?>()
val gitRepoId = project.objects.property<String>()
/**
* Release note, default to 'Minor update'.
*/
@get:Optional
@get:Input
val releaseNote = project.objects.property<String?>()
val releaseNote = project.objects.property<String>()
/**
* HTTP user agent, e.g. codegen_csharp_api_client, default to 'OpenAPI-Generator/{packageVersion}/{language}'
*/
@get:Optional
@get:Input
val httpUserAgent = project.objects.property<String?>()
val httpUserAgent = project.objects.property<String>()
/**
* Specifies how a reserved name should be escaped to.
@@ -434,21 +433,21 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
@get:Optional
@get:InputFile
@get:PathSensitive(PathSensitivity.RELATIVE)
val ignoreFileOverride = project.objects.property<String?>()
val ignoreFileOverride = project.objects.property<String>()
/**
* Remove prefix of operationId, e.g. config_getId => getId
*/
@get:Optional
@get:Input
val removeOperationIdPrefix = project.objects.property<Boolean?>()
val removeOperationIdPrefix = project.objects.property<Boolean>()
/**
* Remove examples defined in the operation
*/
@get:Optional
@get:Input
val skipOperationExample = project.objects.property<Boolean?>()
val skipOperationExample = project.objects.property<Boolean>()
/**
* Defines which API-related files should be generated. This allows you to create a subset of generated files (or none at all).
@@ -581,7 +580,7 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
*/
@get:Optional
@get:Input
val engine = project.objects.property<String?>()
val engine = project.objects.property<String>()
/**
* Defines whether the output dir should be cleaned up before generating the output.
@@ -598,19 +597,11 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
@get:Input
val dryRun = project.objects.property<Boolean>()
private fun <T : Any?> Property<T>.ifNotEmpty(block: Property<T>.(T) -> Unit) {
private fun <T> Property<T>.ifNotEmpty(block: Property<T>.(T) -> Unit) {
if (isPresent) {
val item: T? = get()
if (item != null) {
when (get()) {
is String -> if ((get() as String).isNotEmpty()) {
block(get())
}
is String? -> if (true == (get() as String?)?.isNotEmpty()) {
block(get())
}
else -> block(get())
}
when (val value = get()) {
is String -> if (value.isNotEmpty()) block(value)
else -> block(value)
}
}
}
@@ -725,7 +716,7 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
}
skipOverwrite.ifNotEmpty { value ->
configurator.setSkipOverwrite(value ?: false)
configurator.setSkipOverwrite(value)
}
generatorName.ifNotEmpty { value ->
@@ -820,11 +811,11 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
}
removeOperationIdPrefix.ifNotEmpty { value ->
configurator.setRemoveOperationIdPrefix(value!!)
configurator.setRemoveOperationIdPrefix(value)
}
skipOperationExample.ifNotEmpty { value ->
configurator.setSkipOperationExample(value!!)
configurator.setSkipOperationExample(value)
}
logToStderr.ifNotEmpty { value ->

View File

@@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.16.0</version>
<version>7.17.0</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.17.0-SNAPSHOT</version>
<version>7.18.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -15,7 +15,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.17.0-SNAPSHOT</version>
<version>7.18.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -19,7 +19,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.17.0-SNAPSHOT</version>
<version>7.18.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<dependencies>
<dependency>

View File

@@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.17.0-SNAPSHOT</version>
<version>7.18.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -13,7 +13,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.17.0-SNAPSHOT</version>
<version>7.18.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -20,7 +20,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<!-- RELEASE_VERSION -->
<version>7.17.0-SNAPSHOT</version>
<version>7.18.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<executions>
<execution>

View File

@@ -5,7 +5,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.17.0-SNAPSHOT</version>
<version>7.18.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.17.0-SNAPSHOT</version>
<version>7.18.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -4,7 +4,7 @@
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-project</artifactId>
<!-- RELEASE_VERSION -->
<version>7.17.0-SNAPSHOT</version>
<version>7.18.0-SNAPSHOT</version>
<!-- /RELEASE_VERSION -->
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@@ -356,7 +356,9 @@ public class InlineModelResolver {
} else if (schema.getProperties() != null) {
// If non-object type is specified but also properties
LOGGER.error("Illegal schema found with non-object type combined with properties," +
" no properties should be defined:\n " + schema.toString());
" no properties should be defined:" +
" consider using --openapi-normalizer REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT=true\n " +
schema.toString());
return;
} else if (schema.getAdditionalProperties() != null) {
// If non-object type is specified but also additionalProperties

View File

@@ -124,6 +124,9 @@ public class OpenAPINormalizer {
// the allOf contains a new schema containing the properties in the top level
final String REFACTOR_ALLOF_WITH_PROPERTIES_ONLY = "REFACTOR_ALLOF_WITH_PROPERTIES_ONLY";
// when set to true, remove the "properties" of a schema with type other than "object"
final String REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT = "REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT";
// when set to true, normalize OpenAPI 3.1 spec to make it work with the generator
final String NORMALIZE_31SPEC = "NORMALIZE_31SPEC";
@@ -206,6 +209,7 @@ public class OpenAPINormalizer {
ruleNames.add(SET_CONTAINER_TO_NULLABLE);
ruleNames.add(SET_PRIMITIVE_TYPES_TO_NULLABLE);
ruleNames.add(SIMPLIFY_ONEOF_ANYOF_ENUM);
ruleNames.add(REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT);
// rules that are default to true
rules.put(SIMPLIFY_ONEOF_ANYOF, true);
@@ -702,6 +706,8 @@ public class OpenAPINormalizer {
markSchemaAsVisited(schema, visitedSchemas);
processNormalizeOtherThanObjectWithProperties(schema);
if (ModelUtils.isArraySchema(schema)) { // array
Schema result = normalizeArraySchema(schema);
normalizeSchema(result.getItems(), visitedSchemas);
@@ -1961,6 +1967,23 @@ public class OpenAPINormalizer {
private boolean hasMethod(String method) {
return methodFilters.contains(method);
}
}
/**
* When set to true, remove "properties" attribute on schema other than "object"
* since it should be ignored and may result in odd generated code
*
* @param schema Schema
* @return Schema
*/
protected void processNormalizeOtherThanObjectWithProperties(Schema schema) {
if (getRule(REMOVE_PROPERTIES_FROM_TYPE_OTHER_THAN_OBJECT)) {
// Check object models / any type models / composed models for properties,
// if the schema has a type defined that is not "object" it should not define
// any properties
if (schema.getType() != null && !"object".equals(schema.getType())) {
schema.setProperties(null);
}
}
}
}

View File

@@ -1891,6 +1891,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
model.imports.add("Arrays");
} else if ("set".equals(property.containerType)) {
model.imports.add("LinkedHashSet");
model.imports.add("Arrays");
if ((!openApiNullable || !property.isNullable) && jackson) { // cannot be wrapped to nullable
model.imports.add("JsonDeserialize");
property.vendorExtensions.put("x-setter-extra-annotation", "@JsonDeserialize(as = LinkedHashSet.class)");

View File

@@ -119,6 +119,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen
convertPropertyToStringAndWriteBack(CodegenConstants.IMPL_FOLDER, this::setImplFolder);
convertPropertyToBooleanAndWriteBack(USE_BEANVALIDATION, this::setUseBeanValidation);
convertPropertyToBooleanAndWriteBack(USE_TAGS, this::setUseTags);
convertPropertyToBooleanAndWriteBack(JACKSON, this::setJackson);
}
@Override

View File

@@ -17,6 +17,7 @@
package org.openapitools.codegen.languages;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.google.common.collect.Iterables;
import com.samskivert.mustache.Mustache;
import io.swagger.v3.oas.models.media.Schema;
@@ -440,6 +441,17 @@ public class GoClientCodegen extends AbstractGoCodegen {
return null;
}
if (ModelUtils.isArraySchema(p)) {
StringJoiner joinedDefaultValues = new StringJoiner(", ");
Object defaultValues = p.getDefault();
if (defaultValues instanceof ArrayNode) {
for (var value : (ArrayNode) defaultValues) {
joinedDefaultValues.add(value.toString());
}
return "{" + joinedDefaultValues + "}";
}
}
return super.toDefaultValue(p);
}

View File

@@ -187,19 +187,22 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
supportingFiles.clear(); // Don't need extra files provided by AbstractJAX-RS & Java Codegen
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")
.doNotOverwrite());
supportingFiles.add(new SupportingFile("RestResourceRoot.mustache",
(sourceFolder + '/' + invokerPackage).replace(".", "/"), "RestResourceRoot.java")
.doNotOverwrite());
if (!interfaceOnly) {
supportingFiles.add(new SupportingFile("RestResourceRoot.mustache",
(sourceFolder + '/' + invokerPackage).replace(".", "/"), "RestResourceRoot.java")
.doNotOverwrite());
supportingFiles.add(new SupportingFile("RestApplication.mustache",
(sourceFolder + '/' + invokerPackage).replace(".", "/"), "RestApplication.java")
.doNotOverwrite());
}
if (generatePom) {
supportingFiles.add(new SupportingFile("pom.mustache", "", "pom.xml")
.doNotOverwrite());
}
supportingFiles.add(new SupportingFile("RestApplication.mustache",
(sourceFolder + '/' + invokerPackage).replace(".", "/"), "RestApplication.java")
.doNotOverwrite());
if (StringUtils.isNotEmpty(openApiSpecFileLocation)) {
int index = openApiSpecFileLocation.lastIndexOf('/');
String fileFolder;
@@ -276,6 +279,7 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
if (!jackson) {
codegenModel.imports.remove("JsonValue");
codegenModel.imports.remove("JsonProperty");
codegenModel.imports.remove("JsonTypeName");
}
return codegenModel;
}

View File

@@ -271,6 +271,7 @@ public class RubyClientCodegen extends AbstractRubyCodegen {
supportingFiles.add(new SupportingFile("gem.mustache", libFolder, gemName + ".rb"));
String gemFolder = libFolder + File.separator + gemName;
supportingFiles.add(new SupportingFile("api_error.mustache", gemFolder, "api_error.rb"));
supportingFiles.add(new SupportingFile("api_model_base.mustache", gemFolder, "api_model_base.rb"));
supportingFiles.add(new SupportingFile("version.mustache", gemFolder, "version.rb"));
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));

View File

@@ -117,7 +117,7 @@ ext {
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
{{#useBeanValidation}}

View File

@@ -117,7 +117,7 @@ ext {
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
httpclient_version = "5.1.3"

View File

@@ -354,7 +354,7 @@
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>

View File

@@ -107,7 +107,7 @@ ext {
jackson_databind_version = "2.19.2"
{{/jackson}}
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
feign_version = "13.5"

View File

@@ -63,7 +63,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
{{/gson}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}

View File

@@ -416,7 +416,7 @@
<gson-version>2.10.1</gson-version>
{{/gson}}
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>

View File

@@ -101,7 +101,7 @@ ext {
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
google_api_client_version = "1.32.2"

View File

@@ -313,7 +313,7 @@
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#joda}}
<jodatime-version>2.9.9</jodatime-version>

View File

@@ -107,7 +107,7 @@ ext {
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
{{#useBeanValidation}}

View File

@@ -24,7 +24,7 @@ lazy val root = (project in file(".")).
{{/joda}}
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.19.2" % "compile",
{{#openApiNullable}}
"org.openapitools" % "jackson-databind-nullable" % "0.2.7" % "compile",
"org.openapitools" % "jackson-databind-nullable" % "0.2.8" % "compile",
{{/openApiNullable}}
{{#hasOAuthMethods}}
"com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",

View File

@@ -63,7 +63,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
{{/gson}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}

View File

@@ -407,7 +407,7 @@
<jersey-version>2.37</jersey-version>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>

View File

@@ -102,7 +102,7 @@ ext {
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
jakarta_annotation_version = "2.1.0"
{{#useBeanValidation}}

View File

@@ -24,7 +24,7 @@ lazy val root = (project in file(".")).
{{/joda}}
"com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.19.2" % "compile",
{{#openApiNullable}}
"org.openapitools" % "jackson-databind-nullable" % "0.2.7" % "compile",
"org.openapitools" % "jackson-databind-nullable" % "0.2.8" % "compile",
{{/openApiNullable}}
{{#hasOAuthMethods}}
"com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",

View File

@@ -63,7 +63,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
{{/gson}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}

View File

@@ -407,7 +407,7 @@
<jersey-version>3.1.1</jersey-version>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>

View File

@@ -49,7 +49,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
{{#jsonb}}{{^isDiscriminator}}@JsonbProperty("{{baseName}}"){{/isDiscriminator}}{{#isDiscriminator}}{{#jsonbPolymorphism}}@JsonbTransient{{/jsonbPolymorphism}}{{^jsonbPolymorphism}}@JsonbProperty("{{baseName}}"){{/jsonbPolymorphism}}{{/isDiscriminator}}{{/jsonb}}
{{/withXml}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};

View File

@@ -102,7 +102,7 @@ dependencies {
implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
implementation "org.openapitools:jackson-databind-nullable:0.2.7"
implementation "org.openapitools:jackson-databind-nullable:0.2.8"
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
{{#useBeanValidation}}
implementation "jakarta.validation:jakarta.validation-api:$beanvalidation_version"

View File

@@ -66,7 +66,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
{{/gson}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}

View File

@@ -300,7 +300,7 @@
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<jackson-version>2.19.2</jackson-version>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>

View File

@@ -132,7 +132,7 @@ dependencies {
implementation 'io.gsonfire:gson-fire:1.9.0'
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
{{#openApiNullable}}
implementation 'org.openapitools:jackson-databind-nullable:0.2.7'
implementation 'org.openapitools:jackson-databind-nullable:0.2.8'
{{/openApiNullable}}
{{#withAWSV4Signature}}
implementation 'software.amazon.awssdk:auth:2.20.157'

View File

@@ -16,7 +16,7 @@ lazy val root = (project in file(".")).
"org.apache.commons" % "commons-lang3" % "3.18.0",
"jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6",
{{#openApiNullable}}
"org.openapitools" % "jackson-databind-nullable" % "0.2.7",
"org.openapitools" % "jackson-databind-nullable" % "0.2.8",
{{/openApiNullable}}
{{#withAWSV4Signature}}
"software.amazon.awssdk" % "auth" % "2.20.157",

View File

@@ -71,7 +71,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/deprecated}}
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{>nullable_var_annotations}}{{! prevent indent}}
{{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};

View File

@@ -416,7 +416,7 @@
<gson-version>2.10.1</gson-version>
<commons-lang3-version>3.18.0</commons-lang3-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#joda}}
<jodatime-version>2.12.0</jodatime-version>

View File

@@ -109,7 +109,7 @@ ext {
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
{{/jackson}}
{{#gson}}

View File

@@ -18,7 +18,7 @@ lazy val root = (project in file(".")).
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.19.2",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.19.2",
{{#openApiNullable}}
"org.openapitools" % "jackson-databind-nullable" % "0.2.7",
"org.openapitools" % "jackson-databind-nullable" % "0.2.8",
{{/openApiNullable}}
{{#withXml}}
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.13.4.1",

View File

@@ -354,7 +354,7 @@
{{#jackson}}
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{/jackson}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>

View File

@@ -106,7 +106,7 @@ ext {
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
spring_web_version = "6.1.21"
jakarta_annotation_version = "2.1.1"

View File

@@ -74,7 +74,7 @@ public {{>sealed}}class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#v
// The discriminator does not have Nullability-annotation since it is added during serialization by the @JsonTypeName annotation
{{/isDiscriminator}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}

View File

@@ -350,7 +350,7 @@
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{/openApiNullable}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
{{#joda}}

View File

@@ -101,7 +101,7 @@ ext {
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
threetenbp_version = "2.9.10"

View File

@@ -301,7 +301,7 @@
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>

View File

@@ -118,7 +118,7 @@ ext {
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
{{#useJakartaEe}}
spring_web_version = "6.2.8"

View File

@@ -74,7 +74,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
// The discriminator does not have Nullability-annotation since it is added during serialization by the @JsonTypeName annotation
{{/isDiscriminator}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}

View File

@@ -364,7 +364,7 @@
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#useJakartaEe}}
<spring-web-version>6.2.8</spring-web-version>

View File

@@ -104,7 +104,7 @@ ext {
jackson_databind_version = "2.19.2"
javax_ws_rs_api_version = "2.1.1"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
{{/jackson}}
{{#usePlayWS}}

View File

@@ -386,7 +386,7 @@
<jackson-databind-version>2.19.2</jackson-databind-version>
<jackson-version>2.19.2</jackson-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{/openApiNullable}}
<javax.ws.rs-api-version>2.1.1</javax.ws.rs-api-version>
{{/jackson}}

View File

@@ -35,7 +35,7 @@ ext {
vertx_version = "{{#supportVertxFuture}}4.0.0{{/supportVertxFuture}}{{^supportVertxFuture}}3.5.2{{/supportVertxFuture}}"
junit_version = "5.10.3"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
jakarta_annotation_version = "1.3.5"
}

View File

@@ -308,7 +308,7 @@
{{/swagger2AnnotationLibrary}}
<jackson-version>2.19.2</jackson-version>
<jackson-databind>2.19.2</jackson-databind>
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
{{/useJakartaEe}}

View File

@@ -147,7 +147,7 @@ ext {
jackson_version = "2.19.2"
jackson_databind_version = "2.19.2"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.7"
jackson_databind_nullable_version = "0.2.8"
{{/openApiNullable}}
{{#joda}}
jodatime_version = "2.9.9"

View File

@@ -74,7 +74,7 @@ public {{>sealed}}class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#v
// The discriminator does not have Nullability-annotation since it is added during serialization by the @JsonTypeName annotation
{{/isDiscriminator}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}

View File

@@ -170,7 +170,7 @@
<jackson-version>2.19.2</jackson-version>
<jackson-databind-version>2.19.2</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{/openApiNullable}}
{{#useJakartaEe}}
<spring-boot-version>3.2.12</spring-boot-version>

View File

@@ -74,7 +74,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
// The discriminator does not have Nullability-annotation since it is added during serialization by the @JsonTypeName annotation
{{/isDiscriminator}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}

View File

@@ -16,7 +16,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/vars}}

View File

@@ -49,7 +49,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'hh:mm:ss.SSSX")
{{/isDateTime}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/vars}}

View File

@@ -56,7 +56,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
@Valid
{{/useBeanValidation}}{{/isFile}}{{/isString}}{{/isDateTime}}{{/isDate}}{{/isPrimitiveType}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}

View File

@@ -36,7 +36,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
{{/gson}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};

View File

@@ -36,7 +36,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
{{/gson}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};

View File

@@ -14,7 +14,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/vars}}

View File

@@ -14,7 +14,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/vars}}

View File

@@ -23,7 +23,10 @@ import {{javaxPackage}}.validation.Valid;{{/useBeanValidation}}
/**
* Represents a collection of functions to interact with the API endpoints.
*/
@Path("{{commonPath}}"){{#useSwaggerAnnotations}}
{{^interfaceOnly}}
@Path("{{commonPath}}")
{{/interfaceOnly}}
{{#useSwaggerAnnotations}}
@Api(description = "the {{{baseName}}} API"){{/useSwaggerAnnotations}}{{#hasConsumes}}
@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}}
@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}}

View File

@@ -8,8 +8,8 @@
* @return {{{message}}}
{{/responses}}
*/
@{{httpMethod}}{{#subresourceOperation}}
@Path("{{{path}}}"){{/subresourceOperation}}{{#hasConsumes}}
@{{httpMethod}}
@Path("{{commonPath}}{{{path}}}"){{#hasConsumes}}
@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}}
@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}}{{#useSwaggerAnnotations}}
@ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}"{{#hasAuthMethods}}, authorizations = {

View File

@@ -20,7 +20,9 @@
}
@Override
{{#jackson}}
@JsonValue
{{/jackson}}
public String toString() {
return String.valueOf(value);
}
@@ -40,6 +42,7 @@
{{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected string value '" + s + "'");{{/isNullable}}
}
{{#jackson}}
@JsonCreator
public static {{datatypeWithEnum}} fromValue({{dataType}} value) {
for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
@@ -49,4 +52,5 @@
}
{{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}}
}
{{/jackson}}
}

View File

@@ -41,11 +41,14 @@ import com.fasterxml.jackson.annotation.JsonValue;
}
@Override
{{#jackson}}
@JsonValue
{{/jackson}}
public String toString() {
return String.valueOf(value);
}
{{#jackson}}
@JsonCreator
public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) {
for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
@@ -55,4 +58,5 @@ import com.fasterxml.jackson.annotation.JsonValue;
}
{{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}}
}
{{/jackson}}
}

View File

@@ -2,11 +2,12 @@
import io.swagger.annotations.*;
{{/useSwaggerAnnotations}}
import java.util.Objects;
{{#jackson}}
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.annotation.JsonTypeName;
{{/jackson}}
{{#withXml}}
import {{javaxPackage}}.xml.bind.annotation.XmlElement;
import {{javaxPackage}}.xml.bind.annotation.XmlRootElement;
@@ -22,7 +23,7 @@ import {{javaxPackage}}.xml.bind.annotation.XmlEnumValue;
**/{{/description}}
{{#useSwaggerAnnotations}}{{#description}}@ApiModel(description = "{{{.}}}"){{/description}}{{/useSwaggerAnnotations}}{{#useMicroProfileOpenAPIAnnotations}}
@org.eclipse.microprofile.openapi.annotations.media.Schema({{#title}}title="{{{.}}}", {{/title}}{{#description}}description="{{{.}}}"{{/description}}{{^description}}description=""{{/description}}){{/useMicroProfileOpenAPIAnnotations}}
@JsonTypeName("{{name}}")
{{#jackson}}@JsonTypeName("{{name}}"){{/jackson}}
{{>generatedAnnotation}}{{>additionalModelTypeAnnotations}}{{>xmlPojoAnnotation}}
{{#vendorExtensions.x-class-extra-annotation}}
{{{vendorExtensions.x-class-extra-annotation}}}
@@ -40,7 +41,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{/isContainer}}
{{/isEnum}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
private {{#isContainer}}{{#useBeanValidation}}@Valid {{/useBeanValidation}}{{/isContainer}}{{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/vars}}
@@ -61,6 +62,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
public {{classname}}() {
}
{{#jackson}}
{{#generateJsonCreator}}
{{#hasRequired}}
@JsonCreator
@@ -85,6 +87,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{/hasRequired}}
{{/generateJsonCreator}}
{{/jackson}}
{{#vars}}
/**
{{#description}}
@@ -108,12 +111,14 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
{{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}}{{#useSwaggerAnnotations}}
@ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{/useSwaggerAnnotations}}{{#useMicroProfileOpenAPIAnnotations}}
@org.eclipse.microprofile.openapi.annotations.media.Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}description = "{{{description}}}"){{/useMicroProfileOpenAPIAnnotations}}
@JsonProperty({{#required}}required = {{required}}, value = {{/required}}"{{baseName}}")
{{#jackson}}@JsonProperty({{#required}}required = {{required}}, value = {{/required}}"{{baseName}}"){{/jackson}}
{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}}public {{>beanValidatedType}} {{getter}}() {
return {{name}};
}
{{#jackson}}
@JsonProperty({{#required}}required = {{required}}, value = {{/required}}"{{baseName}}")
{{/jackson}}
{{#vendorExtensions.x-setter-extra-annotation}}{{{vendorExtensions.x-setter-extra-annotation}}}
{{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
this.{{name}} = {{name}};

View File

@@ -200,7 +200,7 @@
<jakarta.ws.rs-version>2.1.6</jakarta.ws.rs-version>
{{/useJakartaEe}}
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
{{/openApiNullable}}
</properties>
</project>

View File

@@ -32,7 +32,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
@SerializedName("{{baseName}}")
{{/gson}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#isContainer}}
{{#useBeanValidation}}

View File

@@ -1 +1 @@
{{#isHeaderParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{vendorExtensions.x-field-extra-annotation}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isHeaderParam}}
{{#isHeaderParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isHeaderParam}}

View File

@@ -208,7 +208,7 @@
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.7</version>
<version>0.2.8</version>
</dependency>
{{/openApiNullable}}
{{#useBeanValidation}}

View File

@@ -223,7 +223,7 @@
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.7</version>
<version>0.2.8</version>
</dependency>
{{/openApiNullable}}
{{#useBeanValidation}}

View File

@@ -139,7 +139,7 @@
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
{{^parentOverridden}}
<version>0.2.7</version>
<version>0.2.8</version>
{{/parentOverridden}}
</dependency>
{{/openApiNullable}}

View File

@@ -155,7 +155,7 @@
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
{{^parentOverridden}}
<version>0.2.7</version>
<version>0.2.8</version>
{{/parentOverridden}}
</dependency>
{{/openApiNullable}}

View File

@@ -86,7 +86,7 @@
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.7</version>
<version>0.2.8</version>
</dependency>
{{/openApiNullable}}
{{#lombok}}

View File

@@ -1 +1 @@
{{#isPathParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{vendorExtensions.x-field-extra-annotation}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>optionalDataType}} {{paramName}}{{/isPathParam}}
{{#isPathParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>optionalDataType}} {{paramName}}{{/isPathParam}}

View File

@@ -70,7 +70,7 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}
{{/isPassword}}
{{/lombok.ToString}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#lombok.Builder}}
{{#defaultValue}}

View File

@@ -1 +1 @@
{{#isQueryParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{vendorExtensions.x-field-extra-annotation}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/isModel}}{{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isQueryParam}}
{{#isQueryParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/isModel}}{{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isQueryParam}}

View File

@@ -217,8 +217,16 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class
parameterAddToHeaderOrQuery(localVarQueryParams, "{{{baseName}}}", r.{{paramName}}, "{{style}}", "{{collectionFormat}}")
{{/isCollectionFormatMulti}}
{{#defaultValue}}} else {
var defaultValue {{{dataType}}} = {{{.}}}
r.{{paramName}} = &defaultValue
{{#isArray}}
var defaultValue {{{dataType}}} = {{{dataType}}}{{{.}}}
parameterAddToHeaderOrQuery(localVarQueryParams, "{{{baseName}}}", defaultValue, "{{style}}", "{{collectionFormat}}")
r.{{paramName}} = &defaultValue
{{/isArray}}
{{^isArray}}
var defaultValue {{{dataType}}} = {{{.}}}
parameterAddToHeaderOrQuery(localVarQueryParams, "{{{baseName}}}", defaultValue, "{{style}}", "{{collectionFormat}}")
r.{{paramName}} = &defaultValue
{{/isArray}}
{{/defaultValue}}}
{{/required}}
{{/queryParams}}

View File

@@ -70,7 +70,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{/isPassword}}
{{/lombok.ToString}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#deprecated}}
@Deprecated

View File

@@ -116,7 +116,7 @@ Do not edit the class manually.
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>jackson-databind-nullable</artifactId>
<version>0.2.7</version>
<version>0.2.8</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>

View File

@@ -35,7 +35,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
**/
{{/description}}
{{#vendorExtensions.x-field-extra-annotation}}
{{{vendorExtensions.x-field-extra-annotation}}}
{{{.}}}
{{/vendorExtensions.x-field-extra-annotation}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};

Some files were not shown because too many files have changed in this diff Show More