mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-06 07:26:12 +00:00
Compare commits
1 Commits
JoseLora-b
...
autofix-sc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6f94c5d8b |
4
.github/workflows/linux.yaml
vendored
4
.github/workflows/linux.yaml
vendored
@@ -62,7 +62,7 @@ jobs:
|
||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
|
||||
|
||||
- name: Upload Maven build artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v4
|
||||
if: matrix.java == '11' && matrix.os == 'ubuntu-latest'
|
||||
with:
|
||||
name: artifact
|
||||
@@ -98,7 +98,7 @@ jobs:
|
||||
maven-version: 3.8.8
|
||||
cache: gradle
|
||||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v6
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: artifact
|
||||
- name: Run Ensures Script
|
||||
|
||||
8
.github/workflows/openapi-generator.yaml
vendored
8
.github/workflows/openapi-generator.yaml
vendored
@@ -42,7 +42,7 @@ jobs:
|
||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
|
||||
- run: ls -la modules/openapi-generator-cli/target
|
||||
- name: Upload openapi-generator-cli.jar artifact
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: openapi-generator-cli.jar
|
||||
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar
|
||||
@@ -81,7 +81,7 @@ jobs:
|
||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
|
||||
- name: Publish unit test reports
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v5
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: surefire-test-results
|
||||
path: '**/surefire-reports/TEST-*.xml'
|
||||
@@ -99,7 +99,7 @@ jobs:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
- name: Download openapi-generator-cli.jar artifact
|
||||
uses: actions/download-artifact@v6
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: openapi-generator-cli.jar
|
||||
path: modules/openapi-generator-cli/target
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
java-version: 11
|
||||
distribution: 'temurin'
|
||||
- name: Download openapi-generator-cli.jar artifact
|
||||
uses: actions/download-artifact@v6
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: openapi-generator-cli.jar
|
||||
path: modules/openapi-generator-cli/target
|
||||
|
||||
@@ -59,6 +59,6 @@
|
||||
sha256: 45cdaba3d2adc212cd4f0184ad475419a95e2326254c2ef84175e210c922b2f3
|
||||
# rust axum test files
|
||||
- filename: "samples/server/petstore/rust-axum/output/rust-axum-oneof/tests/oneof_with_discriminator.rs"
|
||||
sha256: b2093528aac971193f2863a70f46eea45cf8bda79120b133a614599e80d8b46d
|
||||
sha256: 2d4f5a069fdcb3057bb078d5e75b3de63cd477b97725e457079df24bd2c30600
|
||||
- filename: "samples/server/petstore/rust-axum/output/openapi-v3/tests/oneof_untagged.rs"
|
||||
sha256: 1d3fb01f65e98290b1d3eece28014c7d3e3f2fdf18e7110249d3c591cc4642ab
|
||||
|
||||
@@ -644,13 +644,6 @@ 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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -55,6 +55,7 @@ import org.openapitools.codegen.config.MergedSpecBuilder
|
||||
*
|
||||
* @author Jim Schubert
|
||||
*/
|
||||
@Suppress("UnstableApiUsage")
|
||||
@CacheableTask
|
||||
open class GenerateTask @Inject constructor(private val objectFactory: ObjectFactory) : DefaultTask() {
|
||||
|
||||
@@ -153,14 +154,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.
|
||||
@@ -192,7 +193,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)
|
||||
@@ -383,42 +384,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.
|
||||
@@ -433,21 +434,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).
|
||||
@@ -580,7 +581,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.
|
||||
@@ -597,11 +598,19 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
@get:Input
|
||||
val dryRun = project.objects.property<Boolean>()
|
||||
|
||||
private fun <T> Property<T>.ifNotEmpty(block: Property<T>.(T) -> Unit) {
|
||||
private fun <T : Any?> Property<T>.ifNotEmpty(block: Property<T>.(T) -> Unit) {
|
||||
if (isPresent) {
|
||||
when (val value = get()) {
|
||||
is String -> if (value.isNotEmpty()) block(value)
|
||||
else -> block(value)
|
||||
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())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -716,7 +725,7 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
|
||||
}
|
||||
|
||||
skipOverwrite.ifNotEmpty { value ->
|
||||
configurator.setSkipOverwrite(value)
|
||||
configurator.setSkipOverwrite(value ?: false)
|
||||
}
|
||||
|
||||
generatorName.ifNotEmpty { value ->
|
||||
@@ -811,11 +820,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 ->
|
||||
|
||||
@@ -353,20 +353,22 @@ 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:" +
|
||||
" 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
|
||||
LOGGER.error("Illegal schema found with non-object type combined with" +
|
||||
" additionalProperties, no additionalProperties should be defined:\n " +
|
||||
schema.toString());
|
||||
return;
|
||||
} else {
|
||||
if (schema.getProperties() != null) {
|
||||
// If non-object type is specified but also properties
|
||||
LOGGER.warn("Illegal schema found with non-object type ({}) combined with properties. Properties automatically removed.", schema.getType());
|
||||
schema.setProperties(null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (schema.getAdditionalProperties() != null) {
|
||||
// If non-object type is specified but also additionalProperties
|
||||
LOGGER.error("Illegal schema found with non-object type ({}) combined with additionalProperties. AdditionalProperties automatically removed.", schema.getType());
|
||||
schema.setAdditionalProperties(null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check array items
|
||||
if (ModelUtils.isArraySchema(schema)) {
|
||||
Schema items = ModelUtils.getSchemaItems(schema);
|
||||
|
||||
@@ -124,9 +124,6 @@ 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";
|
||||
|
||||
@@ -209,7 +206,6 @@ 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);
|
||||
@@ -706,8 +702,6 @@ public class OpenAPINormalizer {
|
||||
|
||||
markSchemaAsVisited(schema, visitedSchemas);
|
||||
|
||||
processNormalizeOtherThanObjectWithProperties(schema);
|
||||
|
||||
if (ModelUtils.isArraySchema(schema)) { // array
|
||||
Schema result = normalizeArraySchema(schema);
|
||||
normalizeSchema(result.getItems(), visitedSchemas);
|
||||
@@ -1967,23 +1961,6 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1891,7 +1891,6 @@ 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)");
|
||||
|
||||
@@ -119,7 +119,6 @@ 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
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
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;
|
||||
@@ -441,17 +440,6 @@ 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -187,22 +187,19 @@ 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());
|
||||
|
||||
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());
|
||||
}
|
||||
supportingFiles.add(new SupportingFile("RestResourceRoot.mustache",
|
||||
(sourceFolder + '/' + invokerPackage).replace(".", "/"), "RestResourceRoot.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;
|
||||
@@ -279,7 +276,6 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
|
||||
if (!jackson) {
|
||||
codegenModel.imports.remove("JsonValue");
|
||||
codegenModel.imports.remove("JsonProperty");
|
||||
codegenModel.imports.remove("JsonTypeName");
|
||||
}
|
||||
return codegenModel;
|
||||
}
|
||||
|
||||
@@ -271,7 +271,6 @@ 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"));
|
||||
|
||||
@@ -648,7 +648,7 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
}
|
||||
|
||||
private void postProcessPolymorphism(final List<ModelMap> allModels) {
|
||||
final HashMap<String, List<CodegenDiscriminator>> discriminatorsForModel = new HashMap<>();
|
||||
final HashMap<String, List<String>> discriminatorsForModel = new HashMap<>();
|
||||
|
||||
for (final ModelMap mo : allModels) {
|
||||
final CodegenModel cm = mo.getModel();
|
||||
@@ -656,17 +656,15 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
final CodegenComposedSchemas cs = cm.getComposedSchemas();
|
||||
if (cs != null) {
|
||||
final List<CodegenProperty> csOneOf = cs.getOneOf();
|
||||
CodegenDiscriminator discriminator = cm.getDiscriminator();
|
||||
|
||||
if (csOneOf != null) {
|
||||
processPolymorphismDataType(csOneOf, discriminator);
|
||||
processPolymorphismDataType(csOneOf);
|
||||
cs.setOneOf(csOneOf);
|
||||
cm.setComposedSchemas(cs);
|
||||
}
|
||||
|
||||
final List<CodegenProperty> csAnyOf = cs.getAnyOf();
|
||||
if (csAnyOf != null) {
|
||||
processPolymorphismDataType(csAnyOf, discriminator);
|
||||
processPolymorphismDataType(csAnyOf);
|
||||
cs.setAnyOf(csAnyOf);
|
||||
cm.setComposedSchemas(cs);
|
||||
}
|
||||
@@ -674,14 +672,14 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
|
||||
if (cm.discriminator != null) {
|
||||
for (final String model : cm.oneOf) {
|
||||
final List<CodegenDiscriminator> discriminators = discriminatorsForModel.getOrDefault(model, new ArrayList<>());
|
||||
discriminators.add(cm.discriminator);
|
||||
final List<String> discriminators = discriminatorsForModel.getOrDefault(model, new ArrayList<>());
|
||||
discriminators.add(cm.discriminator.getPropertyName());
|
||||
discriminatorsForModel.put(model, discriminators);
|
||||
}
|
||||
|
||||
for (final String model : cm.anyOf) {
|
||||
final List<CodegenDiscriminator> discriminators = discriminatorsForModel.getOrDefault(model, new ArrayList<>());
|
||||
discriminators.add(cm.discriminator);
|
||||
final List<String> discriminators = discriminatorsForModel.getOrDefault(model, new ArrayList<>());
|
||||
discriminators.add(cm.discriminator.getPropertyName());
|
||||
discriminatorsForModel.put(model, discriminators);
|
||||
}
|
||||
}
|
||||
@@ -691,11 +689,11 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
for (ModelMap mo : allModels) {
|
||||
final CodegenModel cm = mo.getModel();
|
||||
|
||||
final List<CodegenDiscriminator> discriminators = discriminatorsForModel.get(cm.getSchemaName());
|
||||
final List<String> discriminators = discriminatorsForModel.get(cm.getSchemaName());
|
||||
if (discriminators != null) {
|
||||
// If the discriminator field is not a defined attribute in the variant structure, create it.
|
||||
if (!discriminating(discriminators, cm)) {
|
||||
final CodegenDiscriminator discriminator = discriminators.get(0);
|
||||
final String discriminator = discriminators.get(0);
|
||||
|
||||
CodegenProperty property = new CodegenProperty();
|
||||
|
||||
@@ -712,18 +710,17 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
property.isDiscriminator = true;
|
||||
|
||||
// Attributes based on the discriminator value
|
||||
property.baseName = discriminator.getPropertyBaseName();
|
||||
property.name = discriminator.getPropertyName();
|
||||
property.nameInCamelCase = camelize(discriminator.getPropertyName());
|
||||
property.baseName = discriminator;
|
||||
property.name = discriminator;
|
||||
property.nameInCamelCase = camelize(discriminator);
|
||||
property.nameInPascalCase = property.nameInCamelCase.substring(0, 1).toUpperCase(Locale.ROOT) + property.nameInCamelCase.substring(1);
|
||||
property.nameInSnakeCase = underscore(discriminator.getPropertyName()).toUpperCase(Locale.ROOT);
|
||||
property.nameInSnakeCase = underscore(discriminator).toUpperCase(Locale.ROOT);
|
||||
property.getter = String.format(Locale.ROOT, "get%s", property.nameInPascalCase);
|
||||
property.setter = String.format(Locale.ROOT, "set%s", property.nameInPascalCase);
|
||||
property.defaultValueWithParam = String.format(Locale.ROOT, " = data.%s;", property.name);
|
||||
|
||||
// Attributes based on the model name
|
||||
property.defaultValue = String.format(Locale.ROOT, "r#\"%s\"#.to_string()", cm.getSchemaName());
|
||||
property.discriminatorValue = getDiscriminatorValue(cm.getClassname(), discriminator);
|
||||
property.jsonSchema = String.format(Locale.ROOT, "{ \"default\":\"%s\"; \"type\":\"string\" }", cm.getSchemaName());
|
||||
|
||||
cm.vars.add(property);
|
||||
@@ -746,27 +743,14 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
}
|
||||
}
|
||||
|
||||
private static String getDiscriminatorValue(String modelName, CodegenDiscriminator discriminator) {
|
||||
if (discriminator == null || discriminator.getMappedModels() == null) {
|
||||
return modelName;
|
||||
}
|
||||
return discriminator
|
||||
.getMappedModels()
|
||||
.stream()
|
||||
.filter(m -> m.getModelName().equals(modelName) && m.getMappingName() != null)
|
||||
.map(CodegenDiscriminator.MappedModel::getMappingName)
|
||||
.findFirst()
|
||||
.orElse(modelName);
|
||||
}
|
||||
|
||||
private static boolean discriminating(final List<CodegenDiscriminator> discriminatorsForModel, final CodegenModel cm) {
|
||||
private static boolean discriminating(final List<String> discriminatorsForModel, final CodegenModel cm) {
|
||||
resetDiscriminatorProperty(cm);
|
||||
|
||||
// Discriminator will be presented as enum tag -> One and only one tag is allowed
|
||||
int countString = 0;
|
||||
int countNonString = 0;
|
||||
for (final CodegenProperty var : cm.vars) {
|
||||
if (discriminatorsForModel.stream().anyMatch(discriminator -> var.baseName.equals(discriminator.getPropertyBaseName()) || var.name.equals(discriminator.getPropertyName()))) {
|
||||
if (discriminatorsForModel.stream().anyMatch(discriminator -> var.baseName.equals(discriminator) || var.name.equals(discriminator))) {
|
||||
if (var.isString) {
|
||||
var.isDiscriminator = true;
|
||||
++countString;
|
||||
@@ -789,7 +773,7 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
}
|
||||
}
|
||||
|
||||
private static void processPolymorphismDataType(final List<CodegenProperty> cp, CodegenDiscriminator discriminator) {
|
||||
private static void processPolymorphismDataType(final List<CodegenProperty> cp) {
|
||||
final HashSet<String> dedupDataTypeWithEnum = new HashSet<>();
|
||||
final HashMap<String, Integer> dedupDataType = new HashMap<>();
|
||||
|
||||
@@ -799,7 +783,6 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
|
||||
// Mainly needed for primitive types.
|
||||
model.datatypeWithEnum = camelize(model.dataType.replaceAll("(?:\\w+::)+(\\w+)", "$1")
|
||||
.replace("<", "Of").replace(">", "")).replace(" ", "").replace(",", "");
|
||||
model.discriminatorValue = getDiscriminatorValue(model.datatypeWithEnum, discriminator);
|
||||
if (!dedupDataTypeWithEnum.add(model.datatypeWithEnum)) {
|
||||
model.datatypeWithEnum += ++idx;
|
||||
}
|
||||
|
||||
@@ -461,9 +461,6 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
||||
}
|
||||
}
|
||||
|
||||
// backup path in extensions
|
||||
op.vendorExtensions.put("x-path-from-spec", op.path);
|
||||
|
||||
// Overwrite path to TypeScript template string, after applying everything we just did.
|
||||
op.path = pathBuffer.toString();
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
{{#useBeanValidation}}
|
||||
|
||||
@@ -117,7 +117,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
httpclient_version = "5.1.3"
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
|
||||
@@ -107,7 +107,7 @@ ext {
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{/jackson}}
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
feign_version = "13.5"
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -416,7 +416,7 @@
|
||||
<gson-version>2.10.1</gson-version>
|
||||
{{/gson}}
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
|
||||
@@ -101,7 +101,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
google_api_client_version = "1.32.2"
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#joda}}
|
||||
<jodatime-version>2.9.9</jodatime-version>
|
||||
|
||||
@@ -107,7 +107,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
{{#useBeanValidation}}
|
||||
|
||||
@@ -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.8" % "compile",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.7" % "compile",
|
||||
{{/openApiNullable}}
|
||||
{{#hasOAuthMethods}}
|
||||
"com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
<beanvalidation-version>3.0.2</beanvalidation-version>
|
||||
|
||||
@@ -102,7 +102,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "2.1.0"
|
||||
{{#useBeanValidation}}
|
||||
|
||||
@@ -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.8" % "compile",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.7" % "compile",
|
||||
{{/openApiNullable}}
|
||||
{{#hasOAuthMethods}}
|
||||
"com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile",
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
<beanvalidation-version>3.0.2</beanvalidation-version>
|
||||
|
||||
@@ -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}};
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
<swagger.core.version>1.5.18</swagger.core.version>
|
||||
<jetty.version>9.2.9.v20150224</jetty.version>
|
||||
<junit.version>5.10.2</junit.version>
|
||||
<logback.version>1.5.19</logback.version>
|
||||
<logback.version>1.5.13</logback.version>
|
||||
{{#useBeanValidation}}
|
||||
<beanvalidation.version>3.0.2</beanvalidation.version>
|
||||
{{/useBeanValidation}}
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
<swagger.core.version>1.5.18</swagger.core.version>
|
||||
<jetty.version>9.2.9.v20150224</jetty.version>
|
||||
<junit.version>5.10.2</junit.version>
|
||||
<logback.version>1.5.19</logback.version>
|
||||
<logback.version>1.5.13</logback.version>
|
||||
{{#useBeanValidation}}
|
||||
<beanvalidation.version>3.0.1</beanvalidation.version>
|
||||
{{/useBeanValidation}}
|
||||
|
||||
@@ -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.8"
|
||||
implementation "org.openapitools:jackson-databind-nullable:0.2.7"
|
||||
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
|
||||
{{#useBeanValidation}}
|
||||
implementation "jakarta.validation:jakarta.validation-api:$beanvalidation_version"
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
<beanvalidation-version>3.0.2</beanvalidation-version>
|
||||
|
||||
@@ -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.8'
|
||||
implementation 'org.openapitools:jackson-databind-nullable:0.2.7'
|
||||
{{/openApiNullable}}
|
||||
{{#withAWSV4Signature}}
|
||||
implementation 'software.amazon.awssdk:auth:2.20.157'
|
||||
|
||||
@@ -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.8",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.7",
|
||||
{{/openApiNullable}}
|
||||
{{#withAWSV4Signature}}
|
||||
"software.amazon.awssdk" % "auth" % "2.20.157",
|
||||
|
||||
@@ -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}};
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#joda}}
|
||||
<jodatime-version>2.12.0</jodatime-version>
|
||||
|
||||
@@ -109,7 +109,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
{{/jackson}}
|
||||
{{#gson}}
|
||||
|
||||
@@ -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.8",
|
||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.7",
|
||||
{{/openApiNullable}}
|
||||
{{#withXml}}
|
||||
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.13.4.1",
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/jackson}}
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
|
||||
@@ -106,7 +106,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
spring_web_version = "6.1.21"
|
||||
jakarta_annotation_version = "2.1.1"
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
{{#joda}}
|
||||
|
||||
@@ -101,7 +101,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
threetenbp_version = "2.9.10"
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
|
||||
@@ -118,7 +118,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
spring_web_version = "6.2.8"
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
<spring-web-version>6.2.8</spring-web-version>
|
||||
|
||||
@@ -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.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
{{/jackson}}
|
||||
{{#usePlayWS}}
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
<javax.ws.rs-api-version>2.1.1</javax.ws.rs-api-version>
|
||||
{{/jackson}}
|
||||
|
||||
@@ -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.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
jakarta_annotation_version = "1.3.5"
|
||||
}
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
{{/useJakartaEe}}
|
||||
|
||||
@@ -147,7 +147,7 @@ ext {
|
||||
jackson_version = "2.19.2"
|
||||
jackson_databind_version = "2.19.2"
|
||||
{{#openApiNullable}}
|
||||
jackson_databind_nullable_version = "0.2.8"
|
||||
jackson_databind_nullable_version = "0.2.7"
|
||||
{{/openApiNullable}}
|
||||
{{#joda}}
|
||||
jodatime_version = "2.9.9"
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
{{#useJakartaEe}}
|
||||
<spring-boot-version>3.2.12</spring-boot-version>
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<swagger-inflector-version>1.0.14</swagger-inflector-version>
|
||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.13</logback-version>
|
||||
{{#useJakartaEe}}
|
||||
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
|
||||
{{/useJakartaEe}}
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -220,7 +220,7 @@ for this project used jakarta.validation-api -->
|
||||
<swagger-core-version>1.5.22</swagger-core-version>
|
||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.13</logback-version>
|
||||
{{#useBeanValidation}}
|
||||
<beanvalidation-version>2.0.2</beanvalidation-version>
|
||||
{{/useBeanValidation}}
|
||||
|
||||
@@ -342,7 +342,7 @@ for this project used jakarta.validation-api -->
|
||||
{{/generateSpringApplication}}
|
||||
{{^generateSpringBootApplication}}
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.13</logback-version>
|
||||
{{/generateSpringBootApplication}}
|
||||
<cxf-version>3.5.9</cxf-version>
|
||||
<jackson-jaxrs-version>2.17.1</jackson-jaxrs-version>
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -255,7 +255,7 @@ for this project used jakarta.validation-api -->
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.13</logback-version>
|
||||
{{#useBeanValidation}}
|
||||
<beanvalidation-version>2.0.2</beanvalidation-version>
|
||||
{{/useBeanValidation}}
|
||||
|
||||
@@ -311,7 +311,7 @@ for this project used jakarta.validation-api -->
|
||||
{{/swagger2AnnotationLibrary}}
|
||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.13</logback-version>
|
||||
{{#useBeanValidation}}
|
||||
<beanvalidation-version>2.0.2</beanvalidation-version>
|
||||
{{/useBeanValidation}}
|
||||
|
||||
@@ -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}};
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
<jersey3-version>3.1.3</jersey3-version>
|
||||
<jackson-version>2.17.1</jackson-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.13</logback-version>
|
||||
<servlet-api-version>5.0.0</servlet-api-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
@@ -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}};
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ for this project used jakarta.validation-api -->
|
||||
<jersey2-version>2.35</jersey2-version>
|
||||
<jackson-version>2.17.1</jackson-version>
|
||||
<junit-version>4.13.2</junit-version>
|
||||
<logback-version>1.5.19</logback-version>
|
||||
<logback-version>1.5.13</logback-version>
|
||||
<servlet-api-version>4.0.4</servlet-api-version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
@@ -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}}
|
||||
|
||||
|
||||
@@ -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}}
|
||||
|
||||
|
||||
@@ -23,10 +23,7 @@ import {{javaxPackage}}.validation.Valid;{{/useBeanValidation}}
|
||||
/**
|
||||
* Represents a collection of functions to interact with the API endpoints.
|
||||
*/
|
||||
{{^interfaceOnly}}
|
||||
@Path("{{commonPath}}")
|
||||
{{/interfaceOnly}}
|
||||
{{#useSwaggerAnnotations}}
|
||||
@Path("{{commonPath}}"){{#useSwaggerAnnotations}}
|
||||
@Api(description = "the {{{baseName}}} API"){{/useSwaggerAnnotations}}{{#hasConsumes}}
|
||||
@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}}
|
||||
@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}}
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* @return {{{message}}}
|
||||
{{/responses}}
|
||||
*/
|
||||
@{{httpMethod}}
|
||||
@Path("{{commonPath}}{{{path}}}"){{#hasConsumes}}
|
||||
@{{httpMethod}}{{#subresourceOperation}}
|
||||
@Path("{{{path}}}"){{/subresourceOperation}}{{#hasConsumes}}
|
||||
@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}}
|
||||
@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}}{{#useSwaggerAnnotations}}
|
||||
@ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}"{{#hasAuthMethods}}, authorizations = {
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
{{#jackson}}
|
||||
@JsonValue
|
||||
{{/jackson}}
|
||||
public String toString() {
|
||||
return String.valueOf(value);
|
||||
}
|
||||
@@ -42,7 +40,6 @@
|
||||
{{#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()) {
|
||||
@@ -52,5 +49,4 @@
|
||||
}
|
||||
{{#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}}
|
||||
}
|
||||
|
||||
@@ -41,14 +41,11 @@ 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()) {
|
||||
@@ -58,5 +55,4 @@ 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}}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
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;
|
||||
@@ -23,7 +22,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}}
|
||||
{{#jackson}}@JsonTypeName("{{name}}"){{/jackson}}
|
||||
@JsonTypeName("{{name}}")
|
||||
{{>generatedAnnotation}}{{>additionalModelTypeAnnotations}}{{>xmlPojoAnnotation}}
|
||||
{{#vendorExtensions.x-class-extra-annotation}}
|
||||
{{{vendorExtensions.x-class-extra-annotation}}}
|
||||
@@ -41,7 +40,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}}
|
||||
@@ -62,7 +61,6 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
|
||||
public {{classname}}() {
|
||||
}
|
||||
|
||||
{{#jackson}}
|
||||
{{#generateJsonCreator}}
|
||||
{{#hasRequired}}
|
||||
@JsonCreator
|
||||
@@ -87,7 +85,6 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
|
||||
|
||||
{{/hasRequired}}
|
||||
{{/generateJsonCreator}}
|
||||
{{/jackson}}
|
||||
{{#vars}}
|
||||
/**
|
||||
{{#description}}
|
||||
@@ -111,14 +108,12 @@ 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}}
|
||||
{{#jackson}}@JsonProperty({{#required}}required = {{required}}, value = {{/required}}"{{baseName}}"){{/jackson}}
|
||||
@JsonProperty({{#required}}required = {{required}}, value = {{/required}}"{{baseName}}")
|
||||
{{#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}};
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
<jakarta.ws.rs-version>2.1.6</jakarta.ws.rs-version>
|
||||
{{/useJakartaEe}}
|
||||
{{#openApiNullable}}
|
||||
<jackson-databind-nullable-version>0.2.8</jackson-databind-nullable-version>
|
||||
<jackson-databind-nullable-version>0.2.7</jackson-databind-nullable-version>
|
||||
{{/openApiNullable}}
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{{#isFormParam}}{{^isFile}}{{>paramDoc}}{{#useBeanValidation}} {{>beanValidationBodyParams}}@Valid{{/useBeanValidation}} {{#isModel}}@RequestPart{{/isModel}}{{^isModel}}{{#isArray}}@RequestPart{{/isArray}}{{^isArray}}{{#reactive}}@RequestPart{{/reactive}}{{^reactive}}@RequestParam{{/reactive}}{{/isArray}}{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{^required}}{{#useOptional}}Optional<{{/useOptional}}{{/required}}{{{dataType}}}{{^required}}{{#useOptional}}>{{/useOptional}}{{/required}} {{paramName}}{{/isFile}}{{#isFile}}{{>paramDoc}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#reactive}}{{#isArray}}Flux<{{/isArray}}Part{{#isArray}}>{{/isArray}}{{/reactive}}{{^reactive}}{{#isArray}}List<{{/isArray}}MultipartFile{{#isArray}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isFile}}{{/isFormParam}}
|
||||
{{#isFormParam}}{{^isFile}}{{>paramDoc}}{{#useBeanValidation}} {{>beanValidationBodyParams}}@Valid{{/useBeanValidation}} {{#isModel}}@RequestPart{{/isModel}}{{^isModel}}{{#isArray}}@RequestPart{{/isArray}}{{^isArray}}{{#reactive}}@RequestPart{{/reactive}}{{^reactive}}@RequestParam{{/reactive}}{{/isArray}}{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}){{>dateTimeParam}} {{^required}}{{#useOptional}}Optional<{{/useOptional}}{{/required}}{{{dataType}}}{{^required}}{{#useOptional}}>{{/useOptional}}{{/required}} {{paramName}}{{/isFile}}{{#isFile}}{{>paramDoc}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#reactive}}{{#isArray}}Flux<{{/isArray}}Part{{#isArray}}>{{/isArray}}{{/reactive}}{{^reactive}}{{#isArray}}List<{{/isArray}}MultipartFile{{#isArray}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isFile}}{{/isFormParam}}
|
||||
@@ -1 +1 @@
|
||||
{{#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}}
|
||||
{{#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}}
|
||||
@@ -208,7 +208,7 @@
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>0.2.8</version>
|
||||
<version>0.2.7</version>
|
||||
</dependency>
|
||||
{{/openApiNullable}}
|
||||
{{#useBeanValidation}}
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>0.2.8</version>
|
||||
<version>0.2.7</version>
|
||||
</dependency>
|
||||
{{/openApiNullable}}
|
||||
{{#useBeanValidation}}
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
{{^parentOverridden}}
|
||||
<version>0.2.8</version>
|
||||
<version>0.2.7</version>
|
||||
{{/parentOverridden}}
|
||||
</dependency>
|
||||
{{/openApiNullable}}
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
{{^parentOverridden}}
|
||||
<version>0.2.8</version>
|
||||
<version>0.2.7</version>
|
||||
{{/parentOverridden}}
|
||||
</dependency>
|
||||
{{/openApiNullable}}
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>0.2.8</version>
|
||||
<version>0.2.7</version>
|
||||
</dependency>
|
||||
{{/openApiNullable}}
|
||||
{{#lombok}}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{{#isPathParam}}{{#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}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>optionalDataType}} {{paramName}}{{/isPathParam}}
|
||||
@@ -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}}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{{#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}}
|
||||
{{#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}}
|
||||
@@ -217,16 +217,8 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "{{{baseName}}}", r.{{paramName}}, "{{style}}", "{{collectionFormat}}")
|
||||
{{/isCollectionFormatMulti}}
|
||||
{{#defaultValue}}} else {
|
||||
{{#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}}
|
||||
var defaultValue {{{dataType}}} = {{{.}}}
|
||||
r.{{paramName}} = &defaultValue
|
||||
{{/defaultValue}}}
|
||||
{{/required}}
|
||||
{{/queryParams}}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -116,7 +116,7 @@ Do not edit the class manually.
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>0.2.8</version>
|
||||
<version>0.2.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
|
||||
@@ -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}};
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<properties>
|
||||
{{#openApiNullable}}
|
||||
<version.jackson.databind.nullable>0.2.8</version.jackson.databind.nullable>
|
||||
<version.jackson.databind.nullable>0.2.7</version.jackson.databind.nullable>
|
||||
{{/openApiNullable}}
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -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}};
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
<properties>
|
||||
{{#openApiNullable}}
|
||||
<version.jackson.databind.nullable>0.2.8</version.jackson.databind.nullable>
|
||||
<version.jackson.databind.nullable>0.2.7</version.jackson.databind.nullable>
|
||||
{{/openApiNullable}}
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -40,7 +40,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}};
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<properties>
|
||||
<mainClass>{{{invokerPackage}}}.Main</mainClass>
|
||||
{{#openApiNullable}}
|
||||
<version.jackson.databind.nullable>0.2.8</version.jackson.databind.nullable>
|
||||
<version.jackson.databind.nullable>0.2.7</version.jackson.databind.nullable>
|
||||
{{/openApiNullable}}
|
||||
</properties>
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user