From 6be539db83672cbe22bb887747234eb09fe0de33 Mon Sep 17 00:00:00 2001 From: spericas Date: Fri, 23 Sep 2022 17:11:14 -0500 Subject: [PATCH 01/18] Create common files for Helidon generators Signed-off-by: spericas --- .../languages/JavaHelidonCommonCodegen.java | 259 ++++++++++++++++++ .../java-helidon/common/README.mustache | 9 + .../java-helidon/common/gitignore.mustache | 21 ++ .../java-helidon/common/licenseInfo.mustache | 11 + .../java-helidon/common/model.mustache | 23 ++ .../java-helidon/common/pojo.mustache | 121 ++++++++ 6 files changed, 444 insertions(+) create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/common/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/common/gitignore.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/common/licenseInfo.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/common/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/common/pojo.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java new file mode 100644 index 00000000000..53beef1e21c --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.Set; +import java.util.stream.Collectors; + +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.languages.features.BeanValidationFeatures; +import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures; + +import static org.openapitools.codegen.CodegenConstants.DEVELOPER_EMAIL; +import static org.openapitools.codegen.CodegenConstants.DEVELOPER_NAME; +import static org.openapitools.codegen.CodegenConstants.DEVELOPER_ORGANIZATION; +import static org.openapitools.codegen.CodegenConstants.DEVELOPER_ORGANIZATION_URL; +import static org.openapitools.codegen.CodegenConstants.PARENT_ARTIFACT_ID; +import static org.openapitools.codegen.CodegenConstants.PARENT_GROUP_ID; +import static org.openapitools.codegen.CodegenConstants.PARENT_VERSION; +import static org.openapitools.codegen.CodegenConstants.SCM_CONNECTION; +import static org.openapitools.codegen.CodegenConstants.SCM_DEVELOPER_CONNECTION; +import static org.openapitools.codegen.CodegenConstants.SCM_URL; + +public abstract class JavaHelidonCommonCodegen extends AbstractJavaCodegen + implements BeanValidationFeatures, PerformBeanValidationFeatures { + + static final String HELIDON_MP = "mp"; + static final String HELIDON_SE = "se"; + + static final String HELIDON_NIMA = "nima"; + static final String HELIDON_NIMA_ANNOTATIONS = "nima-annotations"; + + static final String MICROPROFILE_ROOT_PACKAGE = "rootJavaEEPackage"; + static final String MICROPROFILE_ROOT_DEP_PREFIX = "x-helidon-rootJavaEEDepPrefix"; + static final String MICROPROFILE_ROOT_PACKAGE_DESC = "Root package name for Java EE"; + static final String MICROPROFILE_ROOT_PACKAGE_JAVAX = "javax"; + static final String MICROPROFILE_ROOT_PACKAGE_JAKARTA = "jakarta"; + private static final String VALIDATION_ARTIFACT_PREFIX_KEY = "x-helidon-validationArtifactPrefix"; + private static final String VALIDATION_ARTIFACT_PREFIX_JAVAX = ""; + private static final String VALIDATION_ARTIFACT_PREFIX_JAKARTA = MICROPROFILE_ROOT_PACKAGE_JAKARTA + "."; + + // for generated doc + static final String MICROPROFILE_ROOT_PACKAGE_DEFAULT = + "Helidon 2.x and earlier: " + MICROPROFILE_ROOT_PACKAGE_JAVAX + + "; Helidon 3.x and later: " + MICROPROFILE_ROOT_PACKAGE_JAKARTA; + + static final String SERIALIZATION_LIBRARY_JACKSON = "jackson"; + static final String SERIALIZATION_LIBRARY_JSONB = "jsonb"; + + public static final String HELIDON_VERSION = "helidonVersion"; + public static final String DEFAULT_HELIDON_VERSION = "3.0.1"; + static final String HELIDON_VERSION_DESC = "Helidon version for generated code"; + + static final String FULL_PROJECT = "fullProject"; + static final String FULL_PROJECT_DESC = "If set to true, it will generate all files; if set to false, " + + "it will only generate API files. If unspecified, the behavior depends on whether a project " + + "exists or not: if it does not, same as true; if it does, same as false. Note that test files " + + "are never overwritten."; + + private String helidonVersion; + private String rootJavaEEPackage; + private String rootJavaEEDepPrefix; + + public JavaHelidonCommonCodegen() { + super(); + cliOptions.add(new CliOption(HELIDON_VERSION, HELIDON_VERSION_DESC) + .defaultValue(DEFAULT_HELIDON_VERSION)); + cliOptions.add(new CliOption(MICROPROFILE_ROOT_PACKAGE, MICROPROFILE_ROOT_PACKAGE_DESC) + .defaultValue(MICROPROFILE_ROOT_PACKAGE_DEFAULT)); + cliOptions.add(new CliOption(FULL_PROJECT, FULL_PROJECT_DESC) + .defaultValue("")); // depends on project state + } + + @Override + public void processOpts() { + super.processOpts(); + + String userHelidonVersion = ""; + String userParentVersion = ""; + + if (additionalProperties.containsKey(CodegenConstants.PARENT_VERSION)) { + userParentVersion = additionalProperties.get(CodegenConstants.PARENT_VERSION).toString(); + } + + if (additionalProperties.containsKey(HELIDON_VERSION)) { + userHelidonVersion = additionalProperties.get(HELIDON_VERSION).toString(); + } + + if (!userHelidonVersion.isEmpty()) { + if (!userParentVersion.isEmpty() && !userHelidonVersion.equals(userParentVersion)) { + throw new IllegalArgumentException( + String.format(Locale.ROOT, + "Both %s and %s properties were set with different value.", + CodegenConstants.PARENT_VERSION, + HELIDON_VERSION)); + } + setHelidonVersion(userHelidonVersion); + } else if (!userParentVersion.isEmpty()) { + setHelidonVersion(userParentVersion); + } else { + setHelidonVersion(DEFAULT_HELIDON_VERSION); + } + + additionalProperties.put(HELIDON_VERSION, helidonVersion); + setEEPackageAndDependencies(helidonVersion); + } + + /** + * Remove set of options not currently used by any Helidon generator. Should be + * called during construction but only on leaf classes. + */ + protected void removeUnusedOptions() { + removeCliOptions(SCM_CONNECTION, + SCM_DEVELOPER_CONNECTION, + SCM_URL, + DEVELOPER_NAME, + DEVELOPER_ORGANIZATION, + DEVELOPER_ORGANIZATION_URL, + DEVELOPER_EMAIL, + PARENT_ARTIFACT_ID, + PARENT_VERSION, + PARENT_GROUP_ID, + DISABLE_HTML_ESCAPING); + } + + /** + * Determine whether to generate or overwrite files depending on fullProject property. + * If property is unspecified, then check if sources are already there and avoid overwriting + * modifiable files. + * + * @param modifiable list of modifiable files to be processed + * @param unmodifiable list of unmodifiable files to be processed + */ + protected void processSupportingFiles(List modifiable, List unmodifiable) { + Boolean fullProject = !additionalProperties.containsKey(FULL_PROJECT) ? null : + Boolean.parseBoolean(additionalProperties.get(FULL_PROJECT).toString()); + + if (fullProject == null && !projectFilesExist()) { // not explicitly set + supportingFiles.addAll(modifiable); + } else if (Boolean.TRUE.equals(fullProject)) { // explicitly set to true + supportingFiles.addAll(modifiable); + } + supportingFiles.addAll(unmodifiable); + } + + /** + * Check if project is already generated to determine default for the fullProject + * flag. Can be overridden in subclasses to strengthen test condition. + * + * @return outcome of test + */ + protected boolean projectFilesExist() { + return Paths.get(getOutputTestFolder()).toFile().exists(); + } + + protected String rootJavaEEPackage() { + return rootJavaEEPackage; + } + + private void setHelidonVersion(String version) { + helidonVersion = version; + setParentVersion(version); + } + + private void setEEPackageAndDependencies(String version) { + + rootJavaEEPackage = checkAndSelectRootEEPackage(version); + additionalProperties.put(MICROPROFILE_ROOT_PACKAGE, rootJavaEEPackage); + + rootJavaEEDepPrefix = checkAndSelectRootEEDepPrefix(version); + additionalProperties.put(MICROPROFILE_ROOT_DEP_PREFIX, rootJavaEEDepPrefix); + + additionalProperties.put(VALIDATION_ARTIFACT_PREFIX_KEY, + rootJavaEEDepPrefix.equals(MICROPROFILE_ROOT_PACKAGE_JAVAX) + ? VALIDATION_ARTIFACT_PREFIX_JAVAX + : VALIDATION_ARTIFACT_PREFIX_JAKARTA); + } + + private String checkAndSelectRootEEPackage(String version) { + String packagePrefixImpliedByVersion = usesJakartaPackages(version) + ? MICROPROFILE_ROOT_PACKAGE_JAKARTA + : MICROPROFILE_ROOT_PACKAGE_JAVAX; + + // Make sure any user-specified root EE package is correct for the chosen Helidon version. + if (additionalProperties.containsKey(MICROPROFILE_ROOT_PACKAGE)) { + String userRootEEPackage = additionalProperties.get(MICROPROFILE_ROOT_PACKAGE).toString(); + if (!packagePrefixImpliedByVersion.equals(userRootEEPackage)) { + throw new IllegalArgumentException( + String.format(Locale.ROOT, + "Helidon version %s uses the %s namespace but options specified '%s'", + version, + packagePrefixImpliedByVersion, + userRootEEPackage)); + } + return userRootEEPackage; + } + + // No explicit setting for the root EE package. + return packagePrefixImpliedByVersion; + } + + private String checkAndSelectRootEEDepPrefix(String version) { + String mavenDepPrefixImpliedByVersion = usesJakartaPrefix(version) + ? MICROPROFILE_ROOT_PACKAGE_JAKARTA + : MICROPROFILE_ROOT_PACKAGE_JAVAX; + + // Make sure any user-specified prefix is correct for the chosen Helidon version. + if (additionalProperties.containsKey(MICROPROFILE_ROOT_DEP_PREFIX)) { + String userMavenDepPrefix = additionalProperties.get(MICROPROFILE_ROOT_DEP_PREFIX).toString(); + if (!mavenDepPrefixImpliedByVersion.equals(userMavenDepPrefix)) { + throw new IllegalArgumentException( + String.format(Locale.ROOT, + "Helidon version %s uses the %s prefix for EE dependencies but options specified '%s'", + version, + mavenDepPrefixImpliedByVersion, + userMavenDepPrefix)); + } + return userMavenDepPrefix; + } + + // No explicit setting for the dependency prefix. + return mavenDepPrefixImpliedByVersion; + } + + private boolean usesJakartaPackages(String version) { + return !version.startsWith("2.") && !version.startsWith("1."); + } + + private boolean usesJakartaPrefix(String version) { + return !version.startsWith("1."); + } + + protected void removeCliOptions(String... opt) { + List opts = Arrays.asList(opt); + Set forRemoval = cliOptions.stream() + .filter(cliOption -> opts.contains(cliOption.getOpt())) + .collect(Collectors.toSet()); + forRemoval.forEach(cliOptions::remove); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/common/README.mustache b/modules/openapi-generator/src/main/resources/java-helidon/common/README.mustache new file mode 100644 index 00000000000..961c4207f43 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/common/README.mustache @@ -0,0 +1,9 @@ +# {{appName}} + +{{#appDescriptionWithNewLines}} +{{{.}}} + +{{/appDescriptionWithNewLines}} + +## Overview +This project was generated using the Helidon OpenAPI Generator. diff --git a/modules/openapi-generator/src/main/resources/java-helidon/common/gitignore.mustache b/modules/openapi-generator/src/main/resources/java-helidon/common/gitignore.mustache new file mode 100644 index 00000000000..a530464afa1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/common/gitignore.mustache @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/modules/openapi-generator/src/main/resources/java-helidon/common/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/java-helidon/common/licenseInfo.mustache new file mode 100644 index 00000000000..be193d0c4fe --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/common/licenseInfo.mustache @@ -0,0 +1,11 @@ +/** + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ diff --git a/modules/openapi-generator/src/main/resources/java-helidon/common/model.mustache b/modules/openapi-generator/src/main/resources/java-helidon/common/model.mustache new file mode 100644 index 00000000000..00a3c3db131 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/common/model.mustache @@ -0,0 +1,23 @@ +{{>licenseInfo}} +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#useBeanValidation}} +import {{rootJavaEEPackage}}.validation.constraints.*; +import {{rootJavaEEPackage}}.validation.Valid; +{{/useBeanValidation}} + +{{#models}} +{{#model}} +{{#isEnum}} +{{>enumOuterClass}} +{{/isEnum}} +{{^isEnum}} +{{>pojo}} +{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/common/pojo.mustache b/modules/openapi-generator/src/main/resources/java-helidon/common/pojo.mustache new file mode 100644 index 00000000000..944ae482956 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/common/pojo.mustache @@ -0,0 +1,121 @@ +{{#jsonb}} +import java.lang.reflect.Type; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.DeserializationContext; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbDeserializer; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.SerializationContext; +import {{rootJavaEEPackage}}.json.stream.JsonGenerator; +import {{rootJavaEEPackage}}.json.stream.JsonParser; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} + +{{#description}} +/** + * {{{.}}} + */{{/description}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { + +{{#vars}} + {{#isEnum}} + + {{^isContainer}} +{{>enumClass}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} +{{>enumClass}} + {{/mostInnerItems}} + {{/isContainer}} + + {{/isEnum}} + private {{{datatypeWithEnum}}} {{{name}}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; +{{/vars}} + + /** + * Default constructor. + */ + public {{classname}}() { + // JSON-B / Jackson + } + + /** + * Create {{classname}}. + * +{{#vars}} + * @param {{name}} {{description}}{{^description}}{{name}}{{/description}} +{{/vars}} + */ + public {{classname}}( +{{#vars}} + {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} +{{/vars}} + ) { +{{#vars}} + this.{{name}} = {{name}}; +{{/vars}} + } + +{{#vars}}{{#vendorExtensions.x-has-readonly-properties}}{{#jsonb}} + @JsonbCreator + public {{classname}}( + {{#readOnlyVars}} + @JsonbProperty("{{baseName}}") {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + }{{/jsonb}}{{/vendorExtensions.x-has-readonly-properties}} + + /** + {{#description}} + * {{{.}}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + */ + public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + } + + public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + }{{/vars}} + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} + {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{/vars}}sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} From 74c600c87709cf854827eb9d5a26c9dc1cad8b10 Mon Sep 17 00:00:00 2001 From: spericas Date: Fri, 23 Sep 2022 17:11:14 -0500 Subject: [PATCH 02/18] Add Helidon client generator MicroProfile library Java class and resources Signed-off-by: spericas --- .../languages/JavaHelidonClientCodegen.java | 531 ++++++++++++++++++ .../libraries/mp/JavaTimeFormatter.mustache | 53 ++ .../libraries/mp/RFC3339DateFormat.mustache | 46 ++ .../client/libraries/mp/StringUtil.mustache | 72 +++ .../mp/additionalEnumTypeAnnotations.mustache | 2 + .../additionalModelTypeAnnotations.mustache | 2 + .../client/libraries/mp/api.mustache | 61 ++ .../client/libraries/mp/apiOperation.mustache | 28 + .../client/libraries/mp/api_doc.mustache | 55 ++ .../libraries/mp/api_exception.mustache | 19 + .../mp/api_exception_mapper.mustache | 22 + .../client/libraries/mp/api_test.mustache | 64 +++ .../libraries/mp/auth/ApiKeyAuth.mustache | 66 +++ .../libraries/mp/auth/HttpBasicAuth.mustache | 42 ++ .../libraries/mp/auth/HttpBearerAuth.mustache | 49 ++ .../client/libraries/mp/bodyParams.mustache | 1 + .../client/libraries/mp/cookieParams.mustache | 1 + .../client/libraries/mp/enumClass.mustache | 46 ++ .../libraries/mp/enumOuterClass.mustache | 39 ++ .../libraries/mp/enum_outer_doc.mustache | 7 + .../client/libraries/mp/formParams.mustache | 1 + .../libraries/mp/generatedAnnotation.mustache | 1 + .../client/libraries/mp/headerParams.mustache | 1 + .../libraries/mp/jackson_annotations.mustache | 19 + .../client/libraries/mp/licenseInfo.mustache | 11 + .../client/libraries/mp/model.mustache | 19 + .../libraries/mp/modelInnerEnum.mustache | 95 ++++ .../client/libraries/mp/model_doc.mustache | 4 + .../client/libraries/mp/model_test.mustache | 49 ++ .../libraries/mp/oneof_interface.mustache | 6 + .../client/libraries/mp/openapi.mustache | 1 + .../client/libraries/mp/pathParams.mustache | 1 + .../client/libraries/mp/pojo.mustache | 155 +++++ .../client/libraries/mp/pojo_doc.mustache | 37 ++ .../client/libraries/mp/pom.mustache | 90 +++ .../client/libraries/mp/queryParams.mustache | 1 + .../client/libraries/mp/returnTypes.mustache | 4 + .../libraries/mp/typeInfoAnnotation.mustache | 17 + 38 files changed, 1718 insertions(+) create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/JavaTimeFormatter.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/RFC3339DateFormat.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/StringUtil.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/additionalEnumTypeAnnotations.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/additionalModelTypeAnnotations.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/apiOperation.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_exception.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_exception_mapper.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/auth/ApiKeyAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/auth/HttpBasicAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/auth/HttpBearerAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/bodyParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/cookieParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/enumClass.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/enumOuterClass.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/enum_outer_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/formParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/generatedAnnotation.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/headerParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/jackson_annotations.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/licenseInfo.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/modelInnerEnum.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/model_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/model_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/oneof_interface.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/openapi.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pathParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pojo.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pojo_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pom.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/queryParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/returnTypes.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/typeInfoAnnotation.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java new file mode 100644 index 00000000000..6f2de171dd7 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java @@ -0,0 +1,531 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright 2018 SmartBear Software + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeSet; +import java.util.function.Function; + +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.servers.Server; +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.CodegenResponse; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.VendorExtension; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.meta.features.DocumentationFeature; +import org.openapitools.codegen.meta.features.GlobalFeature; +import org.openapitools.codegen.model.ModelMap; +import org.openapitools.codegen.model.ModelsMap; +import org.openapitools.codegen.model.OperationsMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static org.openapitools.codegen.CodegenConstants.SERIALIZATION_LIBRARY; + +public class JavaHelidonClientCodegen extends JavaHelidonCommonCodegen { + + private final Logger LOGGER = LoggerFactory.getLogger(JavaHelidonClientCodegen.class); + + private static final String X_HELIDON_REQUIRED_IMPL_IMPORTS = "x-helidon-requiredImplImports"; + private static final String X_HELIDON_IMPL_IMPORTS = "x-helidon-implImports"; + public static final String CONFIG_KEY = "configKey"; + + protected String configKey = null; + protected boolean useBeanValidation = false; + protected boolean performBeanValidation = false; + protected boolean useGzipFeature = false; + protected boolean caseInsensitiveResponseHeaders = false; + protected Path invokerFolder; + protected Path apiFolder; + protected String serializationLibrary = null; + + /** + * Constructor for this generator. Uses the embedded template dir to find common templates + * shared between Helidon client and server generators. + * + * @see org.openapitools.codegen.templating.GeneratorTemplateContentLocator#getFullTemplatePath + */ + public JavaHelidonClientCodegen() { + // beta for now + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + // TODO: Move GlobalFeature.ParameterizedServer to library: jersey after moving featureSet to generatorMetadata + modifyFeatureSet(features -> features + .includeDocumentationFeatures(DocumentationFeature.Readme) + .includeGlobalFeatures(GlobalFeature.ParameterizedServer) + ); + + outputFolder = "generated-code" + File.separator + "java"; + embeddedTemplateDir = "java-helidon" + File.separator + "common"; // use embedded for common + templateDir = "java-helidon" + File.separator + "client"; + invokerPackage = "org.openapitools.client"; + artifactId = "openapi-java-client"; + apiPackage = invokerPackage + ".api"; + modelPackage = invokerPackage + ".model"; + + updateOption(CodegenConstants.INVOKER_PACKAGE, getInvokerPackage()); + updateOption(CodegenConstants.ARTIFACT_ID, getArtifactId()); + updateOption(CodegenConstants.API_PACKAGE, apiPackage); + updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); + + modelTestTemplateFiles.put("model_test.mustache", ".java"); + + cliOptions.add(CliOption.newString(CONFIG_KEY, "Config key in @RegisterRestClient. Default to none.")); + + supportedLibraries.put(HELIDON_MP, "Helidon MP Client"); + supportedLibraries.put(HELIDON_SE, "Helidon SE Client"); + + CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, + "library template (sub-template) to use"); + libraryOption.setEnum(supportedLibraries); + libraryOption.setDefault(HELIDON_MP); + cliOptions.add(libraryOption); + setLibrary(HELIDON_MP); // default + + CliOption serializationLibrary = new CliOption(SERIALIZATION_LIBRARY, + "Serialization library, defaults to Jackson"); + Map serializationOptions = new HashMap<>(); + serializationOptions.put(SERIALIZATION_LIBRARY_JACKSON, "Use Jackson as serialization library"); + serializationOptions.put(SERIALIZATION_LIBRARY_JSONB, "Use JSON-B as serialization library"); + serializationLibrary.setEnum(serializationOptions); + cliOptions.add(serializationLibrary); + setSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); // default + + removeUnusedOptions(); + + // Ensure the OAS 3.x discriminator mappings include any descendent schemas that allOf + // inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, + // and the discriminator mapping schemas in the OAS document. + this.setLegacyDiscriminatorBehavior(false); + } + + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + @Override + public String getName() { + return "java-helidon-client"; + } + + @Override + public String getHelp() { + return "Generates a Helidon MP or SE client"; + } + + @Override + public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co, + Map> operations) { + super.addOperationToGroup(tag, resourcePath, operation, co, operations); + if (HELIDON_MP.equals(getLibrary())) { + co.subresourceOperation = !co.path.isEmpty(); + } + } + + @Override + public String apiFilename(String templateName, String tag) { + if (templateName.contains("_impl")) { + String suffix = apiTemplateFiles().get(templateName); + return apiFileFolder() + File.separator + toApiFilename(tag) + "Impl" + suffix; + } + return super.apiFilename(templateName, tag); + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey(SERIALIZATION_LIBRARY)) { + setSerializationLibrary(additionalProperties.get(SERIALIZATION_LIBRARY).toString()); + } + + if (additionalProperties.containsKey(CONFIG_KEY)) { + setConfigKey(additionalProperties.get(CONFIG_KEY).toString()); + } + + String invokerPath = invokerPackage.replace('.', File.separatorChar); + invokerFolder = Paths.get(sourceFolder, invokerPath); + apiFolder = Paths.get(outputFolder).relativize(Paths.get(apiFileFolder())); + + if (isLibrary(HELIDON_MP)) { + String apiExceptionFolder = Paths.get(sourceFolder, + apiPackage().replace('.', File.separatorChar)).toString(); + + List modifiable = new ArrayList<>(); + modifiable.add(new SupportingFile("pom.mustache", "", "pom.xml")); + modifiable.add(new SupportingFile("README.mustache", "", "README.md")); + List unmodifiable = new ArrayList<>(); + unmodifiable.add(new SupportingFile("api_exception.mustache", apiExceptionFolder, "ApiException.java")); + unmodifiable.add(new SupportingFile("api_exception_mapper.mustache", apiExceptionFolder, "ApiExceptionMapper.java")); + if (additionalProperties.containsKey("jsr310")) { + unmodifiable.add(new SupportingFile("JavaTimeFormatter.mustache", + invokerFolder.toString(), "JavaTimeFormatter.java")); + } + processSupportingFiles(modifiable, unmodifiable); + } else if (isLibrary(HELIDON_SE)) { + apiTemplateFiles.put("api_impl.mustache", ".java"); + importMapping.put("StringJoiner", "java.util.StringJoiner"); + importMapping.put("WebClientRequestHeaders", "io.helidon.webclient.WebClientRequestHeaders"); + importMapping.put("Pair", invokerPackage + ".Pair"); + + + List modifiable = new ArrayList<>(); + modifiable.add(new SupportingFile("pom.mustache", "", "pom.xml")); + modifiable.add(new SupportingFile("README.mustache", "", "README.md")); + + List unmodifiable = new ArrayList<>(); + unmodifiable.add(new SupportingFile("ApiResponse.mustache", invokerFolder.toString(), "ApiResponse.java")); + unmodifiable.add(new SupportingFile("ApiResponseBase.mustache", invokerFolder.toString(), "ApiResponseBase.java")); + unmodifiable.add(new SupportingFile("ApiClient.mustache", invokerFolder.toString(), "ApiClient.java")); + unmodifiable.add(new SupportingFile("Pair.mustache", invokerFolder.toString(), "Pair.java")); + unmodifiable.add(new SupportingFile("ResponseType.mustache", apiFolder.toString(), "ResponseType.java")); + + processSupportingFiles(modifiable, unmodifiable); + } + else { + LOGGER.error("Unknown library option (-l/--library): {}", getLibrary()); + } + + if (getSerializationLibrary() == null) { + LOGGER.info("No serializationLibrary configured, using '{}' as fallback", SERIALIZATION_LIBRARY_JACKSON); + setSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); + } + switch (getSerializationLibrary()) { + case SERIALIZATION_LIBRARY_JACKSON: + additionalProperties.put(SERIALIZATION_LIBRARY_JACKSON, "true"); + additionalProperties.remove(SERIALIZATION_LIBRARY_JSONB); + supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache", invokerFolder.toString(), "RFC3339DateFormat.java")); + break; + case SERIALIZATION_LIBRARY_JSONB: + openApiNullable = false; // for Jackson only + additionalProperties.put(SERIALIZATION_LIBRARY_JSONB, "true"); + additionalProperties.remove(SERIALIZATION_LIBRARY_JACKSON); + break; + default: + additionalProperties.remove(SERIALIZATION_LIBRARY_JACKSON); + additionalProperties.remove(SERIALIZATION_LIBRARY_JSONB); + LOGGER.error("Unknown serialization library option"); + break; + } + } + + /** + * Check if pom file and src directory already exist. + * + * @return outcome of test + */ + @Override + protected boolean projectFilesExist() { + Path projectFolder = Paths.get(getOutputTestFolder()); + Path pom = projectFolder.resolve("pom.xml"); + Path src = projectFolder.resolve(invokerFolder); + return pom.toFile().exists() && src.toFile().exists(); + } + + @Override + public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { + if (isLibrary(HELIDON_MP)) { + super.postProcessOperationsWithModels(objs, allModels); + return AbstractJavaJAXRSServerCodegen.jaxrsPostProcessOperations(objs); + } else { + // Compute the imports to declare in the generated API impl class. + List> imports = objs.getImports(); + List> implImports = new ArrayList<>(imports); + + Set requiredImplImportClassNames = new HashSet<>(); + for (CodegenOperation op : objs.getOperations().getOperation()) { + requiredImplImportClassNames.addAll((Set) op.vendorExtensions.get(X_HELIDON_REQUIRED_IMPL_IMPORTS)); + } + + Set missingImportClassNames = new TreeSet<>(requiredImplImportClassNames); + imports.stream() + .map(m -> m.get("classname")) + .forEach(missingImportClassNames::remove); + + missingImportClassNames.forEach(c -> { + Map singleImportMap = new HashMap<>(); + singleImportMap.put("classname", c); + singleImportMap.put("import", Objects.requireNonNull(importMapping.get(c), "no mapping for " + c)); + implImports.add(singleImportMap); + }); + + objs.put(X_HELIDON_IMPL_IMPORTS, implImports); + return objs; + } + } + + @Override + public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { + CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); + // We use two templates, one for the API interface and one for the impl class. + // Add to the normal imports for this operation only those imports used in both + // the API and the impl. Create a vendor extension on the operation to record the + // additional imports needed for the implementation class. + Set requiredImplImports = new TreeSet<>(); + if (op.isArray) { + op.imports.add("List"); + } + if (op.isMap) { + op.imports.add("Map"); + } + if (op.getHasQueryParams()) { + requiredImplImports.add("List"); + requiredImplImports.add("ArrayList"); + requiredImplImports.add("Pair"); + } + if (op.getHasHeaderParams()) { + requiredImplImports.add("WebClientRequestHeaders"); + } + if (op.getHasFormParams()) { + requiredImplImports.add("StringJoiner"); + } + if (op.getHasCookieParams()) { + requiredImplImports.add("StringJoiner"); + } + if (op.bodyParams.stream().anyMatch(JavaHelidonClientCodegen::checkIsArray) + || op.allParams.stream().anyMatch(JavaHelidonClientCodegen::checkIsArray) + || op.responses.stream().anyMatch(CodegenResponse::getIsArray)) { + requiredImplImports.add("List"); + op.imports.add("List"); + } + if (op.bodyParams.stream().anyMatch(JavaHelidonClientCodegen::checkIsMap) + || op.allParams.stream().anyMatch(JavaHelidonClientCodegen::checkIsMap) + || op.responses.stream().anyMatch(CodegenResponse::getIsMap)) { + requiredImplImports.add("Map"); + op.imports.add("Map"); + } + + op.vendorExtensions.put(X_HELIDON_REQUIRED_IMPL_IMPORTS, requiredImplImports); + return op; + } + + private static boolean checkIsArray(CodegenParameter p) { + return p.isArray || !(p.getSchema() != null && p.getSchema().getIsArray()); + } + + private static boolean checkIsMap(CodegenParameter p) { + return p.isMap || !(p.getSchema() != null && p.getSchema().getIsMap()); + } + + @Override + public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + super.postProcessModelProperty(model, property); + + if (!BooleanUtils.toBoolean(model.isEnum) + && additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON)) { + model.imports.add("JsonProperty"); + model.imports.add("JsonValue"); + model.imports.add("JsonInclude"); + model.imports.add("JsonTypeName"); + } else if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON)) { + model.imports.add("JsonValue"); + model.imports.add("JsonCreator"); + } + + if (HELIDON_MP.equals(getLibrary())) { + model.imports.remove("ApiModelProperty"); + model.imports.remove("ApiModel"); + model.imports.remove("JsonSerialize"); + model.imports.remove("ToStringSerializer"); + } else if (HELIDON_SE.equals(getLibrary())) { + // TODO check for SE-specifics + model.imports.remove("ApiModelProperty"); + model.imports.remove("ApiModel"); + model.imports.remove("JsonSerialize"); + model.imports.remove("ToStringSerializer"); + } + + if ("set".equals(property.containerType) && !JACKSON.equals(serializationLibrary)) { + // clean-up + model.imports.remove("JsonDeserialize"); + property.vendorExtensions.remove("x-setter-extra-annotation"); + } + } + + @Override + public CodegenModel fromModel(String name, Schema model) { + CodegenModel codegenModel = super.fromModel(name, model); + if (isLibrary(HELIDON_MP)) { + if (codegenModel.imports.contains("ApiModel")) { + // Remove io.swagger.annotations.ApiModel import + codegenModel.imports.remove("ApiModel"); + } + } else if (isLibrary(HELIDON_SE)) { + if (codegenModel.imports.contains("ApiModel")) { + // Remove io.swagger.annotations.ApiModel import + codegenModel.imports.remove("ApiModel"); + } + } + return codegenModel; + } + + @SuppressWarnings("unchecked") + @Override + public ModelsMap postProcessModels(ModelsMap objs) { + objs = super.postProcessModels(objs); + List models = objs.getModels(); + + if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON)) { + List> imports = objs.getImports(); + for (ModelMap mo : models) { + CodegenModel cm = mo.getModel(); + boolean addImports = false; + + for (CodegenProperty var : cm.vars) { + if (this.openApiNullable) { + boolean isOptionalNullable = Boolean.FALSE.equals(var.required) && Boolean.TRUE.equals(var.isNullable); + // only add JsonNullable and related imports to optional and nullable values + addImports |= isOptionalNullable; + var.getVendorExtensions().put("x-is-jackson-optional-nullable", isOptionalNullable); + } + + if (Boolean.TRUE.equals(var.getVendorExtensions().get("x-enum-as-string"))) { + // treat enum string as just string + var.datatypeWithEnum = var.dataType; + + if (StringUtils.isNotEmpty(var.defaultValue)) { // has default value + String defaultValue = var.defaultValue.substring(var.defaultValue.lastIndexOf('.') + 1); + for (Map enumVars : (List>) var.getAllowableValues().get("enumVars")) { + if (defaultValue.equals(enumVars.get("name"))) { + // update default to use the string directly instead of enum string + var.defaultValue = (String) enumVars.get("value"); + } + } + } + + // add import for Set, HashSet + cm.imports.add("Set"); + Map importsSet = new HashMap<>(); + importsSet.put("import", "java.util.Set"); + imports.add(importsSet); + Map importsHashSet = new HashMap<>(); + importsHashSet.put("import", "java.util.HashSet"); + imports.add(importsHashSet); + } + + } + + if (addImports) { + Map imports2Classnames = new HashMap<>(); + imports2Classnames.put("JsonNullable", "org.openapitools.jackson.nullable.JsonNullable"); + imports2Classnames.put("NoSuchElementException", "java.util.NoSuchElementException"); + imports2Classnames.put("JsonIgnore", "com.fasterxml.jackson.annotation.JsonIgnore"); + for (Map.Entry entry : imports2Classnames.entrySet()) { + cm.imports.add(entry.getKey()); + Map importsItem = new HashMap<>(); + importsItem.put("import", entry.getValue()); + imports.add(importsItem); + } + } + } + } + + return objs; + } + + public void setConfigKey(String configKey) { + this.configKey = configKey; + } + + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } + + public void setPerformBeanValidation(boolean performBeanValidation) { + this.performBeanValidation = performBeanValidation; + } + + public void setUseGzipFeature(boolean useGzipFeature) { + this.useGzipFeature = useGzipFeature; + } + + public void setCaseInsensitiveResponseHeaders(final Boolean caseInsensitiveResponseHeaders) { + this.caseInsensitiveResponseHeaders = caseInsensitiveResponseHeaders; + } + + public String getSerializationLibrary() { + return serializationLibrary; + } + + public void setSerializationLibrary(String serializationLibrary) { + if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) { + this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON; + } else if (SERIALIZATION_LIBRARY_JSONB.equalsIgnoreCase(serializationLibrary)) { + this.serializationLibrary = SERIALIZATION_LIBRARY_JSONB; + } else { + throw new IllegalArgumentException("Unexpected serializationLibrary value: " + serializationLibrary); + } + } + + @Override + public Map postProcessSupportingFileData(Map objs) { + generateYAMLSpecFile(objs); + return super.postProcessSupportingFileData(objs); + } + + @Override + public String toApiVarName(String name) { + String apiVarName = super.toApiVarName(name); + if (reservedWords.contains(apiVarName)) { + apiVarName = escapeReservedWord(apiVarName); + } + return apiVarName; + } + + @Override + public void addImportsToOneOfInterface(List> imports) { + for (String i : Arrays.asList("JsonSubTypes", "JsonTypeInfo", "JsonIgnoreProperties")) { + Map oneImport = new HashMap<>(); + oneImport.put("import", importMapping.get(i)); + if (!imports.contains(oneImport)) { + imports.add(oneImport); + } + } + } + + @Override + public List getSupportedVendorExtensions() { + List extensions = super.getSupportedVendorExtensions(); + extensions.add(VendorExtension.X_WEBCLIENT_BLOCKING); + return extensions; + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/JavaTimeFormatter.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/JavaTimeFormatter.mustache new file mode 100644 index 00000000000..f3fb34e559c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/JavaTimeFormatter.mustache @@ -0,0 +1,53 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +{{>generatedAnnotation}} +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/RFC3339DateFormat.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/RFC3339DateFormat.mustache new file mode 100644 index 00000000000..311616a4ef1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/RFC3339DateFormat.mustache @@ -0,0 +1,46 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/StringUtil.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/StringUtil.mustache new file mode 100644 index 00000000000..e3d5d6e9088 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/StringUtil.mustache @@ -0,0 +1,72 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import java.util.Collection; +import java.util.Iterator; + +{{>generatedAnnotation}} +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/additionalEnumTypeAnnotations.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/additionalEnumTypeAnnotations.mustache new file mode 100644 index 00000000000..aa524798b42 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/additionalEnumTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalEnumTypeAnnotations}}{{{.}}} +{{/additionalEnumTypeAnnotations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/additionalModelTypeAnnotations.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/additionalModelTypeAnnotations.mustache new file mode 100644 index 00000000000..f4871c02cc2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/additionalModelTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalModelTypeAnnotations}}{{{.}}} +{{/additionalModelTypeAnnotations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api.mustache new file mode 100644 index 00000000000..6367b03ed23 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api.mustache @@ -0,0 +1,61 @@ +{{>licenseInfo}} +package {{package}}; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import {{rootJavaEEPackage}}.ws.rs.*; +import {{rootJavaEEPackage}}.ws.rs.core.Response; +import {{rootJavaEEPackage}}.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +{{#imports}}import {{import}}; +{{/imports}} + +{{#appName}} +/** + * {{{appName}}} + * + {{#appDescription}} + *

{{{.}}} + {{/appDescription}} + */ +{{/appName}} +@RegisterRestClient{{#configKey}}(configKey="{{configKey}}"){{/configKey}} +@RegisterProvider(ApiExceptionMapper.class) +@Path("{{#useAnnotatedBasePath}}{{contextPath}}{{/useAnnotatedBasePath}}{{commonPath}}") +public interface {{classname}} { +{{#operations}} +{{#operation}} + + {{#summary}} + /** + * {{summary}} + {{#notes}} + * {{.}} + {{/notes}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + {{/summary}} + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + @{{httpMethod}} + {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} +{{#hasConsumes}} + @Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }) +{{/hasConsumes}} +{{#hasProduces}} + @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }) +{{/hasProduces}} + {{{returnType}}}{{^returnType}}void{{/returnType}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; +{{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/apiOperation.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/apiOperation.mustache new file mode 100644 index 00000000000..97adb0ea285 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/apiOperation.mustache @@ -0,0 +1,28 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import io.swagger.v3.oas.models.Operation; + +public class ApiOperation { + private final String path; + private final String method; + private final Operation operation; + + public ApiOperation(String path, String method, Operation operation) { + this.path = path; + this.method = method; + this.operation = operation; + } + + public Operation getOperation() { + return operation; + } + + public String getPath() { + return path; + } + + public String getMethod() { + return method; + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_doc.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_doc.mustache new file mode 100644 index 00000000000..ba9757d1edb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_doc.mustache @@ -0,0 +1,55 @@ +# {{classname}}{{#description}} + +{{.}}{{/description}} + +All URIs are relative to *{{basePath}}* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} | +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +## {{operationId}} + +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) + +{{summary}}{{#notes}} + +{{.}}{{/notes}} + +### Parameters + +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + +- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} +- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_exception.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_exception.mustache new file mode 100644 index 00000000000..d9fb5ee91d8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_exception.mustache @@ -0,0 +1,19 @@ +{{>licenseInfo}} +package {{apiPackage}}; + +import {{rootJavaEEPackage}}.ws.rs.core.Response; + +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private final Response response; + + public ApiException(Response response) { + super("Api response has status code " + response.getStatus()); + this.response = response; + } + + public Response getResponse() { + return this.response; + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_exception_mapper.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_exception_mapper.mustache new file mode 100644 index 00000000000..ac4db62e8b8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_exception_mapper.mustache @@ -0,0 +1,22 @@ +{{>licenseInfo}} +package {{apiPackage}}; + +import {{rootJavaEEPackage}}.ws.rs.core.MultivaluedMap; +import {{rootJavaEEPackage}}.ws.rs.core.Response; +import {{rootJavaEEPackage}}.ws.rs.ext.Provider; + +import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; + +@Provider +public class ApiExceptionMapper implements ResponseExceptionMapper { + + @Override + public boolean handles(int status, MultivaluedMap headers) { + return status >= 400; + } + + @Override + public ApiException toThrowable(Response response) { + return new ApiException(response); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_test.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_test.mustache new file mode 100644 index 00000000000..cbe676a88ba --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/api_test.mustache @@ -0,0 +1,64 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +{{^fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +{{/fullJavaUtil}} + +/** + {{#appName}} + * {{{.}}} Test + * + {{/appName}} + * API tests for {{classname}} + */ +public class {{classname}}Test { + + private static {{classname}} client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build({{classname}}.class); + } + + {{#operations}}{{#operation}} + /** + {{#summary}} + * {{summary}} + * + {{#notes}} + * {{.}} + * + {{/notes}} + {{/summary}} + * @throws ApiException + * if the Api call fails + */ + @Test + public void {{operationId}}Test() throws Exception { + {{#allParams}} + {{/allParams}} + //{{#returnType}}{{{.}}} response = {{/returnType}}client.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + //{{#returnType}}assertNotNull(response);{{/returnType}} + } + {{/operation}}{{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/auth/ApiKeyAuth.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/auth/ApiKeyAuth.mustache new file mode 100644 index 00000000000..991ae235003 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/auth/ApiKeyAuth.mustache @@ -0,0 +1,66 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; + +import java.util.Map; +import java.util.List; + +{{>generatedAnnotation}} +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/auth/HttpBasicAuth.mustache new file mode 100644 index 00000000000..b5c72de6e7e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/auth/HttpBasicAuth.mustache @@ -0,0 +1,42 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; + +import java.util.Base64; +import java.nio.charset.StandardCharsets; + +import java.util.Map; +import java.util.List; + +{{>generatedAnnotation}} +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/auth/HttpBearerAuth.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/auth/HttpBearerAuth.mustache new file mode 100644 index 00000000000..322281f8716 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/auth/HttpBearerAuth.mustache @@ -0,0 +1,49 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; + +import java.util.Map; +import java.util.List; + +{{>generatedAnnotation}} +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if(bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/bodyParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/bodyParams.mustache new file mode 100644 index 00000000000..c7d1abfe527 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/bodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/cookieParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/cookieParams.mustache new file mode 100644 index 00000000000..fea14348d7f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/cookieParams.mustache @@ -0,0 +1 @@ +{{#isCookieParam}}@CookieParam("{{baseName}}"){{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/enumClass.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/enumClass.mustache new file mode 100644 index 00000000000..d32efebf489 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/enumClass.mustache @@ -0,0 +1,46 @@ +{{#jsonb}} + @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) + @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) +{{/jsonb}} +{{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}} { + + {{#allowableValues}} + {{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} + {{/allowableValues}} + + {{dataType}} value; + + {{datatypeWithEnum}} ({{dataType}} v) { + value = v; + } + + public {{dataType}} value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + {{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { + @Override + public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'");{{/useNullForUnknownEnumValue}} + } + } + + public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> { + @Override + public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + {{/jsonb}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/enumOuterClass.mustache new file mode 100644 index 00000000000..39417c635f8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/enumOuterClass.mustache @@ -0,0 +1,39 @@ +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +{{/jackson}} + +/** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + @Override +{{#jackson}} + @JsonValue +{{/jackson}} + public String toString() { + return String.valueOf(value); + } + +{{#jackson}} + @JsonCreator +{{/jackson}} + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + text + "'");{{/useNullForUnknownEnumValue}} + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/enum_outer_doc.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/enum_outer_doc.mustache new file mode 100644 index 00000000000..20c512aaeae --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/enum_outer_doc.mustache @@ -0,0 +1,7 @@ +# {{classname}} + +## Enum + +{{#allowableValues}}{{#enumVars}} +* `{{name}}` (value: `{{{value}}}`) +{{/enumVars}}{{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/formParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/formParams.mustache new file mode 100644 index 00000000000..fa85e0c8947 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/formParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/generatedAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/generatedAnnotation.mustache new file mode 100644 index 00000000000..356a48872aa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/generatedAnnotation.mustache @@ -0,0 +1 @@ +@{{rootJavaEEPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/headerParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/headerParams.mustache new file mode 100644 index 00000000000..25d690c90ed --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/headerParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/jackson_annotations.mustache new file mode 100644 index 00000000000..ccde126f54e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/jackson_annotations.mustache @@ -0,0 +1,19 @@ +{{! + If this is map and items are nullable, make sure that nulls are included. + To determine what JsonInclude.Include method to use, consider the following: + * If the field is required, always include it, even if it is null. + * Else use custom behaviour, IOW use whatever is defined on the object mapper + }} + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) + @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) + {{#withXml}} + {{^isContainer}} + @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + {{/isContainer}} + {{#isContainer}} + {{#isXmlWrapped}} + // items.xmlName={{items.xmlName}} + @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") + {{/isXmlWrapped}} + {{/isContainer}} + {{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/licenseInfo.mustache new file mode 100644 index 00000000000..be193d0c4fe --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/licenseInfo.mustache @@ -0,0 +1,11 @@ +/** + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/model.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/model.mustache new file mode 100644 index 00000000000..ad4e98b8a45 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/model.mustache @@ -0,0 +1,19 @@ +{{>licenseInfo}} +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} + +{{#models}} +{{#model}} +{{#isEnum}} +{{>enumOuterClass}} +{{/isEnum}} +{{^isEnum}} +{{>pojo}} +{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/modelInnerEnum.mustache new file mode 100644 index 00000000000..a9c99783fd0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/modelInnerEnum.mustache @@ -0,0 +1,95 @@ + /** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ +{{#gson}} + @JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.Adapter.class) +{{/gson}} +{{#jsonb}} + @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) + @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) +{{/jsonb}} +{{#withXml}} + @XmlType(name="{{datatypeWithEnum}}") + @XmlEnum({{dataType}}.class) +{{/withXml}} + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}} + {{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + +{{#jackson}} + @JsonValue +{{/jackson}} + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +{{#jackson}} + @JsonCreator +{{/jackson}} + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.equals(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + } +{{#gson}} + + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { + @Override + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } +{{/gson}} +{{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { + @Override + public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'");{{/useNullForUnknownEnumValue}} + } + } + + public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> { + @Override + public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } +{{/jsonb}} + } diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/model_doc.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/model_doc.mustache new file mode 100644 index 00000000000..9a7fe146a4e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/model_doc.mustache @@ -0,0 +1,4 @@ +{{#models}}{{#model}} + +{{#isEnum}}{{>enum_outer_doc}}{{/isEnum}}{{^isEnum}}{{>pojo_doc}}{{/isEnum}} +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/model_test.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/model_test.mustache new file mode 100644 index 00000000000..92c1e7ee2e3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/model_test.mustache @@ -0,0 +1,49 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import org.junit.jupiter.api.Test; + +{{#fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{/fullJavaUtil}} + +/** + * Model tests for {{classname}} + */ +public class {{classname}}Test { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = new {{classname}}(); + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + @Test + public void test{{classname}}() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + @Test + public void {{name}}Test() { + // TODO: test {{name}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/oneof_interface.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/oneof_interface.mustache new file mode 100644 index 00000000000..02deb483d5f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/oneof_interface.mustache @@ -0,0 +1,6 @@ +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>typeInfoAnnotation}}{{>xmlAnnotation}} +public interface {{classname}} {{#vendorExtensions.x-implements}}{{#-first}}extends {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { + {{#discriminator}} + public {{propertyType}} {{propertyGetter}}(); + {{/discriminator}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/openapi.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/openapi.mustache new file mode 100644 index 00000000000..34fbb53f331 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/openapi.mustache @@ -0,0 +1 @@ +{{{openapi-yaml}}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pathParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pathParams.mustache new file mode 100644 index 00000000000..ba153467a65 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}@PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pojo.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pojo.mustache new file mode 100644 index 00000000000..84115fa7d02 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pojo.mustache @@ -0,0 +1,155 @@ + +{{#jsonb}} +import java.lang.reflect.Type; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.DeserializationContext; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbDeserializer; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.SerializationContext; +import {{rootJavaEEPackage}}.json.stream.JsonGenerator; +import {{rootJavaEEPackage}}.json.stream.JsonParser; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} + +{{#description}} +/** + * {{{.}}} + **/ +{{/description}} +{{>additionalModelTypeAnnotations}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensions.x-implements}}{{#-first}} implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { + {{#vars}}{{#isEnum}}{{^isContainer}} +{{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} +{{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} +{{#description}} + /** + * {{{.}}} + **/ +{{/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}}; +{{/isContainer}} +{{^isContainer}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; +{{/isContainer}} + {{/vars}} +{{#vendorExtensions.x-has-readonly-properties}}{{#jsonb}} + public {{classname}}() { + } + + @JsonbCreator + public {{classname}}( + {{#readOnlyVars}} + @JsonbProperty("{{baseName}}") {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + } + {{/jsonb}}{{/vendorExtensions.x-has-readonly-properties}} + {{#vars}} + /** + {{#description}} + * {{.}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + {{#deprecated}} + * @deprecated + {{/deprecated}} + **/ +{{#deprecated}} + @Deprecated +{{/deprecated}} +{{#vendorExtensions.x-extra-annotation}} + {{{vendorExtensions.x-extra-annotation}}} +{{/vendorExtensions.x-extra-annotation}} + {{#withXml}}{{#isEnum}}{{^isArray}}{{^isMap}}public {{dataType}} {{getter}}() { + if ({{name}} == null) { + return null; + } + return {{name}}.value(); + }{{/isMap}}{{/isArray}}{{/isEnum}}{{/withXml}}{{^withXml}}{{#isEnum}}{{^isArray}}{{^isMap}}public {{datatypeWithEnum}} {{getter}}() { + return {{name}}; + }{{/isMap}}{{/isArray}}{{/isEnum}}{{/withXml}}{{#isEnum}}{{#isArray}}public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + }{{/isArray}}{{/isEnum}}{{#isEnum}}{{#isMap}}public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + }{{/isMap}}{{/isEnum}}{{^isEnum}}public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + }{{/isEnum}} + + {{^isReadOnly}} + /** + * Set {{name}} + **/ + {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + } + + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + return this; + } + {{#isArray}} + + public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + this.{{name}}.add({{name}}Item); + return this; + } + {{/isArray}} + {{#isMap}} + + public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + this.{{name}}.put(key, {{name}}Item); + return this; + } + {{/isMap}} + {{/isReadOnly}} + + {{/vars}} + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} + {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{/vars}}sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pojo_doc.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pojo_doc.mustache new file mode 100644 index 00000000000..bae0bc48cdd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pojo_doc.mustache @@ -0,0 +1,37 @@ +# {{#vendorExtensions.x-is-one-of-interface}}Interface {{/vendorExtensions.x-is-one-of-interface}}{{classname}} + +{{#description}}{{&description}} +{{/description}} +{{^vendorExtensions.x-is-one-of-interface}} + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +{{#vars}}|**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}**{{baseType}}{{#items}}<{{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}**Map<String, {{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}**{{dataType}}**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} | +{{/vars}} +{{#vars}}{{#isEnum}} + + +## Enum: {{datatypeWithEnum}} + +| Name | Value | +|---- | -----|{{#allowableValues}}{{#enumVars}} +| {{name}} | {{value}} |{{/enumVars}}{{/allowableValues}} +{{/isEnum}}{{/vars}} +{{#vendorExtensions.x-implements.0}} + +## Implemented Interfaces + +{{#vendorExtensions.x-implements}} +* {{{.}}} +{{/vendorExtensions.x-implements}} +{{/vendorExtensions.x-implements.0}} +{{/vendorExtensions.x-is-one-of-interface}} +{{#vendorExtensions.x-is-one-of-interface}} +## Implementing Classes + +{{#oneOf}} +* {{{.}}} +{{/oneOf}} +{{/vendorExtensions.x-is-one-of-interface}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pom.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pom.mustache new file mode 100644 index 00000000000..6deab37c810 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pom.mustache @@ -0,0 +1,90 @@ + + 4.0.0 + {{groupId}} + + io.helidon.applications + helidon-mp + {{helidonVersion}} + + + {{artifactId}} + {{artifactId}} + {{artifactVersion}} + {{artifactUrl}} + {{artifactDescription}} + jar + + + + io.helidon.microprofile.rest-client + helidon-microprofile-rest-client + + + io.helidon.microprofile.config + helidon-microprofile-config + + + org.glassfish.jersey.ext.cdi + jersey-cdi1x + + + {{x-helidon-rootJavaEEDepPrefix}}.enterprise + {{x-helidon-rootJavaEEDepPrefix}}.enterprise.cdi-api + + + {{x-helidon-rootJavaEEDepPrefix}}.json + {{x-helidon-rootJavaEEDepPrefix}}.json-api + +{{#jackson}} + + org.glassfish.jersey.media + jersey-media-json-jackson + + + org.openapitools + jackson-databind-nullable + 0.2.2 + +{{/jackson}} +{{#jsonb}} + + org.glassfish.jersey.media + jersey-media-json-binding + + + {{x-helidon-rootJavaEEDepPrefix}}.json.bind + {{x-helidon-rootJavaEEDepPrefix}}.json.bind-api + +{{/jsonb}} + + org.junit.jupiter + junit-jupiter-api + test + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-libs + + + + + org.jboss.jandex + jandex-maven-plugin + + + make-index + + + + + + diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/queryParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/queryParams.mustache new file mode 100644 index 00000000000..4b1a980896f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/queryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}@QueryParam("{{baseName}}") {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{.}}}") {{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/returnTypes.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/returnTypes.mustache new file mode 100644 index 00000000000..32f96a90472 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/returnTypes.mustache @@ -0,0 +1,4 @@ +{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: +}}{{^useGenericResponse}}{{! +}}{{{returnType}}}{{! +}}{{/useGenericResponse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/typeInfoAnnotation.mustache new file mode 100644 index 00000000000..c833321ebfa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/typeInfoAnnotation.mustache @@ -0,0 +1,17 @@ +{{#jackson}} + +@JsonIgnoreProperties( + value = "{{{discriminator.propertyBaseName}}}", // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) +{{#discriminator.mappedModels}} +{{#-first}} +@JsonSubTypes({ +{{/-first}} + @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"), +{{#-last}} +}) +{{/-last}} +{{/discriminator.mappedModels}} +{{/jackson}} From cea7a14b2502ed3195308986bae407457f4f39e6 Mon Sep 17 00:00:00 2001 From: "tim.quinn@oracle.com" Date: Fri, 23 Sep 2022 17:11:14 -0500 Subject: [PATCH 03/18] Add Helidon client generator SE library Java classes and resources Signed-off-by: tim.quinn@oracle.com --- .../client/libraries/se/ApiClient.mustache | 276 ++++++++++++++++++ .../client/libraries/se/ApiResponse.mustache | 34 +++ .../libraries/se/ApiResponseBase.mustache | 36 +++ .../libraries/se/JavaTimeFormatter.mustache | 53 ++++ .../client/libraries/se/Pair.mustache | 45 +++ .../client/libraries/se/README.mustache | 26 ++ .../libraries/se/RFC3339DateFormat.mustache | 46 +++ .../client/libraries/se/ResponseType.mustache | 32 ++ .../client/libraries/se/StringUtil.mustache | 72 +++++ .../se/additionalEnumTypeAnnotations.mustache | 2 + .../additionalModelTypeAnnotations.mustache | 2 + .../client/libraries/se/api.mustache | 43 +++ .../client/libraries/se/apiOperation.mustache | 28 ++ .../client/libraries/se/api_doc.mustache | 108 +++++++ .../client/libraries/se/api_impl.mustache | 182 ++++++++++++ .../client/libraries/se/api_test.mustache | 72 +++++ .../client/libraries/se/bodyParams.mustache | 1 + .../client/libraries/se/cookieParams.mustache | 1 + .../client/libraries/se/enumClass.mustache | 46 +++ .../libraries/se/enumOuterClass.mustache | 39 +++ .../libraries/se/enum_outer_doc.mustache | 7 + .../client/libraries/se/formParams.mustache | 1 + .../libraries/se/generatedAnnotation.mustache | 1 + .../client/libraries/se/headerParams.mustache | 1 + .../libraries/se/jackson_annotations.mustache | 19 ++ .../client/libraries/se/licenseInfo.mustache | 11 + .../client/libraries/se/manifest.mustache | 3 + .../client/libraries/se/maven.yml.mustache | 31 ++ .../client/libraries/se/model.mustache | 19 ++ .../libraries/se/modelInnerEnum.mustache | 95 ++++++ .../client/libraries/se/model_doc.mustache | 4 + .../client/libraries/se/model_test.mustache | 49 ++++ .../libraries/se/oneof_interface.mustache | 6 + .../client/libraries/se/openapi.mustache | 1 + .../se/operationResponseSig.mustache | 1 + .../se/operationResponseTypeDecl.mustache | 1 + .../client/libraries/se/pathParams.mustache | 1 + .../client/libraries/se/pojo.mustache | 155 ++++++++++ .../client/libraries/se/pojo_doc.mustache | 37 +++ .../client/libraries/se/pom.mustache | 83 ++++++ .../client/libraries/se/queryParams.mustache | 1 + .../client/libraries/se/returnTypes.mustache | 4 + .../libraries/se/typeInfoAnnotation.mustache | 17 ++ 43 files changed, 1692 insertions(+) create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ApiClient.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ApiResponse.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ApiResponseBase.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/JavaTimeFormatter.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/Pair.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/RFC3339DateFormat.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ResponseType.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/StringUtil.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/additionalEnumTypeAnnotations.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/additionalModelTypeAnnotations.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/apiOperation.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_impl.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/bodyParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/cookieParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/enumClass.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/enumOuterClass.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/enum_outer_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/formParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/generatedAnnotation.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/headerParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/jackson_annotations.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/licenseInfo.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/manifest.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/maven.yml.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/modelInnerEnum.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/model_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/model_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/oneof_interface.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/openapi.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/operationResponseSig.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/operationResponseTypeDecl.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pathParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pojo.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pojo_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pom.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/queryParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/returnTypes.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/typeInfoAnnotation.mustache diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ApiClient.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ApiClient.mustache new file mode 100644 index 00000000000..1ca0223fb45 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ApiClient.mustache @@ -0,0 +1,276 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +{{#jsonb}}import {{rootJavaEEPackage}}.json.bind.JsonbBuilder; +import {{rootJavaEEPackage}}.json.bind.JsonbConfig; +{{/jsonb}} +{{#jackson}}import com.fasterxml.jackson.databind.ObjectMapper; +{{/jackson}} +{{#openApiNullable}} +{{#jackson}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/jackson}} +{{/openApiNullable}} + +import io.helidon.config.Config; +{{#jsonb}} +import io.helidon.media.jsonb.JsonbSupport; +{{/jsonb}} +{{#jackson}} +import io.helidon.media.jackson.JacksonSupport; +{{/jackson}} +import io.helidon.webclient.WebClient; + +import java.net.URI; +import java.net.URLEncoder; +import java.time.Duration; +{{#java8}} +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +{{/java8}} +import java.util.Collection; +import java.util.Collections; +import java.util.List; +{{#jsonb}} +import java.util.Map; +{{/jsonb}} +import java.util.StringJoiner; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Configuration and utility class for API clients. + *

+ * Use the {@link ApiClient.Builder} class to prepare and ultimately create the {@code ApiClient} instance. + *

+ */ +public class ApiClient { + + private final WebClient webClient; + + /** + * @return a {@code Builder} for an {@code ApiClient} + */ + public static ApiClient.Builder builder() { + return new Builder(); + } + + /** + * URL encode a string in the UTF-8 encoding. + * + * @param s String to encode. + * @return URL-encoded representation of the input string. + */ + public static String urlEncode(String s) { + return URLEncoder.encode(s, UTF_8); + } + + /** + * Convert a URL query name/value parameter to a list of encoded {@link Pair} + * objects. + * + *

The value can be null, in which case an empty list is returned.

+ * + * @param name The query name parameter. + * @param value The query value, which may not be a collection but may be + * null. + * @return A singleton list of the {@link Pair} objects representing the input + * parameters, which is encoded for use in a URL. If the value is null, an + * empty list is returned. + */ + public static List parameterToPairs(String name, Object value) { + if (name == null || name.isEmpty() || value == null) { + return Collections.emptyList(); + } + return Collections.singletonList(new Pair(urlEncode(name), urlEncode(valueToString(value)))); + } + + /** + * Convert a URL query name/collection parameter to a list of encoded + * {@link Pair} objects. + * + * @param collectionFormat The swagger collectionFormat string (csv, tsv, etc). + * @param name The query name parameter. + * @param values A collection of values for the given query name, which may be + * null. + * @return A list of {@link Pair} objects representing the input parameters, + * which is encoded for use in a URL. If the values collection is null, an + * empty list is returned. + */ + public static List parameterToPairs( + String collectionFormat, String name, Collection values) { + if (name == null || name.isEmpty() || values == null || values.isEmpty()) { + return Collections.emptyList(); + } + + // get the collection format (default: csv) + String format = collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat; + + // create the params based on the collection format + if ("multi".equals(format)) { + return values.stream() + .map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value)))) + .collect(Collectors.toList()); + } + + String delimiter; + switch(format) { + case "csv": + delimiter = urlEncode(","); + break; + case "ssv": + delimiter = urlEncode(" "); + break; + case "tsv": + delimiter = urlEncode("\t"); + break; + case "pipes": + delimiter = urlEncode("|"); + break; + default: + throw new IllegalArgumentException("Illegal collection format: " + collectionFormat); + } + + StringJoiner joiner = new StringJoiner(delimiter); + for (Object value : values) { + joiner.add(urlEncode(valueToString(value))); + } + + return Collections.singletonList(new Pair(urlEncode(name), joiner.toString())); + } + + private ApiClient(Builder builder) { + webClient = builder.webClientBuilder().build(); + } + + /** + * Get the {@link WebClient} prepared by the builder of this {@code ApiClient}. + * + * @return the WebClient + */ + public WebClient webClient() { + return webClient; + } + + private static String valueToString(Object value) { + if (value == null) { + return ""; + } + {{#java8}} + if (value instanceof OffsetDateTime) { + return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + {{/java8}} + return value.toString(); + } + + /** + * Builder for creating a new {@code ApiClient} instance. + * + *

+ * The builder accepts a {@link WebClient.Builder} via the {@code webClientBuilder} method but will provide a default one + * using available configuration (the {@code client} node) and the base URI set in the OpenAPI document. + *

+ */ + public static class Builder { + + private WebClient.Builder webClientBuilder; + private Config clientConfig; + {{#jsonb}} + private JsonbConfig jsonbConfig; + {{/jsonb}} + {{#jackson}} + private ObjectMapper objectMapper; + {{/jackson}} + + public ApiClient build() { + return new ApiClient(this); + } + + /** + * Sets the {@code WebClient.Builder} which the {@code ApiClient.Builder} uses. Any previous setting is discarded. + * + * @param webClientBuilder the {@code WebClient.Builder} to be used going forward + * @return the updated builder + */ + public Builder webClientBuilder(WebClient.Builder webClientBuilder) { + this.webClientBuilder = webClientBuilder; + return this; + } + + /** + * Sets the client {@code Config} which the {@code ApiClient.Builder} uses in preparing a default {@code WebClient.Builder}. + * The builder ignores this setting if you provide your own {@code WebClient.Builder} by invoking the + * {@code webClientBuilder} method. + * + * @param clientConfig the {@code Config} node containing client settings + * @return the updated builder + */ + public Builder clientConfig(Config clientConfig) { + this.clientConfig = clientConfig; + return this; + } + + /** + * @return the previously-stored web client builder or, if none, a default one using the provided or defaulted + * client configuration + */ + public WebClient.Builder webClientBuilder() { + if (webClientBuilder == null) { + webClientBuilder = defaultWebClientBuilder(); + } + return webClientBuilder; + } + + {{#jsonb}} + /** + * Stores the JSON-B configuration the builder uses in preparing the {@code WebClient}. + * + * @param jsonbConfig the JSON-B config to use in all API invocations via the built {@code ApiClient} + * @return the updated builder + */ + public Builder jsonbConfig(JsonbConfig jsonbConfig) { + this.jsonbConfig = jsonbConfig; + return this; + } + {{/jsonb}} + {{#jackson}} + /** + * Stores the Jackson {@code ObjectMapper} the builder uses in preparing the {@code WebClient}. + * + * @param objectMapper the Jackson object mapper to use in all API invocations via the built {@code ApiClient} + * @return the updated builder + */ + public Builder objectMapper(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + return this; + } + {{/jackson}} + + private WebClient.Builder defaultWebClientBuilder() { + WebClient.Builder defaultWebClientBuilder = WebClient.builder() + .baseUri("{{basePath}}") + .config(clientConfig()); + {{#jsonb}} + defaultWebClientBuilder.addMediaSupport(jsonbConfig == null + ? JsonbSupport.create() + : JsonbSupport.create(jsonbConfig)); + {{/jsonb}} + {{#jackson}} + defaultWebClientBuilder.addMediaSupport(objectMapper == null + ? JacksonSupport.create() + : JacksonSupport.create(objectMapper)); + {{/jackson}} + return defaultWebClientBuilder; + } + + private Config clientConfig() { + if (clientConfig == null) { + clientConfig = Config.create().get("client"); + } + return clientConfig; + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ApiResponse.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ApiResponse.mustache new file mode 100644 index 00000000000..b651e0b4f25 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ApiResponse.mustache @@ -0,0 +1,34 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import java.util.concurrent.ExecutionException; + +import io.helidon.common.GenericType; +import io.helidon.common.reactive.Single; +import io.helidon.webclient.WebClientResponse; + +{{#appName}} +/** + * Generic-typed response. + * + * Return type for generated API methods. + * + * @param type of the return value from the generated API method + */ +{{/appName}} +public interface ApiResponse { + + static ApiResponse create(GenericType responseType, Single webClientResponse) { + return new ApiResponseBase<>(responseType, webClientResponse); + } + + /** + * @returns reactive access to the {@link WebClientResponse} describing the response from the server + */ + Single webClientResponse(); + + /** + * @return reactive access to the value returned in the response from the server + */ + Single result() throws ExecutionException, InterruptedException; +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ApiResponseBase.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ApiResponseBase.mustache new file mode 100644 index 00000000000..31228f0dc3b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ApiResponseBase.mustache @@ -0,0 +1,36 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import java.util.concurrent.ExecutionException; + +import io.helidon.common.GenericType; +import io.helidon.common.reactive.Single; +import io.helidon.webclient.WebClientResponse; + +{{#appName}} +/** + * Implementation of a generic-typed response. + * + * @param type of the return value from the generated API method + */ +{{/appName}} +class ApiResponseBase implements ApiResponse { + + private final Single webClientResponse; + private final GenericType responseType; + + protected ApiResponseBase(GenericType responseType, Single webClientResponse) { + this.webClientResponse = webClientResponse; + this.responseType = responseType; + } + + @Override + public Single webClientResponse() { + return webClientResponse; + } + + @Override + public Single result() throws ExecutionException, InterruptedException { + return webClientResponse.get().content().as(responseType); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/JavaTimeFormatter.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/JavaTimeFormatter.mustache new file mode 100644 index 00000000000..f3fb34e559c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/JavaTimeFormatter.mustache @@ -0,0 +1,53 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +{{>generatedAnnotation}} +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/Pair.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/Pair.mustache new file mode 100644 index 00000000000..e20dacb7742 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/Pair.mustache @@ -0,0 +1,45 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/README.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/README.mustache new file mode 100644 index 00000000000..eab4ac23ff7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/README.mustache @@ -0,0 +1,26 @@ +# {{appName}} + +{{#appDescriptionWithNewLines}} +{{{.}}} + +{{/appDescriptionWithNewLines}} + +## Overview +This project was generated using the Helidon OpenAPI Generator. + +The generated classes use the programming model from the Helidon WebClient implementation, primarily the `WebClient` interface and its +`WebClient.Builder` class. Refer to the Helidon WebClient documentation for complete information about them. + +## Using the Generated Classes and Interfaces +The generated `ApiClient` class wraps a `WebClient` instance. Similarly, the `ApiClient.Builder` class wraps the `WebClient.Builder` class. + +The generated `xxxApi` interfaces and `xxxApiImpl` classes make it very simple for your code to send requests (with input parameters) to the remote service which the OpenAPI document describes and to process the response (with output values) from the remote service. + +To use the generated API, your code performs the following steps. + +1. Create an instance of the `ApiClient` using its `Builder`. +2. Create an instance of a `xxxApi` it wants to access, typically by invoking `xxxApiImpl.create(ApiClient)` and passing the `ApiClient` instance just created. +3. Invoke any of the `public` methods on the `xxxApi` instance, passing the input parameters and saving the returned `Single` object. +4. Invoke methods on the returned `Single` to process the response and any output from it. + +Browse the methods and JavaDoc on the generated classes for more information. diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/RFC3339DateFormat.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/RFC3339DateFormat.mustache new file mode 100644 index 00000000000..311616a4ef1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/RFC3339DateFormat.mustache @@ -0,0 +1,46 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ResponseType.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ResponseType.mustache new file mode 100644 index 00000000000..d730fccb6c3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/ResponseType.mustache @@ -0,0 +1,32 @@ +{{>licenseInfo}} +package {{apiPackage}}; + +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; + +import io.helidon.common.GenericType; + +class ResponseType { + + static GenericType create(Type rawType, Type... typeParams) { + return typeParams.length == 0 + ? GenericType.create(rawType) + : GenericType.create(new ParameterizedType() { + + @Override + public Type[] getActualTypeArguments() { + return typeParams; + } + + @Override + public Type getRawType() { + return rawType; + } + + @Override + public Type getOwnerType() { + return null; + } + }); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/StringUtil.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/StringUtil.mustache new file mode 100644 index 00000000000..e3d5d6e9088 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/StringUtil.mustache @@ -0,0 +1,72 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import java.util.Collection; +import java.util.Iterator; + +{{>generatedAnnotation}} +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/additionalEnumTypeAnnotations.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/additionalEnumTypeAnnotations.mustache new file mode 100644 index 00000000000..aa524798b42 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/additionalEnumTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalEnumTypeAnnotations}}{{{.}}} +{{/additionalEnumTypeAnnotations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/additionalModelTypeAnnotations.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/additionalModelTypeAnnotations.mustache new file mode 100644 index 00000000000..f4871c02cc2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/additionalModelTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalModelTypeAnnotations}}{{{.}}} +{{/additionalModelTypeAnnotations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api.mustache new file mode 100644 index 00000000000..f0d7ee5618a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api.mustache @@ -0,0 +1,43 @@ +{{>licenseInfo}} +package {{package}}; + +import {{invokerPackage}}.ApiResponse; +{{#imports}}import {{import}}; +{{/imports}} + +{{#appName}} +/** + * {{{appName}}} + * + {{#appDescription}} + *

{{{.}}} + {{/appDescription}} + */ +{{/appName}} +public interface {{classname}} { + +{{#operations}} +{{#operation}} + {{#summary}} + /** + * {{summary}} + {{#notes}} + * {{.}} + {{/notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + {{/allParams}} + * @return {@code {{>operationResponseSig}}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + {{/summary}} + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + {{>operationResponseSig}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + +{{/operation}} +{{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/apiOperation.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/apiOperation.mustache new file mode 100644 index 00000000000..97adb0ea285 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/apiOperation.mustache @@ -0,0 +1,28 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import io.swagger.v3.oas.models.Operation; + +public class ApiOperation { + private final String path; + private final String method; + private final Operation operation; + + public ApiOperation(String path, String method, Operation operation) { + this.path = path; + this.method = method; + this.operation = operation; + } + + public Operation getOperation() { + return operation; + } + + public String getPath() { + return path; + } + + public String getMethod() { + return method; + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_doc.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_doc.mustache new file mode 100644 index 00000000000..3d3203957e6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_doc.mustache @@ -0,0 +1,108 @@ +# {{classname}}{{#description}} + +{{.}}{{/description}} + +All URIs are relative to *{{basePath}}* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} | +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +## {{operationId}} + +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) + +{{summary}}{{#notes}} + +{{.}}{{/notes}} + +### Example + +```java +// Import classes: +import {{{invokerPackage}}}.ApiClient; +import {{{invokerPackage}}}.ApiException; +import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} +import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} +import {{{invokerPackage}}}.models.*; +import {{{package}}}.{{{classname}}}; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}} + {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + System.out.println(result);{{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + +- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} +- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_impl.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_impl.mustache new file mode 100644 index 00000000000..4da8503056b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_impl.mustache @@ -0,0 +1,182 @@ +{{>licenseInfo}} +package {{package}}; + +import java.util.Objects; +import {{invokerPackage}}.ApiResponse; + +{{#jsonb}} +import {{rootJavaEEPackage}}.json.bind.JsonbBuilder; +{{/jsonb}} +{{#jackson}} +import com.fasterxml.jackson.databind.ObjectMapper; +{{/jackson}} + +import io.helidon.common.GenericType; +import io.helidon.common.http.MediaType; +import io.helidon.common.reactive.Single; +import io.helidon.config.Config; +import io.helidon.media.common.MediaSupport; +{{#jsonb}}import io.helidon.media.jsonb.JsonbSupport;{{/jsonb}} +{{#jackson}}import io.helidon.media.jackson.JacksonSupport;{{/jackson}} +import io.helidon.webclient.WebClientRequestBuilder; +import io.helidon.webclient.WebClientResponse; + +import {{invokerPackage}}.ApiClient; + +{{#x-helidon-implImports}}import {{import}}; +{{/x-helidon-implImports}} + +{{#appName}} +/** + * {{{appName}}} + * + {{#appDescription}} + *

{{{.}}} + {{/appDescription}} + */ +{{/appName}} +public class {{classname}}Impl implements {{classname}} { + + private final ApiClient apiClient; + +{{#operations}} + {{#operation}} + protected static final GenericType<{{>operationResponseTypeDecl}}> RESPONSE_TYPE_{{operationId}} = ResponseType.create({{#isArray}}List.class, {{/isArray}}{{#isMap}}Map.class, String.class, {{/isMap}}{{#returnBaseType}}{{returnBaseType}}{{/returnBaseType}}{{^returnBaseType}}Void{{/returnBaseType}}.class); + {{/operation}} +{{/operations}} + + /** + * Creates a new instance of {{classname}}Impl initialized with the specified {@link ApiClient}. + * + */ + public static {{classname}}Impl create(ApiClient apiClient) { + return new {{classname}}Impl(apiClient); + } + + protected {{classname}}Impl(ApiClient apiClient) { + this.apiClient = apiClient; + } + +{{#operations}} +{{#operation}} + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + @Override + public {{>operationResponseSig}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { + {{#requiredParams}} + Objects.requireNonNull({{paramName}}, "Required parameter '{{paramName}}' not specified"); + {{/requiredParams}} + WebClientRequestBuilder webClientRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + return {{operationId}}Submit(webClientRequestBuilder{{#allParams}}, {{paramName}}{{/allParams}}); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the {{operationId}} operation. + * Optional customization point for subclasses. + * + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + {{/allParams}} + * @return WebClientRequestBuilder for {{operationId}} + */ + protected WebClientRequestBuilder {{operationId}}RequestBuilder({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("{{httpMethod}}"); + + {{#hasQueryParams}} + {{javaUtilPrefix}}List queryParams = new {{javaUtilPrefix}}ArrayList<>(); + {{#queryParams}} + {{#collectionFormat}} + queryParams.addAll(ApiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); + {{/collectionFormat}} + {{^collectionFormat}} + {{#isDeepObject}} + if ({{paramName}} != null) { + {{#items.vars}} + queryParams.addAll(ApiClient.parameterToPairs({{#isArray}}"csv", {{/isArray}}"{{baseName}}", {{paramName}}.{{getter}}())); + {{/items.vars}} + } + {{/isDeepObject}} + {{^isDeepObject}} + {{#isExplode}} + {{#hasVars}} + {{#vars}} + queryParams.addAll(ApiClent.parameterToPairs("{{baseName}}", {{paramName}}.{{getter}}())); + {{/vars}} + {{/hasVars}} + {{^hasVars}} + queryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}})); + {{/hasVars}} + {{/isExplode}} + {{^isExplode}} + queryParams.addAll(ApiClient.parameterToPairs("{{baseName}}", {{paramName}})); + {{/isExplode}} + {{/isDeepObject}} + {{/collectionFormat}} + {{/queryParams}} + queryParams.forEach(p -> webClientRequestBuilder.queryParam(p.getName(), p.getValue())); + + {{/hasQueryParams}} + {{#hasHeaderParams}} + WebClientRequestHeaders headers = webClientRequestBuilder.headers(); + {{#headerParams}} + if ({{paramName}} != null) { + headers.put("{{baseName}}", {{paramName}}{{^isString}}.toString(){{/isString}}); + } + {{/headerParams}} + + {{/hasHeaderParams}} + {{#hasCookieParams}} + String cookies = new StringJoiner("; ") + {{#cookieParams}} + .add("{{{baseName}}}=" + {{{paramName}}}) + {{/cookieParams}} + .toString(); + webClientRequestBuilder.headers().add("Cookie", cookies); + + {{/hasCookieParams}} + {{#hasPathParams}} + String path = "{{{path}}}" + {{! Switch delimiters from double braces to <% and %> for baseName so we can use curly braces in the string as literals and not have mustache + interpret them, then switch back. }} + {{#pathParams}} + .replace({{=<% %>=}}"{<%baseName%>}"<%={{ }}=%>, ApiClient.urlEncode({{{paramName}}}{{^isString}}.toString(){{/isString}})){{/pathParams}}; + {{/hasPathParams}} + webClientRequestBuilder.path({{#hasPathParams}}path{{/hasPathParams}}{{^hasPathParams}}"{{{path}}}"{{/hasPathParams}}); + {{#bodyParam}} + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + {{/bodyParam}} + {{#hasFormParams}} + webClientRequestBuilder.contentType(MediaType.APPLICATION_FORM_URLENCODED); + {{/hasFormParams}} + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the {{operationId}} operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} + {{/allParams}} + * @return {@code {{>operationResponseSig}}} for the submitted request + */ + protected {{>operationResponseSig}} {{operationId}}Submit(WebClientRequestBuilder webClientRequestBuilder{{#allParams}}, {{{dataType}}} {{paramName}}{{/allParams}}) { + {{#hasFormParams}} + String formParams = new StringJoiner("&") + {{#formParams}} + .add("{{{baseName}}}=" + {{paramName}}) + {{/formParams}} + .toString(); + {{/hasFormParams}} + Single webClientResponse = webClientRequestBuilder.submit({{#bodyParam}}{{paramName}}{{/bodyParam}}{{#hasFormParams}}formParams{{/hasFormParams}}); + return ApiResponse.create(RESPONSE_TYPE_{{operationId}}, webClientResponse); + } + +{{/operation}} +{{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_test.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_test.mustache new file mode 100644 index 00000000000..de7bb1db80e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_test.mustache @@ -0,0 +1,72 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.ApiResponse; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +{{^fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{/fullJavaUtil}} + +import io.helidon.common.reactive.Single; +import io.helidon.webclient.WebClientResponse; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +/** + * {{#appName}} + * {{{.}}} Test + * + * {{/appName}} + * API tests for {{classname}} + */ +public class {{classname}}Test { + + private static ApiClient apiClient; + private static {{classname}} api; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() { + apiClient = ApiClient.builder().build(); + api = {{classname}}Impl.create(apiClient); + } + + {{#operations}} + {{#operation}} + /** + * {{summary}} + {{#notes}} + * {{.}} + {{/notes}} + */ + @Test + public void {{operationId}}Test() { + {{#allParams}} + // TODO - assign values to the input arguments. + {{{dataType}}} {{paramName}} = null; + {{/allParams}} + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse<{{>operationResponseTypeDecl}}> response = api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + {{/operation}} + {{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/bodyParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/bodyParams.mustache new file mode 100644 index 00000000000..c7d1abfe527 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/bodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/cookieParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/cookieParams.mustache new file mode 100644 index 00000000000..fea14348d7f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/cookieParams.mustache @@ -0,0 +1 @@ +{{#isCookieParam}}@CookieParam("{{baseName}}"){{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/enumClass.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/enumClass.mustache new file mode 100644 index 00000000000..d32efebf489 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/enumClass.mustache @@ -0,0 +1,46 @@ +{{#jsonb}} + @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) + @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) +{{/jsonb}} +{{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}} { + + {{#allowableValues}} + {{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} + {{/allowableValues}} + + {{dataType}} value; + + {{datatypeWithEnum}} ({{dataType}} v) { + value = v; + } + + public {{dataType}} value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + {{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { + @Override + public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'");{{/useNullForUnknownEnumValue}} + } + } + + public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> { + @Override + public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + {{/jsonb}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/enumOuterClass.mustache new file mode 100644 index 00000000000..39417c635f8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/enumOuterClass.mustache @@ -0,0 +1,39 @@ +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +{{/jackson}} + +/** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { + {{#allowableValues}}{{#enumVars}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + @Override +{{#jackson}} + @JsonValue +{{/jackson}} + public String toString() { + return String.valueOf(value); + } + +{{#jackson}} + @JsonCreator +{{/jackson}} + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + text + "'");{{/useNullForUnknownEnumValue}} + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/enum_outer_doc.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/enum_outer_doc.mustache new file mode 100644 index 00000000000..20c512aaeae --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/enum_outer_doc.mustache @@ -0,0 +1,7 @@ +# {{classname}} + +## Enum + +{{#allowableValues}}{{#enumVars}} +* `{{name}}` (value: `{{{value}}}`) +{{/enumVars}}{{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/formParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/formParams.mustache new file mode 100644 index 00000000000..fa85e0c8947 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/formParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/generatedAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/generatedAnnotation.mustache new file mode 100644 index 00000000000..356a48872aa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/generatedAnnotation.mustache @@ -0,0 +1 @@ +@{{rootJavaEEPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/headerParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/headerParams.mustache new file mode 100644 index 00000000000..25d690c90ed --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/headerParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/jackson_annotations.mustache new file mode 100644 index 00000000000..ccde126f54e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/jackson_annotations.mustache @@ -0,0 +1,19 @@ +{{! + If this is map and items are nullable, make sure that nulls are included. + To determine what JsonInclude.Include method to use, consider the following: + * If the field is required, always include it, even if it is null. + * Else use custom behaviour, IOW use whatever is defined on the object mapper + }} + @JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}) + @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) + {{#withXml}} + {{^isContainer}} + @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + {{/isContainer}} + {{#isContainer}} + {{#isXmlWrapped}} + // items.xmlName={{items.xmlName}} + @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") + {{/isXmlWrapped}} + {{/isContainer}} + {{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/licenseInfo.mustache new file mode 100644 index 00000000000..be193d0c4fe --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/licenseInfo.mustache @@ -0,0 +1,11 @@ +/** + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/manifest.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/manifest.mustache new file mode 100644 index 00000000000..f44bd07d0a0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/manifest.mustache @@ -0,0 +1,3 @@ + + + diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/maven.yml.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/maven.yml.mustache new file mode 100644 index 00000000000..f3c4733c306 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/maven.yml.mustache @@ -0,0 +1,31 @@ +# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven +# +# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) + +name: Java CI with Maven + +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] + +jobs: + build: + name: Build {{{appName}}} + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8' ] + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + {{=< >=}} + java-version: ${{ matrix.java }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --no-transfer-progress --file pom.xml diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/model.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/model.mustache new file mode 100644 index 00000000000..ad4e98b8a45 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/model.mustache @@ -0,0 +1,19 @@ +{{>licenseInfo}} +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} + +{{#models}} +{{#model}} +{{#isEnum}} +{{>enumOuterClass}} +{{/isEnum}} +{{^isEnum}} +{{>pojo}} +{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/modelInnerEnum.mustache new file mode 100644 index 00000000000..a9c99783fd0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/modelInnerEnum.mustache @@ -0,0 +1,95 @@ + /** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ +{{#gson}} + @JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.Adapter.class) +{{/gson}} +{{#jsonb}} + @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) + @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) +{{/jsonb}} +{{#withXml}} + @XmlType(name="{{datatypeWithEnum}}") + @XmlEnum({{dataType}}.class) +{{/withXml}} + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}} + {{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + +{{#jackson}} + @JsonValue +{{/jackson}} + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +{{#jackson}} + @JsonCreator +{{/jackson}} + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.equals(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + } +{{#gson}} + + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { + @Override + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isInteger}}{{/isNumber}}; + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + } + } +{{/gson}} +{{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { + @Override + public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'");{{/useNullForUnknownEnumValue}} + } + } + + public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> { + @Override + public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } +{{/jsonb}} + } diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/model_doc.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/model_doc.mustache new file mode 100644 index 00000000000..9a7fe146a4e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/model_doc.mustache @@ -0,0 +1,4 @@ +{{#models}}{{#model}} + +{{#isEnum}}{{>enum_outer_doc}}{{/isEnum}}{{^isEnum}}{{>pojo_doc}}{{/isEnum}} +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/model_test.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/model_test.mustache new file mode 100644 index 00000000000..92c1e7ee2e3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/model_test.mustache @@ -0,0 +1,49 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import org.junit.jupiter.api.Test; + +{{#fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{/fullJavaUtil}} + +/** + * Model tests for {{classname}} + */ +public class {{classname}}Test { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = new {{classname}}(); + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + @Test + public void test{{classname}}() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + @Test + public void {{name}}Test() { + // TODO: test {{name}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/oneof_interface.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/oneof_interface.mustache new file mode 100644 index 00000000000..02deb483d5f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/oneof_interface.mustache @@ -0,0 +1,6 @@ +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>typeInfoAnnotation}}{{>xmlAnnotation}} +public interface {{classname}} {{#vendorExtensions.x-implements}}{{#-first}}extends {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { + {{#discriminator}} + public {{propertyType}} {{propertyGetter}}(); + {{/discriminator}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/openapi.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/openapi.mustache new file mode 100644 index 00000000000..34fbb53f331 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/openapi.mustache @@ -0,0 +1 @@ +{{{openapi-yaml}}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/operationResponseSig.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/operationResponseSig.mustache new file mode 100644 index 00000000000..499dc7ede7a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/operationResponseSig.mustache @@ -0,0 +1 @@ +ApiResponse<{{>operationResponseTypeDecl}}> \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/operationResponseTypeDecl.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/operationResponseTypeDecl.mustache new file mode 100644 index 00000000000..47f72007025 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/operationResponseTypeDecl.mustache @@ -0,0 +1 @@ +{{#returnType}}{{#isArray}}List<{{/isArray}}{{#isMap}}Map{{/isArray}}{{#isMap}}>{{/isMap}}{{/returnType}}{{^returnType}}Void{{/returnType}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pathParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pathParams.mustache new file mode 100644 index 00000000000..ba153467a65 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}@PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pojo.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pojo.mustache new file mode 100644 index 00000000000..84115fa7d02 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pojo.mustache @@ -0,0 +1,155 @@ + +{{#jsonb}} +import java.lang.reflect.Type; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.DeserializationContext; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbDeserializer; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.SerializationContext; +import {{rootJavaEEPackage}}.json.stream.JsonGenerator; +import {{rootJavaEEPackage}}.json.stream.JsonParser; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} + +{{#description}} +/** + * {{{.}}} + **/ +{{/description}} +{{>additionalModelTypeAnnotations}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensions.x-implements}}{{#-first}} implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { + {{#vars}}{{#isEnum}}{{^isContainer}} +{{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} +{{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} +{{#description}} + /** + * {{{.}}} + **/ +{{/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}}; +{{/isContainer}} +{{^isContainer}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; +{{/isContainer}} + {{/vars}} +{{#vendorExtensions.x-has-readonly-properties}}{{#jsonb}} + public {{classname}}() { + } + + @JsonbCreator + public {{classname}}( + {{#readOnlyVars}} + @JsonbProperty("{{baseName}}") {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + } + {{/jsonb}}{{/vendorExtensions.x-has-readonly-properties}} + {{#vars}} + /** + {{#description}} + * {{.}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + {{#deprecated}} + * @deprecated + {{/deprecated}} + **/ +{{#deprecated}} + @Deprecated +{{/deprecated}} +{{#vendorExtensions.x-extra-annotation}} + {{{vendorExtensions.x-extra-annotation}}} +{{/vendorExtensions.x-extra-annotation}} + {{#withXml}}{{#isEnum}}{{^isArray}}{{^isMap}}public {{dataType}} {{getter}}() { + if ({{name}} == null) { + return null; + } + return {{name}}.value(); + }{{/isMap}}{{/isArray}}{{/isEnum}}{{/withXml}}{{^withXml}}{{#isEnum}}{{^isArray}}{{^isMap}}public {{datatypeWithEnum}} {{getter}}() { + return {{name}}; + }{{/isMap}}{{/isArray}}{{/isEnum}}{{/withXml}}{{#isEnum}}{{#isArray}}public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + }{{/isArray}}{{/isEnum}}{{#isEnum}}{{#isMap}}public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + }{{/isMap}}{{/isEnum}}{{^isEnum}}public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + }{{/isEnum}} + + {{^isReadOnly}} + /** + * Set {{name}} + **/ + {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + } + + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + return this; + } + {{#isArray}} + + public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + this.{{name}}.add({{name}}Item); + return this; + } + {{/isArray}} + {{#isMap}} + + public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + this.{{name}}.put(key, {{name}}Item); + return this; + } + {{/isMap}} + {{/isReadOnly}} + + {{/vars}} + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} + {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{/vars}}sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pojo_doc.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pojo_doc.mustache new file mode 100644 index 00000000000..bae0bc48cdd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pojo_doc.mustache @@ -0,0 +1,37 @@ +# {{#vendorExtensions.x-is-one-of-interface}}Interface {{/vendorExtensions.x-is-one-of-interface}}{{classname}} + +{{#description}}{{&description}} +{{/description}} +{{^vendorExtensions.x-is-one-of-interface}} + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +{{#vars}}|**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}**{{baseType}}{{#items}}<{{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}**Map<String, {{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}**{{dataType}}**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} | +{{/vars}} +{{#vars}}{{#isEnum}} + + +## Enum: {{datatypeWithEnum}} + +| Name | Value | +|---- | -----|{{#allowableValues}}{{#enumVars}} +| {{name}} | {{value}} |{{/enumVars}}{{/allowableValues}} +{{/isEnum}}{{/vars}} +{{#vendorExtensions.x-implements.0}} + +## Implemented Interfaces + +{{#vendorExtensions.x-implements}} +* {{{.}}} +{{/vendorExtensions.x-implements}} +{{/vendorExtensions.x-implements.0}} +{{/vendorExtensions.x-is-one-of-interface}} +{{#vendorExtensions.x-is-one-of-interface}} +## Implementing Classes + +{{#oneOf}} +* {{{.}}} +{{/oneOf}} +{{/vendorExtensions.x-is-one-of-interface}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pom.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pom.mustache new file mode 100644 index 00000000000..489af6b1576 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pom.mustache @@ -0,0 +1,83 @@ + + 4.0.0 + {{groupId}} + + io.helidon.applications + helidon-se + {{helidonVersion}} + + + {{artifactId}} + {{artifactId}} + {{#appDescription}} + {{.}} + {{/appDescription}} + {{artifactVersion}} + jar + + + + io.helidon.webclient + helidon-webclient + + + io.helidon.config + helidon-config + + + {{x-helidon-rootJavaEEDepPrefix}}.json + {{x-helidon-rootJavaEEDepPrefix}}.json-api + +{{#jackson}} + + io.helidon.media + helidon-media-jackson + + + org.glassfish.jersey.media + jersey-media-json-jackson + + + org.openapitools + jackson-databind-nullable + 0.2.2 + +{{/jackson}} +{{#jsonb}} + + org.glassfish.jersey.media + jersey-media-json-binding + + + {{x-helidon-rootJavaEEDepPrefix}}.json.bind + {{x-helidon-rootJavaEEDepPrefix}}.json.bind-api + +{{/jsonb}} + + org.junit.jupiter + junit-jupiter-api + test + + + org.hamcrest + hamcrest-all + test + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-libs + + + + + + diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/queryParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/queryParams.mustache new file mode 100644 index 00000000000..4b1a980896f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/queryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}@QueryParam("{{baseName}}") {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{.}}}") {{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/returnTypes.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/returnTypes.mustache new file mode 100644 index 00000000000..32f96a90472 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/returnTypes.mustache @@ -0,0 +1,4 @@ +{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: +}}{{^useGenericResponse}}{{! +}}{{{returnType}}}{{! +}}{{/useGenericResponse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/typeInfoAnnotation.mustache new file mode 100644 index 00000000000..c833321ebfa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/typeInfoAnnotation.mustache @@ -0,0 +1,17 @@ +{{#jackson}} + +@JsonIgnoreProperties( + value = "{{{discriminator.propertyBaseName}}}", // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) +{{#discriminator.mappedModels}} +{{#-first}} +@JsonSubTypes({ +{{/-first}} + @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"), +{{#-last}} +}) +{{/-last}} +{{/discriminator.mappedModels}} +{{/jackson}} From 224f42e291e5b1b4f742d272667da2d4aadb55e9 Mon Sep 17 00:00:00 2001 From: tvallin Date: Fri, 23 Sep 2022 17:11:15 -0500 Subject: [PATCH 04/18] Add Helidon MP server code generator class and resources Signed-off-by: tvallin --- .../languages/JavaHelidonServerCodegen.java | 419 ++++++++++++++++++ .../java-helidon/server/README.mustache | 34 ++ .../server/RFC3339DateFormat.mustache | 39 ++ .../libraries/mp/JavaTimeFormatter.mustache | 53 +++ .../libraries/mp/RestApplication.mustache | 11 + .../server/libraries/mp/StringUtil.mustache | 72 +++ .../mp/additionalEnumTypeAnnotations.mustache | 2 + .../additionalModelTypeAnnotations.mustache | 2 + .../server/libraries/mp/api.mustache | 32 ++ .../server/libraries/mp/apiAbstract.mustache | 5 + .../server/libraries/mp/apiImpl.mustache | 32 ++ .../server/libraries/mp/apiMethod.mustache | 7 + .../server/libraries/mp/api_doc.mustache | 108 +++++ .../libraries/mp/api_exception.mustache | 19 + .../mp/api_exception_mapper.mustache | 22 + .../server/libraries/mp/api_test.mustache | 59 +++ .../libraries/mp/beanValidatedType.mustache | 1 + .../libraries/mp/beanValidation.mustache | 4 + .../libraries/mp/beanValidationCore.mustache | 20 + .../mp/beanValidationHeaderParams.mustache | 1 + .../mp/beanValidationPathParams.mustache | 1 + .../mp/beanValidationQueryParams.mustache | 1 + .../server/libraries/mp/beans.xml.mustache | 9 + .../server/libraries/mp/bodyParams.mustache | 1 + .../server/libraries/mp/build.gradle.mustache | 79 ++++ .../server/libraries/mp/cookieParams.mustache | 1 + .../server/libraries/mp/enumClass.mustache | 48 ++ .../libraries/mp/enumOuterClass.mustache | 61 +++ .../server/libraries/mp/formParams.mustache | 1 + .../libraries/mp/generatedAnnotation.mustache | 1 + .../server/libraries/mp/headerParams.mustache | 1 + .../libraries/mp/logging.properties.mustache | 25 ++ .../microprofile-config.properties.mustache | 11 + .../server/libraries/mp/model.mustache | 23 + .../server/libraries/mp/modelEnum.mustache | 73 +++ .../server/libraries/mp/model_doc.mustache | 4 + .../server/libraries/mp/openapi.mustache | 1 + .../server/libraries/mp/pathParams.mustache | 1 + .../server/libraries/mp/pojo.mustache | 161 +++++++ .../server/libraries/mp/pojo_doc.mustache | 37 ++ .../server/libraries/mp/pom.mustache | 100 +++++ .../server/libraries/mp/queryParams.mustache | 1 + .../server/libraries/mp/returnTypes.mustache | 1 + .../libraries/mp/typeInfoAnnotation.mustache | 17 + .../java-helidon/server/licenseInfo.mustache | 11 + .../java-helidon/server/logging.mustache | 19 + .../java-helidon/server/model_test.mustache | 47 ++ .../java-helidon/server/openapi.mustache | 1 + .../java-helidon/server/package-info.mustache | 1 + .../server/settings.gradle.mustache | 1 + 50 files changed, 1681 insertions(+) create mode 100644 modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/RFC3339DateFormat.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/JavaTimeFormatter.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/RestApplication.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/StringUtil.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/additionalEnumTypeAnnotations.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/additionalModelTypeAnnotations.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiAbstract.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiImpl.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiMethod.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_exception.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_exception_mapper.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidatedType.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidation.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationCore.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationHeaderParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationPathParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationQueryParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beans.xml.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/bodyParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/build.gradle.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/cookieParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/enumClass.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/enumOuterClass.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/formParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/generatedAnnotation.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/headerParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/logging.properties.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/microprofile-config.properties.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/modelEnum.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/model_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/openapi.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pathParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pojo.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pojo_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pom.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/queryParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/returnTypes.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/typeInfoAnnotation.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/licenseInfo.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/logging.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/model_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/openapi.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/package-info.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/settings.gradle.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java new file mode 100644 index 00000000000..267d1e58509 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java @@ -0,0 +1,419 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.servers.Server; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.meta.GeneratorMetadata; +import org.openapitools.codegen.meta.Stability; +import org.openapitools.codegen.meta.features.DocumentationFeature; +import org.openapitools.codegen.model.ModelMap; +import org.openapitools.codegen.model.OperationMap; +import org.openapitools.codegen.model.OperationsMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static org.openapitools.codegen.utils.StringUtils.camelize; + +public class JavaHelidonServerCodegen extends JavaHelidonCommonCodegen { + + private final Logger LOGGER = LoggerFactory.getLogger(JavaHelidonServerCodegen.class); + + public static final String USE_ABSTRACT_CLASS = "useAbstractClass"; + public static final String GRADLE_PROJECT = "gradleProject"; + + protected boolean useBeanValidation = true; + protected String implFolder = "src/main/java"; + protected String serializationLibrary = null; + + private boolean useAbstractClass = false; + private boolean gradleProject = false; + + public JavaHelidonServerCodegen() { + super(); + // beta for now + generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) + .stability(Stability.BETA) + .build(); + + modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme)); + + outputFolder = "generated-code" + File.separator + "java"; + embeddedTemplateDir = templateDir = "java-helidon" + File.separator + "server"; + invokerPackage = "org.openapitools.server"; + artifactId = "openapi-java-server"; + apiPackage = invokerPackage + ".api"; + modelPackage = invokerPackage + ".model"; + sourceFolder = "src" + File.separator + "main" + File.separator + "java"; + + // clioOptions default redefinition need to be updated + updateOption(CodegenConstants.INVOKER_PACKAGE, this.getInvokerPackage()); + updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId()); + updateOption(CodegenConstants.API_PACKAGE, apiPackage); + updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); + + modelTestTemplateFiles.put("model_test.mustache", ".java"); + + cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use Bean Validation")); + cliOptions.add(CliOption.newBoolean(PERFORM_BEANVALIDATION, "Perform BeanValidation")); + cliOptions.add(CliOption.newBoolean(USE_ABSTRACT_CLASS, + "Whether to generate abstract classes for REST API instead of interfaces.", useAbstractClass)); + cliOptions.add(CliOption.newBoolean(GRADLE_PROJECT, + "Whether to generate gradle project instead of maven.", gradleProject)); + + // clear model and api doc template as this codegen + // does not support auto-generated markdown doc at the moment + modelDocTemplateFiles.remove("model_doc.mustache"); + apiDocTemplateFiles.remove("api_doc.mustache"); + + // clear test templates + // as this codegen does not support api tests at the moment + apiTestTemplateFiles.clear(); + + supportedLibraries.put(HELIDON_MP, "Helidon MP Server"); + supportedLibraries.put(HELIDON_SE, "Helidon SE Server"); + supportedLibraries.put(HELIDON_NIMA, "Helidon NIMA Server"); + supportedLibraries.put(HELIDON_NIMA_ANNOTATIONS, "Helidon NIMA Annotations Server"); + + CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use"); + libraryOption.setEnum(supportedLibraries); + libraryOption.setDefault(HELIDON_SE); + cliOptions.add(libraryOption); + setLibrary(HELIDON_SE); + + CliOption serializationLibrary = new CliOption(CodegenConstants.SERIALIZATION_LIBRARY, + "Serialization library, defaults to Jackson"); + Map serializationOptions = new HashMap<>(); + serializationOptions.put(SERIALIZATION_LIBRARY_JACKSON, "Use Jackson as serialization library"); + serializationOptions.put(SERIALIZATION_LIBRARY_JSONB, "Use JSON-B as serialization library"); + serializationLibrary.setEnum(serializationOptions); + cliOptions.add(serializationLibrary); + setSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); + + removeUnusedOptions(); + + this.setLegacyDiscriminatorBehavior(false); + } + + @Override + public void processOpts() { + super.processOpts(); + supportingFiles.clear(); + dateLibrary = "java8"; + + addApiTemplateFiles(); + SupportingFile pomFile = new SupportingFile("pom.mustache", "", "pom.xml"); + SupportingFile readmeFile = new SupportingFile("README.mustache", "", "README.md"); + SupportingFile openApiFile = new SupportingFile("openapi.mustache", + ("src/main/resources/META-INF").replace("/", File.separator), "openapi.yml"); + SupportingFile logFile = new SupportingFile("logging.mustache", + ("src.main.resources").replace(".", File.separator), "logging.properties"); + SupportingFile packageInfoFile = new SupportingFile("package-info.mustache", + (sourceFolder + File.separator + invokerPackage).replace(".", File.separator), + "package-info.java"); + List modifiable = new ArrayList<>(); + modifiable.add(pomFile); + modifiable.add(readmeFile); + modifiable.add(logFile); + modifiable.add(packageInfoFile); + List unmodifiable = new ArrayList<>(); + unmodifiable.add(openApiFile); + + if (additionalProperties.containsKey(USE_BEANVALIDATION)) { + this.setUseBeanValidation(convertPropertyToBoolean(USE_BEANVALIDATION)); + } + writePropertyBack(USE_BEANVALIDATION, useBeanValidation); + + importMapping.put("ObjectMapper", "com.fasterxml.jackson.databind.ObjectMapper"); + importMapping.put("Jsonb", rootJavaEEPackage() + ".json.bind.Jsonb"); + importMapping.put("JsonbBuilder", rootJavaEEPackage() + ".json.bind.JsonbBuilder"); + + if (additionalProperties.containsKey(USE_ABSTRACT_CLASS)) { + useAbstractClass = Boolean.parseBoolean(additionalProperties.get(USE_ABSTRACT_CLASS).toString()); + } + if (!useAbstractClass) { + additionalProperties.remove(USE_ABSTRACT_CLASS); + } + + if (additionalProperties.containsKey(GRADLE_PROJECT)) { + gradleProject = Boolean.parseBoolean(additionalProperties.get(GRADLE_PROJECT).toString()); + } + if (!gradleProject) { + additionalProperties.remove(GRADLE_PROJECT); + } else { + modifiable.add(new SupportingFile("build.gradle.mustache", "", "build.gradle")); + modifiable.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); + modifiable.remove(pomFile); + } + + if (additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) { + setSerializationLibrary(additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY).toString()); + } + + String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); + + if (additionalProperties.containsKey("jsr310") && isLibrary(HELIDON_MP)) { + supportingFiles.add(new SupportingFile("JavaTimeFormatter.mustache", invokerFolder, "JavaTimeFormatter.java")); + } + + if (isLibrary(HELIDON_MP)) { + String resourceFolder = "src" + File.separator + "main" + File.separator + "resources"; + String metaInfFolder = resourceFolder + File.separator + "META-INF"; + supportingFiles.add(new SupportingFile("RestApplication.mustache", invokerFolder, "RestApplication.java")); + supportingFiles.add(new SupportingFile("microprofile-config.properties.mustache", metaInfFolder, "microprofile" + + "-config.properties")); + supportingFiles.add(new SupportingFile("beans.xml.mustache", metaInfFolder, "beans.xml")); + processSupportingFiles(modifiable, unmodifiable); + } else if (isLibrary(HELIDON_SE)) { + artifactId = "openapi-helidon-se-server"; + + modifiable.add(new SupportingFile("application.mustache", + ("src.main.resources").replace(".", java.io.File.separator), "application.yaml")); + modifiable.add(new SupportingFile("mainTest.mustache", + (testFolder + File.separator + invokerPackage).replace(".", java.io.File.separator), + "MainTest.java")); + modifiable.add(new SupportingFile("main.mustache", + (sourceFolder + File.separator + invokerPackage).replace(".", java.io.File.separator), + "Main.java")); + unmodifiable.add(new SupportingFile("validatorUtils.mustache", + (sourceFolder + File.separator + apiPackage).replace(".", java.io.File.separator), + "ValidatorUtils.java")); + if (useAbstractClass) { + importMapping.put("Map", "java.util.Map"); + importMapping.put("HashMap", "java.util.HashMap"); + importMapping.put("InputStream", "java.io.InputStream"); + importMapping.put("ReadableBodyPart", "io.helidon.media.multipart.ReadableBodyPart"); + importMapping.put("ArrayList", "java.util.ArrayList"); + importMapping.put("ByteArrayOutputStream", "java.io.ByteArrayOutputStream"); + importMapping.put("DataChunk", "io.helidon.common.http.DataChunk"); + importMapping.put("UncheckedIOException", "java.io.UncheckedIOException"); + importMapping.put("IOException", "java.io.IOException"); + importMapping.put("ByteArrayInputStream", "java.io.ByteArrayInputStream"); + } + importMapping.put("Handler", "io.helidon.webserver.Handler"); + processSupportingFiles(modifiable, unmodifiable); + } else if (isLibrary(HELIDON_NIMA)) { + throw new UnsupportedOperationException("Not implemented"); + } else if (isLibrary(HELIDON_NIMA_ANNOTATIONS)) { + throw new UnsupportedOperationException("Not implemented"); + } else { + LOGGER.error("Unknown library option (-l/--library): {}", getLibrary()); + throw new IllegalArgumentException( + String.format(Locale.ROOT, + "Unknown library option %s for Helidon Server", + getLibrary() + ) + ); + } + + if (getSerializationLibrary() == null) { + LOGGER.info("No serializationLibrary configured, using '{}' as fallback", SERIALIZATION_LIBRARY_JACKSON); + setSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); + } + switch (getSerializationLibrary()) { + case SERIALIZATION_LIBRARY_JACKSON: + additionalProperties.put(SERIALIZATION_LIBRARY_JACKSON, "true"); + additionalProperties.remove(SERIALIZATION_LIBRARY_JSONB); + supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache", invokerFolder, "RFC3339DateFormat.java")); + if (isLibrary(HELIDON_SE)) { + supportingFiles.add(new SupportingFile("jsonProvider.mustache", + (sourceFolder + File.separator + apiPackage).replace(".", java.io.File.separator), + "JsonProvider.java")); + } + break; + case SERIALIZATION_LIBRARY_JSONB: + additionalProperties.put(SERIALIZATION_LIBRARY_JSONB, "true"); + additionalProperties.remove(SERIALIZATION_LIBRARY_JACKSON); + break; + default: + additionalProperties.remove(SERIALIZATION_LIBRARY_JACKSON); + additionalProperties.remove(SERIALIZATION_LIBRARY_JSONB); + LOGGER.error("Unknown serialization library option"); + break; + } + } + + private void addApiTemplateFiles() { + Boolean fullProject = !additionalProperties.containsKey(FULL_PROJECT) ? null : + Boolean.parseBoolean(additionalProperties.get(FULL_PROJECT).toString()); + if (fullProject == null && !projectFilesExist()) { + apiTemplateFiles.put("apiImpl.mustache", "Impl.java"); + } else if (Boolean.TRUE.equals(fullProject)) { + apiTemplateFiles.put("apiImpl.mustache", "Impl.java"); + } + } + + @Override + public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { + CodegenOperation codegenOperation = super.fromOperation(path, httpMethod, operation, servers); + if (HELIDON_SE.equals(getLibrary())) { + if (additionalProperties.containsKey(JACKSON)) { + codegenOperation.imports.add("ObjectMapper"); + } + if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JSONB)) { + codegenOperation.imports.add("Jsonb"); + codegenOperation.imports.add("JsonbBuilder"); + } + if (codegenOperation.bodyParam != null) { + codegenOperation.imports.add("Handler"); + } + if (codegenOperation.queryParams.size() > 0 && useAbstractClass) { + codegenOperation.imports.add("List"); + } + if (codegenOperation.formParams.size() > 0 && useAbstractClass) { + codegenOperation.imports.add("Map"); + codegenOperation.imports.add("HashMap"); + codegenOperation.imports.add("InputStream"); + codegenOperation.imports.add("ReadableBodyPart"); + codegenOperation.imports.add("ArrayList"); + codegenOperation.imports.add("DataChunk"); + codegenOperation.imports.add("ByteArrayOutputStream"); + codegenOperation.imports.add("IOException"); + codegenOperation.imports.add("UncheckedIOException"); + codegenOperation.imports.add("ByteArrayInputStream"); + } + } + return codegenOperation; + } + + @Override + public Map postProcessSupportingFileData(Map objs) { + generateYAMLSpecFile(objs); + return super.postProcessSupportingFileData(objs); + } + + @Override + public String toApiName(String name) { + if (name.length() == 0) { + return "DefaultService"; + } + name = sanitizeName(name); + return camelize(name) + "Service"; + } + + @Override + public CodegenModel fromModel(String name, Schema model) { + CodegenModel codegenModel = super.fromModel(name, model); + // remove swagger imports + codegenModel.imports.remove("ApiModelProperty"); + codegenModel.imports.remove("ApiModel"); + + return codegenModel; + } + + @Override + public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { + OperationMap operations = objs.getOperations(); + if (HELIDON_MP.equals(getLibrary())) { + return AbstractJavaJAXRSServerCodegen.jaxrsPostProcessOperations(objs); + } + if (operations != null && HELIDON_SE.equals(getLibrary())) { + List ops = operations.getOperation(); + for (CodegenOperation operation : ops) { + if (operation.formParams.size() > 0) { + objs.put("isFormParamsFunctions", true); + } + } + } + return objs; + } + + @Override + public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { + super.postProcessModelProperty(model, property); + + if (Boolean.TRUE.equals(model.hasEnums)) { + // Add imports for Jackson + if (additionalProperties.containsKey(JACKSON)) { + model.imports.add("JsonValue"); + model.imports.add("JsonCreator"); + } + } + } + + @Override + public CodegenType getTag() { + return CodegenType.SERVER; + } + + @Override + public String getName() { + return "java-helidon-server"; + } + + @Override + public String getHelp() { + return "Generates a Java Helidon Server application."; + } + + + @Override + public void setUseBeanValidation(boolean useBeanValidation) { + this.useBeanValidation = useBeanValidation; + } + + @Override + public void setPerformBeanValidation(boolean performBeanValidation) { + throw new UnsupportedOperationException("Not implemented"); + } + + public String getSerializationLibrary() { + return serializationLibrary; + } + + public void setSerializationLibrary(String serializationLibrary) { + if (SERIALIZATION_LIBRARY_JACKSON.equalsIgnoreCase(serializationLibrary)) { + this.serializationLibrary = SERIALIZATION_LIBRARY_JACKSON; + } else if (SERIALIZATION_LIBRARY_JSONB.equalsIgnoreCase(serializationLibrary)) { + this.serializationLibrary = SERIALIZATION_LIBRARY_JSONB; + } else { + throw new IllegalArgumentException("Unexpected serializationLibrary value: " + serializationLibrary); + } + } + + /** + * Check if pom file and src directory already exist. + * + * @return outcome of test + */ + @Override + protected boolean projectFilesExist() { + Path projectFolder = Paths.get(getOutputTestFolder()); + Path pom = projectFolder.resolve("pom.xml"); + Path buildGradle = projectFolder.resolve("build.gradle"); + Path src = projectFolder.resolve(Paths.get(sourceFolder, invokerPackage.replace('.', File.separatorChar))); + return (pom.toFile().exists() || buildGradle.toFile().exists()) && src.toFile().exists(); + } +} + diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/README.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/README.mustache new file mode 100644 index 00000000000..81d0db100a7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/README.mustache @@ -0,0 +1,34 @@ +# Helidon Server with OpenAPI + +## Build and run + +With JDK11+ +```bash +mvn package +java -jar target/{{{artifactId}}}.jar +``` + +## Exercise the application + +``` +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}curl -X {{httpMethod}} {{{basePath}}}{{{path}}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +``` + +## Try health and metrics + +``` +curl -s -X GET {{{basePath}}}/health +{"outcome":"UP",... +. . . + +# Prometheus Format +curl -s -X GET {{{basePath}}}/metrics +# TYPE base:gc_g1_young_generation_count gauge +. . . + +# JSON Format +curl -H 'Accept: application/json' -X GET {{{basePath}}}/metrics +{"base":... +. . . +``` \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/RFC3339DateFormat.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/RFC3339DateFormat.mustache new file mode 100644 index 00000000000..0f7f49e8618 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/RFC3339DateFormat.mustache @@ -0,0 +1,39 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return this; + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/JavaTimeFormatter.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/JavaTimeFormatter.mustache new file mode 100644 index 00000000000..f3fb34e559c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/JavaTimeFormatter.mustache @@ -0,0 +1,53 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +{{>generatedAnnotation}} +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/RestApplication.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/RestApplication.mustache new file mode 100644 index 00000000000..341f5e4751b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/RestApplication.mustache @@ -0,0 +1,11 @@ +package {{invokerPackage}}; + +import {{rootJavaEEPackage}}.enterprise.context.ApplicationScoped; +import {{rootJavaEEPackage}}.ws.rs.ApplicationPath; +import {{rootJavaEEPackage}}.ws.rs.core.Application; + +@ApplicationScoped +@ApplicationPath("{{{contextPath}}}") +public class RestApplication extends Application { + +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/StringUtil.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/StringUtil.mustache new file mode 100644 index 00000000000..e3d5d6e9088 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/StringUtil.mustache @@ -0,0 +1,72 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import java.util.Collection; +import java.util.Iterator; + +{{>generatedAnnotation}} +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection list, String separator) { + Iterator iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/additionalEnumTypeAnnotations.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/additionalEnumTypeAnnotations.mustache new file mode 100644 index 00000000000..aa524798b42 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/additionalEnumTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalEnumTypeAnnotations}}{{{.}}} +{{/additionalEnumTypeAnnotations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/additionalModelTypeAnnotations.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/additionalModelTypeAnnotations.mustache new file mode 100644 index 00000000000..f4871c02cc2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/additionalModelTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalModelTypeAnnotations}}{{{.}}} +{{/additionalModelTypeAnnotations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api.mustache new file mode 100644 index 00000000000..5527f4d8165 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api.mustache @@ -0,0 +1,32 @@ +{{>licenseInfo}} +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import {{rootJavaEEPackage}}.ws.rs.*; +import {{rootJavaEEPackage}}.ws.rs.core.Response; + +{{#supportAsync}} +import java.util.concurrent.CompletionStage; +import java.util.concurrent.CompletableFuture; +{{/supportAsync}} + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +{{#useBeanValidation}}import {{rootJavaEEPackage}}.validation.constraints.*; +import {{rootJavaEEPackage}}.validation.Valid;{{/useBeanValidation}} + +@Path("{{commonPath}}"){{#hasConsumes}} +@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}} +@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} +{{>generatedAnnotation}} +public {{^useAbstractClass}}interface{{/useAbstractClass}}{{#useAbstractClass}}abstract class{{/useAbstractClass}} {{classname}} { +{{#operations}} +{{#operation}} + +{{>apiAbstract}} +{{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiAbstract.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiAbstract.mustache new file mode 100644 index 00000000000..bbed9724d48 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiAbstract.mustache @@ -0,0 +1,5 @@ + @{{httpMethod}}{{#subresourceOperation}} + @Path("{{{path}}}"){{/subresourceOperation}}{{#hasConsumes}} + @Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}} + @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} + abstract {{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}Response{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiImpl.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiImpl.mustache new file mode 100644 index 00000000000..140daa53eb2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiImpl.mustache @@ -0,0 +1,32 @@ +{{>licenseInfo}} +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +import {{rootJavaEEPackage}}.ws.rs.*; +import {{rootJavaEEPackage}}.ws.rs.core.Response; + +{{#supportAsync}} +import java.util.concurrent.CompletionStage; +import java.util.concurrent.CompletableFuture; +{{/supportAsync}} + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +{{#useBeanValidation}}import {{rootJavaEEPackage}}.validation.constraints.*; +import {{rootJavaEEPackage}}.validation.Valid;{{/useBeanValidation}} + +@Path("{{commonPath}}"){{#hasConsumes}} +@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}} +@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} +{{>generatedAnnotation}} +public class {{classname}}Impl {{^useAbstractClass}}implements{{/useAbstractClass}}{{#useAbstractClass}}extends{{/useAbstractClass}} {{classname}} { +{{#operations}} +{{#operation}} + +{{>apiMethod}} +{{/operation}} +} +{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiMethod.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiMethod.mustache new file mode 100644 index 00000000000..96387ec48e0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiMethod.mustache @@ -0,0 +1,7 @@ + @{{httpMethod}}{{#subresourceOperation}} + @Path("{{{path}}}"){{/subresourceOperation}}{{#hasConsumes}} + @Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}} + @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} + public {{#supportAsync}}CompletionStage<{{/supportAsync}}Response{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { + return {{#supportAsync}}CompletableFuture.supplyAsync(() -> {{/supportAsync}}Response.ok().entity("magic!").build(){{#supportAsync}}){{/supportAsync}}; + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_doc.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_doc.mustache new file mode 100644 index 00000000000..3d3203957e6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_doc.mustache @@ -0,0 +1,108 @@ +# {{classname}}{{#description}} + +{{.}}{{/description}} + +All URIs are relative to *{{basePath}}* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} | +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +## {{operationId}} + +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) + +{{summary}}{{#notes}} + +{{.}}{{/notes}} + +### Example + +```java +// Import classes: +import {{{invokerPackage}}}.ApiClient; +import {{{invokerPackage}}}.ApiException; +import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} +import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} +import {{{invokerPackage}}}.models.*; +import {{{package}}}.{{{classname}}}; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}} + {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + System.out.println(result);{{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#allParams}}| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + +- **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} +- **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_exception.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_exception.mustache new file mode 100644 index 00000000000..d9fb5ee91d8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_exception.mustache @@ -0,0 +1,19 @@ +{{>licenseInfo}} +package {{apiPackage}}; + +import {{rootJavaEEPackage}}.ws.rs.core.Response; + +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private final Response response; + + public ApiException(Response response) { + super("Api response has status code " + response.getStatus()); + this.response = response; + } + + public Response getResponse() { + return this.response; + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_exception_mapper.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_exception_mapper.mustache new file mode 100644 index 00000000000..ac4db62e8b8 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_exception_mapper.mustache @@ -0,0 +1,22 @@ +{{>licenseInfo}} +package {{apiPackage}}; + +import {{rootJavaEEPackage}}.ws.rs.core.MultivaluedMap; +import {{rootJavaEEPackage}}.ws.rs.core.Response; +import {{rootJavaEEPackage}}.ws.rs.ext.Provider; + +import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; + +@Provider +public class ApiExceptionMapper implements ResponseExceptionMapper { + + @Override + public boolean handles(int status, MultivaluedMap headers) { + return status >= 400; + } + + @Override + public ApiException toThrowable(Response response) { + return new ApiException(response); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_test.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_test.mustache new file mode 100644 index 00000000000..431834b779b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api_test.mustache @@ -0,0 +1,59 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +import {{rootJavaEEPackage}}.inject.Inject; +import {{rootJavaEEPackage}}.ws.rs.client.WebTarget; + +import org.junit.jupiter.api.Test; + +import io.helidon.microprofile.tests.junit5.HelidonTest; + +import java.net.URL; +import java.net.MalformedURLException; +{{^fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +{{/fullJavaUtil}} + +/** + {{#appName}} + * {{{.}}} Test + * + {{/appName}} + * API tests for {{classname}} + */ +@HelidonTest +public class {{classname}}Test { + + @Inject + private WebTarget target; + + {{#operations}}{{#operation}} + /** + {{#summary}} + * {{summary}} + * + {{#notes}} + * {{.}} + * + {{/notes}} + {{/summary}} + * @throws ApiException if the Api call fails + */ + @Test + public void {{operationId}}Test() throws Exception { + // TODO: test validations + {{#allParams}} + {{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}} + {{/allParams}} + //{{#returnType}}{{{.}}} response = {{/returnType}}target.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + //{{#returnType}}assertNotNull(response);{{/returnType}} + } + {{/operation}}{{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidatedType.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidatedType.mustache new file mode 100644 index 00000000000..8f2816b2c70 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidatedType.mustache @@ -0,0 +1 @@ +{{#isArray}}{{baseType}}<{{#items}}{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}}{{>beanValidatedType}}{{/items}}>{{/isArray}}{{^isArray}}{{{datatypeWithEnum}}}{{/isArray}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidation.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidation.mustache new file mode 100644 index 00000000000..c8c6946fef6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidation.mustache @@ -0,0 +1,4 @@ +{{#required}} + @NotNull +{{/required}} +{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationCore.mustache new file mode 100644 index 00000000000..d6e2f13b457 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationCore.mustache @@ -0,0 +1,20 @@ +{{#pattern}} @Pattern(regexp="{{{.}}}"){{/pattern}}{{! +minLength && maxLength set +}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +minLength set, maxLength not +}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! +minLength not set, maxLength set +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! +@Size: minItems && maxItems set +}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems set, maxItems not +}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! +@Size: minItems not set && maxItems set +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! +check for integer or long / all others=decimal type with @Decimal* +isInteger set +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! +isLong set +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! +Not Integer, not Long => we have a decimal value! +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationHeaderParams.mustache new file mode 100644 index 00000000000..c4ff01d7e55 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationHeaderParams.mustache @@ -0,0 +1 @@ +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationPathParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationPathParams.mustache new file mode 100644 index 00000000000..051bd53c0a5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationPathParams.mustache @@ -0,0 +1 @@ +{{! PathParam is always required, no @NotNull necessary }}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationQueryParams.mustache new file mode 100644 index 00000000000..c4ff01d7e55 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beanValidationQueryParams.mustache @@ -0,0 +1 @@ +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beans.xml.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beans.xml.mustache new file mode 100644 index 00000000000..125ef995e5e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/beans.xml.mustache @@ -0,0 +1,9 @@ + + + + diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/bodyParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/bodyParams.mustache new file mode 100644 index 00000000000..f938cb5b6be --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/bodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}{{#useBeanValidation}}@Valid {{#required}}{{^isNullable}}@NotNull {{/isNullable}}{{/required}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/build.gradle.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/build.gradle.mustache new file mode 100644 index 00000000000..4de685654d4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/build.gradle.mustache @@ -0,0 +1,79 @@ +plugins { + id 'java' + id 'application' +} + +group = '{{{groupId}}}' +version = '{{{artifactVersion}}}' + +{{#appDescription}} +description = """{{.}}""" +{{/appDescription}} + + +sourceCompatibility = 11 +targetCompatibility = 11 + +tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' +} + +ext { + helidonVersion = '{{{helidonVersion}}}' + mainClass='io.helidon.microprofile.cdi.Main' +} + +test { + useJUnitPlatform() +} + +repositories { + mavenCentral() + mavenLocal() +} + +dependencies { + // import Helidon BOM + implementation enforcedPlatform("io.helidon:helidon-dependencies:${project.helidonVersion}") + implementation 'io.helidon.microprofile.bundles:helidon-microprofile-core' + implementation 'io.helidon.microprofile.cdi:helidon-microprofile-cdi' + implementation '{{rootJavaEEPackage}}.enterprise:{{rootJavaEEPackage}}.enterprise.cdi-api' + implementation '{{rootJavaEEPackage}}.ws.rs:{{rootJavaEEPackage}}.ws.rs-api' +{{#jackson}} + implementation 'org.glassfish.jersey.media:jersey-media-json-jackson' +{{/jackson}} +{{#jsonb}} + implementation 'org.glassfish.jersey.media:jersey-media-json-binding' + implementation '{{rootJavaEEPackage}}.json.bind:{{rootJavaEEPackage}}.json.bind-api' +{{/jsonb}} + testImplementation 'junit:junit' + testImplementation 'io.helidon.microprofile.tests:helidon-microprofile-tests-junit5' +} + +// define a custom task to copy all dependencies in the runtime classpath +// into build/libs/libs +// uses built-in Copy +task copyLibs(type: Copy) { + from configurations.runtimeClasspath + into 'build/libs/libs' +} + +// add it as a dependency of built-in task 'assemble' +copyLibs.dependsOn jar +assemble.dependsOn copyLibs + +// default jar configuration +// set the main classpath +// add each jar under build/libs/libs into the classpath +jar { + archiveFileName = "${project.name}.jar" + manifest { + attributes ('Main-Class': "${project.mainClass}", + 'Class-Path': configurations.runtimeClasspath.files.collect { "libs/$it.name" }.join(' ') + ) + } +} + +application { +mainClass = "${project.mainClass}" +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/cookieParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/cookieParams.mustache new file mode 100644 index 00000000000..3aa861dd0ff --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/cookieParams.mustache @@ -0,0 +1 @@ +{{#isCookieParam}}@CookieParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{{dataType}}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/enumClass.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/enumClass.mustache new file mode 100644 index 00000000000..441eab35340 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/enumClass.mustache @@ -0,0 +1,48 @@ +{{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}} { + + {{#allowableValues}} + {{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} + {{/allowableValues}} + + + private {{dataType}} value; + + {{datatypeWithEnum}} ({{dataType}} v) { + value = v; + } + + public {{dataType}} value() { + return value; + } + + @Override + {{#jackson}}@JsonValue{{/jackson}} + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into {{dataType}}, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static {{datatypeWithEnum}} fromString(String s) { + for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected string value '" + s + "'");{{/isNullable}} + } + + {{#jackson}}@JsonCreator{{/jackson}} + public static {{datatypeWithEnum}} fromValue({{dataType}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.equals(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/enumOuterClass.mustache new file mode 100644 index 00000000000..3d9a35ead90 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/enumOuterClass.mustache @@ -0,0 +1,61 @@ +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +{{/jackson}} +{{#jsonb}} +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbCreator; +{{/jsonb}} + +/** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { + {{#gson}} + {{#allowableValues}}{{#enumVars}} + @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + {{/gson}} + {{^gson}} + {{#allowableValues}}{{#enumVars}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + {{/gson}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + /** + * Convert a String into {{dataType}}, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromString(String s) { + for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected string value '" + s + "'");{{/isNullable}} + } + + @Override + {{#jackson}}@JsonValue{{/jackson}} + public String toString() { + return String.valueOf(value); + } + + {{#jackson}}@JsonCreator{{/jackson}}{{#jsonb}}@JsonbCreator{{/jsonb}} + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.equals(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/formParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/formParams.mustache new file mode 100644 index 00000000000..885966e6442 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/formParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{^isFile}}@FormParam(value = "{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}} @FormParam(value = "{{baseName}}") InputStream {{paramName}}InputStream{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/generatedAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/generatedAnnotation.mustache new file mode 100644 index 00000000000..356a48872aa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/generatedAnnotation.mustache @@ -0,0 +1 @@ +@{{rootJavaEEPackage}}.annotation.Generated(value = "{{generatorClass}}"{{^hideGenerationTimestamp}}, date = "{{generatedDate}}"{{/hideGenerationTimestamp}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/headerParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/headerParams.mustache new file mode 100644 index 00000000000..ef50692b026 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/headerParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}@HeaderParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} {{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}} {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/logging.properties.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/logging.properties.mustache new file mode 100644 index 00000000000..3e909fb7d90 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/logging.properties.mustache @@ -0,0 +1,25 @@ +# Example Logging Configuration File +# For more information see $JAVA_HOME/jre/lib/logging.properties + +## Send messages to the console +handlers=io.helidon.common.HelidonConsoleHandler +# +## HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n +# +## Global logging level. Can be overridden by specific loggers +.level=INFO + +# Quiet Weld +org.jboss.level=WARNING + +# +# Component specific log levels +#io.helidon.webserver.level=INFO +#io.helidon.config.level=INFO +#io.helidon.security.level=INFO +#io.helidon.microprofile.level=INFO +#io.helidon.common.level=INFO +#io.netty.level=INFO +#org.glassfish.jersey.level=INFO +#org.jboss.weld=INFO diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/microprofile-config.properties.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/microprofile-config.properties.mustache new file mode 100644 index 00000000000..38988f20e5e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/microprofile-config.properties.mustache @@ -0,0 +1,11 @@ +# Microprofile server properties + +# Application properties. This is the default greeting +app.greeting=Hello + +# Microprofile server properties +server.port=8080 +server.host=0.0.0.0 + +# Enable the optional MicroProfile Metrics REST.request metrics +metrics.rest-request.enabled=true diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/model.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/model.mustache new file mode 100644 index 00000000000..00a3c3db131 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/model.mustache @@ -0,0 +1,23 @@ +{{>licenseInfo}} +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#useBeanValidation}} +import {{rootJavaEEPackage}}.validation.constraints.*; +import {{rootJavaEEPackage}}.validation.Valid; +{{/useBeanValidation}} + +{{#models}} +{{#model}} +{{#isEnum}} +{{>enumOuterClass}} +{{/isEnum}} +{{^isEnum}} +{{>pojo}} +{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/modelEnum.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/modelEnum.mustache new file mode 100644 index 00000000000..1eb5bb263c7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/modelEnum.mustache @@ -0,0 +1,73 @@ + /** + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} + */ +{{#jsonb}} + @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) + @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) +{{/jsonb}} +{{#withXml}} + @XmlType(name="{{datatypeWithEnum}}") + @XmlEnum({{dataType}}.class) +{{/withXml}} + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}} + {{#enumVars}} + {{#enumDescription}} + /** + * {{.}} + */ + {{/enumDescription}} + {{#withXml}} + @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) + {{/withXml}} + {{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} + {{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + {{#jackson}}@JsonValue{{/jackson}} + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + {{#jackson}}@JsonCreator{{/jackson}} + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (b.value.equals(value)) { + return b; + } + } + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} + } +{{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { + @Override + public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'");{{/useNullForUnknownEnumValue}} + } + } + + public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> { + @Override + public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } +{{/jsonb}} + } diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/model_doc.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/model_doc.mustache new file mode 100644 index 00000000000..9a7fe146a4e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/model_doc.mustache @@ -0,0 +1,4 @@ +{{#models}}{{#model}} + +{{#isEnum}}{{>enum_outer_doc}}{{/isEnum}}{{^isEnum}}{{>pojo_doc}}{{/isEnum}} +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/openapi.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/openapi.mustache new file mode 100644 index 00000000000..51ebafb0187 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/openapi.mustache @@ -0,0 +1 @@ +{{{openapi-yaml}}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pathParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pathParams.mustache new file mode 100644 index 00000000000..9e8455d5ac7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}@PathParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pojo.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pojo.mustache new file mode 100644 index 00000000000..8cb61daf3de --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pojo.mustache @@ -0,0 +1,161 @@ + +{{#jsonb}} +import java.lang.reflect.Type; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.DeserializationContext; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbDeserializer; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.SerializationContext; +import {{rootJavaEEPackage}}.json.stream.JsonGenerator; +import {{rootJavaEEPackage}}.json.stream.JsonParser; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +{{/jackson}} + +{{#description}} +/** + * {{{.}}} + **/ +{{/description}} +{{>additionalModelTypeAnnotations}} +{{#vendorExtensions.x-class-extra-annotation}} +{{{vendorExtensions.x-class-extra-annotation}}} +{{/vendorExtensions.x-class-extra-annotation}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensions.x-implements}}{{#-first}} implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { + {{#vars}}{{#isEnum}}{{^isContainer}} +{{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} +{{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} +{{#description}} + /** + * {{{.}}} + **/ +{{/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}}; +{{/isContainer}} +{{^isContainer}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; +{{/isContainer}} + {{/vars}} +{{#vendorExtensions.x-has-readonly-properties}}{{^withXml}} + public {{classname}}() { + } + + {{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}} + public {{classname}}( + {{#readOnlyVars}} + {{#jsonb}}@JsonbProperty("{{baseName}}") {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/jsonb}} + {{#jackson}}@JsonProperty(value="{{baseName}}") {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/jackson}} + {{/readOnlyVars}} + ) { + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + } + {{/withXml}}{{/vendorExtensions.x-has-readonly-properties}} + {{#vars}} + /** + {{#description}} + * {{.}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + {{#deprecated}} + * @deprecated + {{/deprecated}} + **/ +{{#deprecated}} + @Deprecated +{{/deprecated}} +{{#vendorExtensions.x-extra-annotation}} + {{{vendorExtensions.x-extra-annotation}}} +{{/vendorExtensions.x-extra-annotation}} +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} {{#withXml}}{{#isEnum}}{{^isArray}}{{^isMap}}public {{dataType}} {{getter}}() { + if ({{name}} == null) { + return null; + } + return {{name}}.value(); + }{{/isMap}}{{/isArray}}{{/isEnum}}{{/withXml}}{{^withXml}}{{#isEnum}}{{^isArray}}{{^isMap}}public {{datatypeWithEnum}} {{getter}}() { + return {{name}}; + }{{/isMap}}{{/isArray}}{{/isEnum}}{{/withXml}}{{#isEnum}}{{#isArray}}public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + }{{/isArray}}{{/isEnum}}{{#isEnum}}{{#isMap}}public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + }{{/isMap}}{{/isEnum}}{{^isEnum}}public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + }{{/isEnum}} + + {{^isReadOnly}} + /** + * Set {{name}} + **/ + {{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}} + {{/vendorExtensions.x-setter-extra-annotation}}public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + } + + public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + return this; + } + {{#isArray}} + + public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + this.{{name}}.add({{name}}Item); + return this; + } + {{/isArray}} + {{#isMap}} + + public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + this.{{name}}.put(key, {{name}}Item); + return this; + } + {{/isMap}} + {{/isReadOnly}} + + {{/vars}} + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} + {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{/vars}}sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pojo_doc.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pojo_doc.mustache new file mode 100644 index 00000000000..bae0bc48cdd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pojo_doc.mustache @@ -0,0 +1,37 @@ +# {{#vendorExtensions.x-is-one-of-interface}}Interface {{/vendorExtensions.x-is-one-of-interface}}{{classname}} + +{{#description}}{{&description}} +{{/description}} +{{^vendorExtensions.x-is-one-of-interface}} + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +{{#vars}}|**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}**{{baseType}}{{#items}}<{{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}**Map<String, {{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}**{{dataType}}**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} | +{{/vars}} +{{#vars}}{{#isEnum}} + + +## Enum: {{datatypeWithEnum}} + +| Name | Value | +|---- | -----|{{#allowableValues}}{{#enumVars}} +| {{name}} | {{value}} |{{/enumVars}}{{/allowableValues}} +{{/isEnum}}{{/vars}} +{{#vendorExtensions.x-implements.0}} + +## Implemented Interfaces + +{{#vendorExtensions.x-implements}} +* {{{.}}} +{{/vendorExtensions.x-implements}} +{{/vendorExtensions.x-implements.0}} +{{/vendorExtensions.x-is-one-of-interface}} +{{#vendorExtensions.x-is-one-of-interface}} +## Implementing Classes + +{{#oneOf}} +* {{{.}}} +{{/oneOf}} +{{/vendorExtensions.x-is-one-of-interface}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pom.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pom.mustache new file mode 100644 index 00000000000..e58df32a5bc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pom.mustache @@ -0,0 +1,100 @@ + + 4.0.0 + {{groupId}} + + io.helidon.applications + helidon-mp + {{{helidonVersion}}} + + + {{artifactId}} + {{artifactId}} + {{#appDescription}} + {{.}} + {{/appDescription}} + {{artifactVersion}} + jar + +{{#openApiNullable}} + + 0.2.3 + +{{/openApiNullable}} + + + + io.helidon.microprofile.bundles + helidon-microprofile-core + + + io.helidon.microprofile.cdi + helidon-microprofile-cdi + + + {{x-helidon-rootJavaEEDepPrefix}}.enterprise + {{x-helidon-rootJavaEEDepPrefix}}.enterprise.cdi-api + + + {{x-helidon-rootJavaEEDepPrefix}}.ws.rs + {{x-helidon-rootJavaEEDepPrefix}}.ws.rs-api + +{{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${version.jackson.databind.nullable} + +{{/openApiNullable}} +{{#jackson}} + + org.glassfish.jersey.media + jersey-media-json-jackson + +{{/jackson}} +{{#jsonb}} + + org.glassfish.jersey.media + jersey-media-json-binding + + + {{x-helidon-rootJavaEEDepPrefix}}.json.bind + {{x-helidon-rootJavaEEDepPrefix}}.json.bind-api + +{{/jsonb}} + + org.junit.jupiter + junit-jupiter-api + test + + + io.helidon.microprofile.tests + helidon-microprofile-tests-junit5 + test + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-libs + + + + + org.jboss.jandex + jandex-maven-plugin + + + make-index + + + + + + diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/queryParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/queryParams.mustache new file mode 100644 index 00000000000..38bfb9ed06e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/queryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{.}}}") {{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/returnTypes.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/returnTypes.mustache new file mode 100644 index 00000000000..433b7334785 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/returnTypes.mustache @@ -0,0 +1 @@ +{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/typeInfoAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/typeInfoAnnotation.mustache new file mode 100644 index 00000000000..c833321ebfa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/typeInfoAnnotation.mustache @@ -0,0 +1,17 @@ +{{#jackson}} + +@JsonIgnoreProperties( + value = "{{{discriminator.propertyBaseName}}}", // ignore manually set {{{discriminator.propertyBaseName}}}, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the {{{discriminator.propertyBaseName}}} to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{{discriminator.propertyBaseName}}}", visible = true) +{{#discriminator.mappedModels}} +{{#-first}} +@JsonSubTypes({ +{{/-first}} + @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{mappingName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"), +{{#-last}} +}) +{{/-last}} +{{/discriminator.mappedModels}} +{{/jackson}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/licenseInfo.mustache new file mode 100644 index 00000000000..c66209f2794 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/licenseInfo.mustache @@ -0,0 +1,11 @@ +/* + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/logging.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/logging.mustache new file mode 100644 index 00000000000..cd238eb6615 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/logging.mustache @@ -0,0 +1,19 @@ + +# Example Logging Configuration File +# For more information see $JAVA_HOME/jre/lib/logging.properties + +# Send messages to the console +handlers=io.helidon.common.HelidonConsoleHandler + +# HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n + +# Global logging level. Can be overridden by specific loggers +.level=INFO + +# Component specific log levels +#io.helidon.webserver.level=INFO +#io.helidon.config.level=INFO +#io.helidon.security.level=INFO +#io.helidon.common.level=INFO +#io.netty.level=INFO diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/model_test.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/model_test.mustache new file mode 100644 index 00000000000..c0fa11d1810 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/model_test.mustache @@ -0,0 +1,47 @@ +{{>licenseInfo}} +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +import org.junit.jupiter.api.Test; + +{{#fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{/fullJavaUtil}} + +/** + * Model tests for {{classname}} + */ +public class {{classname}}Test { + {{#models}} + {{#model}} + {{^vendorExtensions.x-is-one-of-interface}} + {{^isEnum}} + private final {{classname}} model = new {{classname}}(); + + {{/isEnum}} + /** + * Model tests for {{classname}} + */ + @Test + public void test{{classname}}() { + // TODO: test {{classname}} + } + + {{#allVars}} + /** + * Test the property '{{name}}' + */ + @Test + public void {{name}}Test() { + // TODO: test {{name}} + } + + {{/allVars}} + {{/vendorExtensions.x-is-one-of-interface}} + {{/model}} + {{/models}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/openapi.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/openapi.mustache new file mode 100644 index 00000000000..51ebafb0187 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/openapi.mustache @@ -0,0 +1 @@ +{{{openapi-yaml}}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/package-info.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/package-info.mustache new file mode 100644 index 00000000000..c0a6d4bbb92 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/package-info.mustache @@ -0,0 +1 @@ +package {{invokerPackage}}; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/settings.gradle.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/settings.gradle.mustache new file mode 100644 index 00000000000..448dc07602e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/settings.gradle.mustache @@ -0,0 +1 @@ +rootProject.name = '{{artifactId}}' \ No newline at end of file From 1e029ae935cefd4da46b0ec4e7f57333d87aea39 Mon Sep 17 00:00:00 2001 From: aserkes Date: Fri, 23 Sep 2022 17:11:15 -0500 Subject: [PATCH 05/18] Add Helidon SE server resources Signed-off-by: aserkes --- .../server/libraries/se/README.mustache | 34 +++++ .../se/additionalEnumTypeAnnotations.mustache | 2 + .../additionalModelTypeAnnotations.mustache | 2 + .../server/libraries/se/api.mustache | 78 +++++++++++ .../server/libraries/se/apiImpl.mustache | 40 ++++++ .../server/libraries/se/application.mustache | 3 + .../libraries/se/beanValidationCore.mustache | 16 +++ .../se/beanValidationHeaderParams.mustache | 2 + .../se/beanValidationPathParams.mustache | 2 + .../se/beanValidationQueryParams.mustache | 2 + .../server/libraries/se/bodyParams.mustache | 1 + .../server/libraries/se/build.gradle.mustache | 88 +++++++++++++ .../server/libraries/se/cookieParams.mustache | 1 + .../server/libraries/se/dataType.mustache | 11 ++ .../server/libraries/se/enumClass.mustache | 62 +++++++++ .../libraries/se/enumOuterClass.mustache | 80 ++++++++++++ .../server/libraries/se/formParams.mustache | 1 + .../libraries/se/formParamsFunctions.mustache | 17 +++ .../libraries/se/formParamsInitial.mustache | 11 ++ .../libraries/se/generatedAnnotation.mustache | 1 + .../server/libraries/se/headerParams.mustache | 1 + .../server/libraries/se/jsonProvider.mustache | 20 +++ .../server/libraries/se/main.mustache | 101 +++++++++++++++ .../server/libraries/se/mainTest.mustache | 47 +++++++ .../server/libraries/se/model.mustache | 10 ++ .../server/libraries/se/paramValue.mustache | 14 ++ .../server/libraries/se/pathParams.mustache | 2 + .../server/libraries/se/pojo.mustache | 121 ++++++++++++++++++ .../server/libraries/se/pom.mustache | 116 +++++++++++++++++ .../server/libraries/se/queryParams.mustache | 1 + .../libraries/se/validatorUtils.mustache | 112 ++++++++++++++++ 31 files changed, 999 insertions(+) create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/additionalEnumTypeAnnotations.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/additionalModelTypeAnnotations.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/apiImpl.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/application.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationCore.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationHeaderParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationPathParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationQueryParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/bodyParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/build.gradle.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/cookieParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/dataType.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/enumClass.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/enumOuterClass.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formParamsFunctions.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formParamsInitial.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/generatedAnnotation.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/headerParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/jsonProvider.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/main.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/mainTest.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValue.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/pathParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/pojo.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/pom.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/queryParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/validatorUtils.mustache diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/README.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/README.mustache new file mode 100644 index 00000000000..8d2420f4631 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/README.mustache @@ -0,0 +1,34 @@ +# Helidon SE Server with OpenAPI + +## Build and run + +With JDK11+ +```bash +mvn package +java -jar target/{{{artifactId}}}.jar +``` + +## Exercise the application + +``` +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}curl -X {{httpMethod}} {{{basePath}}}{{{path}}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +``` + +## Try health and metrics + +``` +curl -s -X GET {{{basePath}}}/health +{"outcome":"UP",... +. . . + +# Prometheus Format +curl -s -X GET {{{basePath}}}/metrics +# TYPE base:gc_g1_young_generation_count gauge +. . . + +# JSON Format +curl -H 'Accept: application/json' -X GET {{{basePath}}}/metrics +{"base":... +. . . +``` \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/additionalEnumTypeAnnotations.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/additionalEnumTypeAnnotations.mustache new file mode 100644 index 00000000000..aa524798b42 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/additionalEnumTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalEnumTypeAnnotations}}{{{.}}} +{{/additionalEnumTypeAnnotations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/additionalModelTypeAnnotations.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/additionalModelTypeAnnotations.mustache new file mode 100644 index 00000000000..f4871c02cc2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/additionalModelTypeAnnotations.mustache @@ -0,0 +1,2 @@ +{{#additionalModelTypeAnnotations}}{{{.}}} +{{/additionalModelTypeAnnotations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/api.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/api.mustache new file mode 100644 index 00000000000..c44408d778b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/api.mustache @@ -0,0 +1,78 @@ +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} + +{{#useAbstractClass}} +import java.util.Optional; +import java.util.logging.Logger; + +import io.helidon.common.GenericType; +import io.helidon.common.reactive.Single; +{{/useAbstractClass}} +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; +import io.helidon.webserver.Service; + +{{#operations}} +{{^useAbstractClass}}public interface {{classname}} extends Service { {{/useAbstractClass}} +{{#useAbstractClass}}public abstract class {{classname}} implements Service { + + protected static final Logger LOGGER = Logger.getLogger({{classname}}.class.getName()); +{{#jackson}} + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper();{{/jackson}} +{{#jsonb}} + protected static final Jsonb JSONB = JsonbBuilder.create();{{/jsonb}} +{{/useAbstractClass}} + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + {{#useAbstractClass}}public{{/useAbstractClass}}{{^useAbstractClass}}default{{/useAbstractClass}} void update(Routing.Rules rules) { +{{#operation}} + rules.{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}("{{{path}}}", {{! + }}{{#bodyParam}}{{#isModel}}Handler.create({{{dataType}}}.class, {{/isModel}}this::{{{operationId}}}){{#isModel}}){{/isModel}}{{/bodyParam}}{{! + }}{{^bodyParam}}this::{{{operationId}}}){{/bodyParam}}; +{{/operation}} + } +{{#useAbstractClass}}{{#isFormParamsFunctions}} + + {{!}}{{>formParamsFunctions}} +{{/isFormParamsFunctions}}{{/useAbstractClass}} +{{#operation}} + + /** + * {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}}. + * @param request the server request + * @param response the server response{{#allParams}}{{#isBodyParam}}{{#isModel}} + * @param {{paramName}} {{{description}}}{{^description}}{{paramName}}{{/description}} {{/isModel}}{{/isBodyParam}}{{/allParams}} + */ + void {{{operationId}}}(ServerRequest request, ServerResponse response{{#allParams}}{{#isBodyParam}}{{#isModel}}, {{{dataType}}} {{paramName}}{{/isModel}}{{/isBodyParam}}{{/allParams}}){{^useAbstractClass}};{{/useAbstractClass}}{{#useAbstractClass}} { {{#formParams}}{{#-first}} + {{>formParamsInitial}}{{/-first}}{{/formParams}} + Single.create({{^hasParams}}Single.empty(){{/hasParams}}{{#hasParams}}{{^bodyParam}}{{#formParams}}{{#-first}}formSingle{{/-first}}{{/formParams}}{{^formParams}}Single.empty(){{/formParams}}{{/bodyParam}}{{#bodyParam}}{{^isModel}}request.content().as(new GenericType<{{{dataType}}}>() { }){{/isModel}}{{#isModel}}Single.empty(){{/isModel}}{{/bodyParam}}{{/hasParams}}) + .thenAccept({{#bodyParam}}{{^isModel}}{{paramName}}{{/isModel}}{{#isModel}}val{{/isModel}}{{/bodyParam}}{{^bodyParam}}val{{/bodyParam}} -> { +{{#allParams}} + {{> queryParams }}{{> pathParams }}{{> headerParams}}{{> bodyParams}}{{> formParams}}{{> cookieParams}} +{{/allParams}} + handle{{#lambda.titlecase}}{{{operationId}}}{{/lambda.titlecase}}(request, response{{#allParams}}, {{paramName}}{{/allParams}}); + }) + .exceptionally(throwable -> handleError(request, response, throwable)); + } + + /** + * Handle {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}}. + * @param request the server request + * @param response the server response{{#allParams}} + * @param {{paramName}} {{{description}}}{{^description}}{{paramName}}{{/description}} {{/allParams}} + */ + abstract void handle{{#lambda.titlecase}}{{{operationId}}}{{/lambda.titlecase}}(ServerRequest request, ServerResponse response{{#allParams}}, {{>dataType}} {{paramName}}{{/allParams}}); +{{/useAbstractClass}} + +{{/operation}} +{{#useAbstractClass}} abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable);{{! +}}{{/useAbstractClass}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/apiImpl.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/apiImpl.mustache new file mode 100644 index 00000000000..b6cf71293f5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/apiImpl.mustache @@ -0,0 +1,40 @@ +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +{{^useAbstractClass}} +import java.util.logging.Logger;{{/useAbstractClass}} + +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; + +{{#operations}} +public class {{classname}}Impl {{^useAbstractClass}}implements{{/useAbstractClass}}{{#useAbstractClass}}extends{{/useAbstractClass}} {{classname}} { + + private static final int HTTP_CODE_NOT_IMPLEMENTED = 501; +{{^useAbstractClass}} + private static final Logger LOGGER = Logger.getLogger({{classname}}.class.getName()); +{{#jackson}} + private static final ObjectMapper MAPPER = JsonProvider.objectMapper();{{/jackson}} +{{#jsonb}} + private static final Jsonb JSONB = JsonbBuilder.create();{{/jsonb}} +{{/useAbstractClass}} +{{#operation}} + +{{#useAbstractClass}} + public void handle{{#lambda.titlecase}}{{{operationId}}}{{/lambda.titlecase}}(ServerRequest request, ServerResponse response{{#allParams}}, {{>dataType}} {{paramName}}{{/allParams}}) { +{{/useAbstractClass}} +{{^useAbstractClass}} + public void {{{operationId}}}(ServerRequest request, ServerResponse response{{#allParams}}{{#isBodyParam}}{{#isModel}}, {{{dataType}}} {{paramName}}{{/isModel}}{{/isBodyParam}}{{/allParams}}) { +{{/useAbstractClass}} + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } +{{/operation}} + +{{#useAbstractClass}} + public Void handleError(ServerRequest request, ServerResponse response, Throwable throwable) { + return response.send(throwable); + } +{{/useAbstractClass}} +} +{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/application.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/application.mustache new file mode 100644 index 00000000000..2418f6ef270 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/application.mustache @@ -0,0 +1,3 @@ +server: + port: {{port}}{{^port}}8080{{/port}} + host: {{host}}{{^host}}localhost{{/host}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationCore.mustache new file mode 100644 index 00000000000..d0479eb939e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationCore.mustache @@ -0,0 +1,16 @@ +{{#pattern}}{{#isString}} + ValidatorUtils.validatePattern({{paramName}}, "{{{pattern}}}");{{/isString}}{{/pattern}}{{#minLength}}{{#maxLength}} + ValidatorUtils.validateSize({{paramName}}, {{minLength}}, {{maxLength}});{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} + ValidatorUtils.validateSize({{paramName}}, {{minLength}}, null);{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} + ValidatorUtils.validateSize({{paramName}}, null, {{.}});{{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} + ValidatorUtils.validateSize({{paramName}}, {{minItems}}, {{maxItems}});{{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} + ValidatorUtils.validateSize({{paramName}}, {{minItems}}, null);{{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} + ValidatorUtils.validateSize({{paramName}}, null, {{.}});{{/maxItems}}{{/minItems}}{{#useBeanValidation}}{{#isEmail}} + //RFC 5322 for Email Validation + ValidatorUtils.validatePattern({{paramName}}, "^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+$");{{/isEmail}}{{/useBeanValidation}}{{#isInteger}}{{#minimum}} + ValidatorUtils.validateMin({{paramName}}, {{.}});{{/minimum}}{{#maximum}} + ValidatorUtils.validateMax({{paramName}}, {{.}});{{/maximum}}{{/isInteger}}{{#isLong}}{{#minimum}} + ValidatorUtils.validateMin({{paramName}}.intValue(), {{.}});{{/minimum}}{{#maximum}} + ValidatorUtils.validateMax({{paramName}}.intValue(), {{.}});{{/maximum}}{{/isLong}}{{^isInteger}}{{^isLong}}{{#minimum}} + ValidatorUtils.validateMin({{paramName}}, "{{minimum}}", {{#exclusiveMinimum}}false{{/exclusiveMinimum}}{{^exclusiveMinimum}}true{{/exclusiveMinimum}});{{/minimum}}{{#maximum}} + ValidatorUtils.validateMax({{paramName}}, "{{maximum}}", {{#exclusiveMaximum}}false{{/exclusiveMaximum}}{{^exclusiveMaximum}}true{{/exclusiveMaximum}});{{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationHeaderParams.mustache new file mode 100644 index 00000000000..b590d59fd0d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationHeaderParams.mustache @@ -0,0 +1,2 @@ +{{#required}}{{!}} + {{!}}ValidatorUtils.checkNonNull({{paramName}});{{/required}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationPathParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationPathParams.mustache new file mode 100644 index 00000000000..60b256f885e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationPathParams.mustache @@ -0,0 +1,2 @@ +{{! PathParam is always required, no @NotNull necessary }} +ValidatorUtils.checkNonNull({{paramName}});{{#isPrimitiveType}}{{>beanValidationCore}}{{/isPrimitiveType}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationQueryParams.mustache new file mode 100644 index 00000000000..dfec605af6e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/beanValidationQueryParams.mustache @@ -0,0 +1,2 @@ +{{#required}}{{!}} + {{!}}ValidatorUtils.checkNonNull({{paramName}});{{/required}}{{#isPrimitiveType}}{{>beanValidationCore}}{{/isPrimitiveType}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/bodyParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/bodyParams.mustache new file mode 100644 index 00000000000..7994e23e023 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/bodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}ValidatorUtils.checkNonNull({{paramName}});{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/build.gradle.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/build.gradle.mustache new file mode 100644 index 00000000000..32b1002ae42 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/build.gradle.mustache @@ -0,0 +1,88 @@ +plugins { + id 'java' + id 'application' +} + +group = '{{{groupId}}}' +version = '{{{artifactVersion}}}' + +{{#appDescription}} +description = """{{.}}""" +{{/appDescription}} + + +sourceCompatibility = 11 +targetCompatibility = 11 + +tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' +} + +ext { + helidonVersion = '{{{helidonVersion}}}' +{{^interfaceOnly}} + mainClass='{{{invokerPackage}}}.Main' +{{/interfaceOnly}} + validationApiVersion = '2.0.1.Final' +} + +test { + useJUnitPlatform() +} + +repositories { + mavenCentral() + mavenLocal() +} + +dependencies { + // import Helidon BOM + implementation enforcedPlatform("io.helidon:helidon-dependencies:${project.helidonVersion}") + implementation "{{x-helidon-validationArtifactPrefix}}.validation:{{x-helidon-validationArtifactPrefix}}validation-api:${project.validationApiVersion}" + implementation 'io.helidon.webserver:helidon-webserver' + implementation 'io.helidon.media:helidon-media-jsonp' +{{#jackson}} + implementation 'io.helidon.media:helidon-media-jackson' +{{/jackson}} +{{#jsonb}} + implementation 'io.helidon.media:helidon-media-jsonb' +{{/jsonb}} + implementation 'io.helidon.media:helidon-media-multipart' + implementation 'io.helidon.config:helidon-config-yaml' + implementation 'io.helidon.health:helidon-health' + implementation 'io.helidon.health:helidon-health-checks' + implementation 'io.helidon.metrics:helidon-metrics' + implementation 'io.helidon.openapi:helidon-openapi' + testImplementation 'org.junit.jupiter:junit-jupiter-api' + testImplementation 'io.helidon.webclient:helidon-webclient' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' +} + +// define a custom task to copy all dependencies in the runtime classpath +// into build/libs/libs +// uses built-in Copy +task copyLibs(type: Copy) { + from configurations.runtimeClasspath + into 'build/libs/libs' +} + +// add it as a dependency of built-in task 'assemble' +copyLibs.dependsOn jar +assemble.dependsOn copyLibs + +// default jar configuration +// set the main classpath +// add each jar under build/libs/libs into the classpath +jar { + archiveFileName = "${project.name}.jar" + manifest { + attributes ({{^interfaceOnly}}'Main-Class': "${project.mainClass}",{{/interfaceOnly}} + 'Class-Path': configurations.runtimeClasspath.files.collect { "libs/$it.name" }.join(' ') + ) + } +} +{{^interfaceOnly}} +application { +mainClass = "${project.mainClass}" +} +{{/interfaceOnly}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/cookieParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/cookieParams.mustache new file mode 100644 index 00000000000..c11ce657251 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/cookieParams.mustache @@ -0,0 +1 @@ +{{#isCookieParam}}{{>dataType}} {{paramName}} = {{>paramValue}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/dataType.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/dataType.mustache new file mode 100644 index 00000000000..cc2a3d0d4df --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/dataType.mustache @@ -0,0 +1,11 @@ +{{#isPrimitiveType}}{{^isFile}}{{{dataType}}}{{/isFile}}{{#isFile}}InputStream{{/isFile}}{{/isPrimitiveType}}{{! +}}{{^isPrimitiveType}}{{! + }}{{#isArray}}{{! + }}{{#isBodyParam}}{{{dataType}}}{{/isBodyParam}}{{! + }}{{^isBodyParam}}{{! + }}List<{{#isFormParam}}{{#isFile}}InputStream{{/isFile}}{{^isFile}}String{{/isFile}}{{/isFormParam}}{{! + }}{{^isFormParam}}{{#isModel}}{{{dataType}}}{{/isModel}}{{^isModel}}String{{/isModel}}{{/isFormParam}}>{{! + }}{{/isBodyParam}}{{! + }}{{/isArray}}{{! + }}{{^isArray}}{{^isModel}}String{{/isModel}}{{#isModel}}{{{dataType}}}{{/isModel}}{{/isArray}}{{! +}}{{/isPrimitiveType}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/enumClass.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/enumClass.mustache new file mode 100644 index 00000000000..b9eeee00409 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/enumClass.mustache @@ -0,0 +1,62 @@ + /** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} + */ + {{#jsonb}} + @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) + @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) + {{/jsonb}} + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}} { + {{#allowableValues}}{{#enumVars}}{{{name}}}({{{value}}}){{^-last}}, + {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + {{#jackson}} + @JsonValue + {{/jackson}} + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + {{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { + @Override + public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'");{{/useNullForUnknownEnumValue}} + } + } + + public static final class Serializer implements JsonbSerializer<{{datatypeWithEnum}}> { + @Override + public void serialize({{datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } + {{/jsonb}} + + {{#jackson}} + @JsonCreator + {{/jackson}} + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + text + "'");{{/useNullForUnknownEnumValue}} + } + } diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/enumOuterClass.mustache new file mode 100644 index 00000000000..a695da1902a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/enumOuterClass.mustache @@ -0,0 +1,80 @@ +{{#jsonb}}import java.lang.reflect.Type; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.DeserializationContext; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbDeserializer; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.SerializationContext; +import {{rootJavaEEPackage}}.json.stream.JsonGenerator; +import {{rootJavaEEPackage}}.json.stream.JsonParser; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}}{{/jsonb}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue;{{/jackson}} + +/** + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} + */ +{{#jsonb}} +@JsonbTypeSerializer({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Serializer.class) +@JsonbTypeDeserializer({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Deserializer.class){{/jsonb}} +public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { + +{{#allowableValues}} + {{#enumVars}} + {{{name}}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} + {{/enumVars}} +{{/allowableValues}} + + private {{{dataType}}} value; + + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + this.value = value; + } + + {{#jackson}} + @JsonValue + {{/jackson}} + public {{{dataType}}} getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +{{#jsonb}} + public static final class Deserializer implements JsonbDeserializer<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(parser.getString())) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + parser.getString() + "'");{{/useNullForUnknownEnumValue}} + } + } + + public static final class Serializer implements JsonbSerializer<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + @Override + public void serialize({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} obj, JsonGenerator generator, SerializationContext ctx) { + generator.write(obj.value); + } + } +{{/jsonb}} +{{#jackson}} + @JsonCreator{{/jackson}} + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + text + "'");{{/useNullForUnknownEnumValue}} + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formParams.mustache new file mode 100644 index 00000000000..82c0f5d715c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{^isFile}}{{>dataType}} {{paramName}} = {{>paramValue}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}InputStream{{#isArray}}>{{/isArray}} {{paramName}} = {{>paramValue}}{{/isFile}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formParamsFunctions.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formParamsFunctions.mustache new file mode 100644 index 00000000000..f4e382d4810 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formParamsFunctions.mustache @@ -0,0 +1,17 @@ +private void processNonFileFormField(String name, Map> nonFileFormContent, ReadableBodyPart part) { + List content = nonFileFormContent.computeIfAbsent(name, key -> new ArrayList<>()); + part.content().as(String.class).thenAccept(content::add); + } + + private void processFileFormField(String name, Map> fileFormContent, ReadableBodyPart part) { + List content = fileFormContent.computeIfAbsent(name, key -> new ArrayList<>()); + part.content().map(DataChunk::bytes) + .collect(ByteArrayOutputStream::new, (stream, bytes) -> { + try { + stream.write(bytes); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }) + .thenAccept(byteStream -> content.add(new ByteArrayInputStream(byteStream.toByteArray()))); + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formParamsInitial.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formParamsInitial.mustache new file mode 100644 index 00000000000..08d90802b6c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formParamsInitial.mustache @@ -0,0 +1,11 @@ +Map> nonFileFormContent = new HashMap<>(); + Map> fileFormContent = new HashMap<>(); + Single formSingle = request.content().asStream(ReadableBodyPart.class) + .forEach(part -> { + String name = part.name();{{#formParams}} + if ("{{baseName}}".equals(name)) { + {{^isFile}}processNonFileFormField(name, nonFileFormContent, part);{{/isFile}}{{! + }}{{#isFile}}processFileFormField(name, fileFormContent, part);{{/isFile}} + }{{/formParams}} + part.drain(); + }); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/generatedAnnotation.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/generatedAnnotation.mustache new file mode 100644 index 00000000000..6f4eb2cb74f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/generatedAnnotation.mustache @@ -0,0 +1 @@ +@{{rootJavaEEPackage}}.annotation.Generated(value = "{{{generatorClass}}}"{{^hideGenerationTimestamp}}, date = "{{{generatedDate}}}"{{/hideGenerationTimestamp}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/headerParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/headerParams.mustache new file mode 100644 index 00000000000..89fb5e8f51b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/headerParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}{{>dataType}} {{paramName}} = {{>paramValue}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/jsonProvider.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/jsonProvider.mustache new file mode 100644 index 00000000000..9a3b6f4c107 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/jsonProvider.mustache @@ -0,0 +1,20 @@ +package {{apiPackage}}; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; + +public class JsonProvider { + + public static ObjectMapper objectMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.registerModule(new JavaTimeModule()); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY); + mapper.configure(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE, false); + return mapper; + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/main.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/main.mustache new file mode 100644 index 00000000000..575d3704448 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/main.mustache @@ -0,0 +1,101 @@ +package {{invokerPackage}}; +{{#apiInfo}}{{#apis}}{{#operations}} +import {{package}}.{{classname}}Impl;{{/operations}}{{/apis}}{{/apiInfo}} + +import io.helidon.common.LogConfig; +import io.helidon.common.reactive.Single; +import io.helidon.config.Config; +import io.helidon.health.HealthSupport; +import io.helidon.health.checks.HealthChecks; +import io.helidon.media.jsonp.JsonpSupport; +{{#jsonb}} +import io.helidon.media.jsonb.JsonbSupport; +{{/jsonb}} +{{#jackson}} +import io.helidon.media.jackson.JacksonSupport; +import {{apiPackage}}.JsonProvider; +{{/jackson}} +import io.helidon.metrics.MetricsSupport; +import io.helidon.openapi.OpenAPISupport; +import io.helidon.webserver.Routing; +import io.helidon.webserver.WebServer; + +/** +* The application main class. +*/ +public final class Main { + + /** + * Cannot be instantiated. + */ + private Main() { + } + + /** + * Application main entry point. + * @param args command line arguments. + */ + public static void main(final String[] args) { + startServer(); + } + + /** + * Start the server. + * @return the created {@link WebServer} instance + */ + static Single startServer() { + + // load logging configuration + LogConfig.configureRuntime(); + + // By default this will pick up application.yaml from the classpath + Config config = Config.create(); + + WebServer server = WebServer.builder(createRouting(config)) + .config(config.get("server")) + .addMediaSupport(JsonpSupport.create()) +{{#jsonb}} + .addMediaSupport(JsonbSupport.create()) +{{/jsonb}} +{{#jackson}} + .addMediaSupport(JacksonSupport.create(JsonProvider.objectMapper())) +{{/jackson}} + .build(); + + Single webserver = server.start(); + + // Try to start the server. If successful, print some info and arrange to + // print a message at shutdown. If unsuccessful, print the exception. + webserver.thenAccept(ws -> { + System.out.println("WEB server is up! {{{basePath}}}"); + ws.whenShutdown().thenRun(() -> System.out.println("WEB server is DOWN. Good bye!")); + }) + .exceptionallyAccept(t -> { + System.err.println("Startup failed: " + t.getMessage()); + t.printStackTrace(System.err); + }); + + return webserver; + } + + /** + * Creates new {@link Routing}. + * + * @return routing configured with JSON support, a health check, and a service + * @param config configuration of this server + */ + private static Routing createRouting(Config config) { + + MetricsSupport metrics = MetricsSupport.create(); + HealthSupport health = HealthSupport.builder() + .addLiveness(HealthChecks.healthChecks()) // Adds a convenient set of checks + .build(); + + return Routing.builder() + .register(OpenAPISupport.create(config.get(OpenAPISupport.Builder.CONFIG_KEY))) + .register(health) // Health at "/health" + .register(metrics) // Metrics at "/metrics"{{#apiInfo}}{{#apis}}{{#operations}} + .register("/", new {{classname}}Impl()){{/operations}}{{/apis}}{{/apiInfo}} + .build(); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/mainTest.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/mainTest.mustache new file mode 100644 index 00000000000..78c4e89b589 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/mainTest.mustache @@ -0,0 +1,47 @@ +package {{invokerPackage}}; + +import java.util.Collections; +import java.util.concurrent.TimeUnit; + +import {{rootJavaEEPackage}}.json.Json; +import {{rootJavaEEPackage}}.json.JsonBuilderFactory; + +import io.helidon.media.jsonp.JsonpSupport; +import io.helidon.webclient.WebClient; +import io.helidon.webserver.WebServer; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public class MainTest { + + private static WebServer webServer; + private static WebClient webClient; + private static final JsonBuilderFactory JSON_BUILDER = Json.createBuilderFactory(Collections.emptyMap()); + + @BeforeAll + public static void startTheServer() throws Exception { + webServer = Main.startServer().await(); + + webClient = WebClient.builder() + .baseUri("http://localhost:" + webServer.port()) + .addMediaSupport(JsonpSupport.create()) + .build(); + } + + @AfterAll + public static void stopServer() throws Exception { + if (webServer != null) { + webServer.shutdown() + .toCompletableFuture() + .get(10, TimeUnit.SECONDS); + } + } + + @Test + public void test() throws Exception { + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/model.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/model.mustache new file mode 100644 index 00000000000..dbe0359ada4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/model.mustache @@ -0,0 +1,10 @@ +package {{package}}; + +{{#imports}}import {{import}}; +{{/imports}} +{{#models}} +{{#model}}{{#isEnum}} +{{>enumOuterClass}}{{/isEnum}}{{^isEnum}} +{{>pojo}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValue.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValue.mustache new file mode 100644 index 00000000000..52ad10dd603 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValue.mustache @@ -0,0 +1,14 @@ +{{#isPathParam}}Optional.ofNullable(request.path().param("{{baseName}}")){{/isPathParam}}{{! +}}{{#isQueryParam}}{{#isPrimitiveType}}request.queryParams().toMap().getOrDefault("{{baseName}}", List.of()).stream().findFirst(){{/isPrimitiveType}}{{/isQueryParam}}{{! +}}{{#isQueryParam}}{{^isPrimitiveType}}Optional.ofNullable(request.queryParams().toMap().get("{{baseName}}")){{/isPrimitiveType}}{{/isQueryParam}}{{! +}}{{#isCookieParam}}{{#isPrimitiveType}}request.headers().cookies().toMap().getOrDefault("{{baseName}}", List.of()).stream().findFirst(){{/isPrimitiveType}}{{/isCookieParam}}{{! +}}{{#isCookieParam}}{{^isPrimitiveType}}Optional.ofNullable(request.headers().cookies().toMap().get("{{baseName}}")){{/isPrimitiveType}}{{/isCookieParam}}{{! +}}{{#isHeaderParam}}request.headers().value("{{baseName}}"){{/isHeaderParam}}{{! +}}{{#isFormParam}}Optional.ofNullable({{#isFile}}fileFormContent{{/isFile}}{{^isFile}}nonFileFormContent{{/isFile}}.get("{{baseName}}")){{^isArray}}.flatMap(list->list.stream().findFirst()){{/isArray}}{{/isFormParam}}{{! +}}{{#isPrimitiveType}}{{^isFile}}{{^isString}}.map({{! + }}{{#isDecimal}}BigDecimal::new{{/isDecimal}}{{! + }}{{#isNumber}}BigDecimal::new{{/isNumber}}{{! + }}{{#isDate}}LocalDate::parse{{/isDate}}{{#isDateTime}}OffsetDateTime::parse{{/isDateTime}}{{! + }}{{^isDecimal}}{{^isNumber}}{{^isDate}}{{^isDateTime}}{{{dataType}}}::valueOf{{/isDateTime}}{{/isDate}}{{/isNumber}}{{/isDecimal}}){{! +}}{{/isString}}{{/isFile}}{{/isPrimitiveType}}{{! +}}.orElse(null); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/pathParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/pathParams.mustache new file mode 100644 index 00000000000..14464296f11 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/pathParams.mustache @@ -0,0 +1,2 @@ +{{#isPathParam}}{{> dataType }} {{paramName}} = {{> paramValue }}{{#useBeanValidation}} + {{>beanValidationPathParams}}{{/useBeanValidation}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/pojo.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/pojo.mustache new file mode 100644 index 00000000000..944ae482956 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/pojo.mustache @@ -0,0 +1,121 @@ +{{#jsonb}} +import java.lang.reflect.Type; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeDeserializer; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbTypeSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.DeserializationContext; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbDeserializer; +import {{rootJavaEEPackage}}.json.bind.serializer.JsonbSerializer; +import {{rootJavaEEPackage}}.json.bind.serializer.SerializationContext; +import {{rootJavaEEPackage}}.json.stream.JsonGenerator; +import {{rootJavaEEPackage}}.json.stream.JsonParser; +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbProperty; +{{#vendorExtensions.x-has-readonly-properties}} +import {{rootJavaEEPackage}}.json.bind.annotation.JsonbCreator; +{{/vendorExtensions.x-has-readonly-properties}} +{{/jsonb}} + +{{#description}} +/** + * {{{.}}} + */{{/description}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} { + +{{#vars}} + {{#isEnum}} + + {{^isContainer}} +{{>enumClass}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} +{{>enumClass}} + {{/mostInnerItems}} + {{/isContainer}} + + {{/isEnum}} + private {{{datatypeWithEnum}}} {{{name}}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; +{{/vars}} + + /** + * Default constructor. + */ + public {{classname}}() { + // JSON-B / Jackson + } + + /** + * Create {{classname}}. + * +{{#vars}} + * @param {{name}} {{description}}{{^description}}{{name}}{{/description}} +{{/vars}} + */ + public {{classname}}( +{{#vars}} + {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} +{{/vars}} + ) { +{{#vars}} + this.{{name}} = {{name}}; +{{/vars}} + } + +{{#vars}}{{#vendorExtensions.x-has-readonly-properties}}{{#jsonb}} + @JsonbCreator + public {{classname}}( + {{#readOnlyVars}} + @JsonbProperty("{{baseName}}") {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}} + {{/readOnlyVars}} + ) { + {{#readOnlyVars}} + this.{{name}} = {{name}}; + {{/readOnlyVars}} + }{{/jsonb}}{{/vendorExtensions.x-has-readonly-properties}} + + /** + {{#description}} + * {{{.}}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{.}} + {{/minimum}} + {{#maximum}} + * maximum: {{.}} + {{/maximum}} + * @return {{name}} + */ + public {{{datatypeWithEnum}}} {{getter}}() { + return {{name}}; + } + + public void {{setter}}({{{datatypeWithEnum}}} {{name}}) { + this.{{name}} = {{name}}; + }{{/vars}} + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class {{classname}} {\n"); + {{#parent}}sb.append(" ").append(toIndentedString(super.toString())).append("\n");{{/parent}} + {{#vars}}sb.append(" {{name}}: ").append(toIndentedString({{name}})).append("\n"); + {{/vars}}sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/pom.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/pom.mustache new file mode 100644 index 00000000000..720ea80bde4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/pom.mustache @@ -0,0 +1,116 @@ + + + 4.0.0 + + io.helidon.applications + helidon-se + {{{helidonVersion}}} + + + {{{groupId}}} + {{{artifactId}}} + {{{artifactVersion}}} + {{{artifactId}}} + {{#appDescription}} + {{.}} + {{/appDescription}} + + + {{{invokerPackage}}}.Main + 0.2.3 + + + + + {{x-helidon-rootJavaEEDepPrefix}}.validation + {{x-helidon-validationArtifactPrefix}}validation-api + + + io.helidon.webserver + helidon-webserver + + + io.helidon.media + helidon-media-jsonp + + + io.helidon.media + helidon-media-multipart + + + io.helidon.config + helidon-config-yaml + + + io.helidon.health + helidon-health + + + io.helidon.health + helidon-health-checks + + + io.helidon.metrics + helidon-metrics + + + io.helidon.openapi + helidon-openapi + +{{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${version.jackson.databind.nullable} + +{{/openApiNullable}} +{{#jackson}} + + io.helidon.media + helidon-media-jackson + +{{/jackson}} +{{#jsonb}} + + io.helidon.media + helidon-media-jsonb + ${helidon.version} + +{{/jsonb}} + + org.junit.jupiter + junit-jupiter-api + test + + + io.helidon.webclient + helidon-webclient + test + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-libs + + + + + io.helidon.build-tools + helidon-maven-plugin + + + third-party-license-report + + + + + + diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/queryParams.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/queryParams.mustache new file mode 100644 index 00000000000..6b276964518 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/queryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}{{>dataType}} {{paramName}} = {{>paramValue}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/validatorUtils.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/validatorUtils.mustache new file mode 100644 index 00000000000..323407d0c14 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/validatorUtils.mustache @@ -0,0 +1,112 @@ +package {{apiPackage}}; + +import java.lang.reflect.Array; +import java.math.BigDecimal; +import java.util.Collection; +import java.util.Map; +import java.util.Objects; + +import {{rootJavaEEPackage}}.validation.ValidationException; + +/** +* Validation utility methods. +*/ +public final class ValidatorUtils { + + public static boolean validateMin(Integer value, Integer min) { + checkNonNull(value); + if (value < min) { + throw new ValidationException(String.format("%s is less than %s", value, min)); + } + return true; + } + + public static boolean validateMax(Integer value, Integer max) { + checkNonNull(value); + if (value > max) { + throw new ValidationException(String.format("%s is more than %s", value, max)); + } + return true; + } + + public static boolean validateSize(Object value, Integer min, Integer max) { + checkNonNull(value); + Integer size = -1; + if (value instanceof Map) { + size = ((Map) value).size(); + } + if (value instanceof CharSequence) { + size = ((CharSequence) value).length(); + } + if (value instanceof Collection) { + size = ((Collection) value).size(); + } + if (value.getClass().isArray()) { + size = Array.getLength(value); + } + if (size == -1) { + throw new ValidationException("Value has incorrect type"); + } + if (min != null) { + validateMin(size, min); + } + if (max != null) { + validateMax(size, max); + } + return true; + } + + public static boolean validatePattern(String value, String pattern) { + checkNonNull(value, pattern); + if (value.matches(pattern)) { + return true; + } + throw new ValidationException(String.format("'%s' does not match the pattern '%s'", value, pattern)); + } + + public static boolean validateMin(BigDecimal value, String stringMinValue, boolean inclusive) { + checkNonNull(value); + BigDecimal minValue = new BigDecimal(stringMinValue); + int result = value.compareTo(minValue); + if (inclusive) { + if (result >= 0) { + return true; + } + } else { + if (result > 0) { + return true; + } + } + throw new ValidationException( + String.format("%s is not valid value. Min value '%s'. Inclusive - %s.", value, stringMinValue, inclusive) + ); + } + + public static boolean validateMax(BigDecimal value, String stringMaxValue, boolean inclusive) { + checkNonNull(value); + BigDecimal maxValue = new BigDecimal(stringMaxValue); + int result = value.compareTo(maxValue); + if (inclusive) { + if (result <= 0) { + return true; + } + } else { + if (result < 0) { + return true; + } + } + throw new ValidationException( + String.format("%s is not valid value. Max value '%s'. Inclusive - %s.", value, stringMaxValue, inclusive) + ); + } + + public static void checkNonNull(Object... args) { + try { + for (Object o : args) { + Objects.requireNonNull(o); + } + } catch (Exception e) { + throw new ValidationException(e); + } + } +} \ No newline at end of file From 638c5201c47d805d8568678fb49f9dad1a0a4263 Mon Sep 17 00:00:00 2001 From: "tim.quinn@oracle.com" Date: Fri, 23 Sep 2022 17:11:16 -0500 Subject: [PATCH 06/18] Add config files for samples, update services declarations, add test resources and code, add Helidon client and server sample profiles to pom Signed-off-by: tim.quinn@oracle.com --- bin/configs/java-helidon-client-mp.yaml | 12 + bin/configs/java-helidon-client-se.yaml | 12 + bin/configs/java-helidon-server-mp.yaml | 11 + bin/configs/java-helidon-server-se.yaml | 8 + .../org.openapitools.codegen.CodegenConfig | 2 + ...HelidonCommonCodegenPackagePrefixTest.java | 206 +++++ .../helidon/JavaHelidonCommonCodegenTest.java | 105 +++ .../JavaHelidonMpClientCodegenTest.java | 97 ++ .../JavaHelidonMpServerCodegenTest.java | 192 ++++ .../JavaHelidonSeClientCodegenTest.java | 121 +++ .../JavaHelidonSeServerCodegenTest.java | 289 ++++++ .../helidon/functional/FunctionalBase.java | 360 ++++++++ .../FunctionalHelidonClientBase.java | 75 ++ .../FunctionalHelidonMPClientTest.java | 28 + .../FunctionalHelidonMPServerTest.java | 96 ++ .../FunctionalHelidonSEClientTest.java | 29 + .../FunctionalHelidonSeServerTest.java | 79 ++ .../3_0/helidon/petstore-for-testing.yaml | 860 ++++++++++++++++++ .../petstore-no-multipart-for-testing.yaml | 789 ++++++++++++++++ pom.xml | 24 + 20 files changed, 3395 insertions(+) create mode 100644 bin/configs/java-helidon-client-mp.yaml create mode 100644 bin/configs/java-helidon-client-se.yaml create mode 100644 bin/configs/java-helidon-server-mp.yaml create mode 100644 bin/configs/java-helidon-server-se.yaml create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpClientCodegenTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpServerCodegenTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeClientCodegenTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeServerCodegenTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalBase.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonClientBase.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPClientTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPServerTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSEClientTest.java create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSeServerTest.java create mode 100644 modules/openapi-generator/src/test/resources/3_0/helidon/petstore-for-testing.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/helidon/petstore-no-multipart-for-testing.yaml diff --git a/bin/configs/java-helidon-client-mp.yaml b/bin/configs/java-helidon-client-mp.yaml new file mode 100644 index 00000000000..083e776f16b --- /dev/null +++ b/bin/configs/java-helidon-client-mp.yaml @@ -0,0 +1,12 @@ +generatorName: java-helidon-client +library: mp +outputDir: samples/client/petstore/java-helidon-client/mp +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + artifactId: petstore-helidon-client-mp + hideGenerationTimestamp: "true" + configureAuth: "false" + build: "all" + test: "spock" + requiredPropertiesInConstructor: "false" + visitable: "true" diff --git a/bin/configs/java-helidon-client-se.yaml b/bin/configs/java-helidon-client-se.yaml new file mode 100644 index 00000000000..fd7b9916356 --- /dev/null +++ b/bin/configs/java-helidon-client-se.yaml @@ -0,0 +1,12 @@ +generatorName: java-helidon-client +library: se +outputDir: samples/client/petstore/java-helidon-client/se +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + artifactId: petstore-helidon-client-se + hideGenerationTimestamp: "true" + configureAuth: "false" + build: "all" + test: "spock" + requiredPropertiesInConstructor: "false" + visitable: "true" diff --git a/bin/configs/java-helidon-server-mp.yaml b/bin/configs/java-helidon-server-mp.yaml new file mode 100644 index 00000000000..86bf0c9bdd9 --- /dev/null +++ b/bin/configs/java-helidon-server-mp.yaml @@ -0,0 +1,11 @@ +generatorName: java-helidon-server +library: mp +outputDir: samples/server/petstore/java-helidon-server/mp +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/java-helidon/server +additionalProperties: + artifactId: petstore-helidon-server-mp + hideGenerationTimestamp: "true" + build: "all" + test: "spock" + useAuth: "false" \ No newline at end of file diff --git a/bin/configs/java-helidon-server-se.yaml b/bin/configs/java-helidon-server-se.yaml new file mode 100644 index 00000000000..add3f7ea764 --- /dev/null +++ b/bin/configs/java-helidon-server-se.yaml @@ -0,0 +1,8 @@ +generatorName: java-helidon-server +library: se +outputDir: samples/server/petstore/java-helidon-server/se +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/java-helidon/server +additionalProperties: + artifactId: petstore-helidon-server-se + hideGenerationTimestamp: "true" \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 11a9572215d..92dcb24bbcd 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -51,6 +51,8 @@ org.openapitools.codegen.languages.HaskellServantCodegen org.openapitools.codegen.languages.HaskellYesodServerCodegen org.openapitools.codegen.languages.JavaClientCodegen org.openapitools.codegen.languages.JavaCXFClientCodegen +org.openapitools.codegen.languages.JavaHelidonClientCodegen +org.openapitools.codegen.languages.JavaHelidonServerCodegen org.openapitools.codegen.languages.JavaInflectorServerCodegen org.openapitools.codegen.languages.JavaMicronautClientCodegen org.openapitools.codegen.languages.JavaMicronautServerCodegen diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java new file mode 100644 index 00000000000..70f0e76eca9 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.openapitools.codegen.java.helidon; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.junit.Assert; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +public class JavaHelidonCommonCodegenPackagePrefixTest { + + private static final String INPUT_FILE = "src/test/resources/3_0/helidon/petstore-for-testing.yaml"; + private static final String PACKAGE_PREFIX_KEY = "rootJavaEEPackage"; + private static final String HELIDON_VERSION_KEY = "helidonVersion"; + + private static final String EXCEPTION_MESSAGE_FRAGMENT = "namespace but options specified"; + + // The generated SE client does not depend on the jakarta/javax imports, so no need to test it. + private static final List> GENERATOR_LIBRARY_PAIRS = new ArrayList>() { + { + add(listOf("java-helidon-client", "mp")); + add(listOf("java-helidon-server", "se")); + add(listOf("java-helidon-server", "mp")); + } + }; + + private String outputDir; + + @BeforeMethod + public void setup() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + outputDir = output.getAbsolutePath().replace('\\', '/'); + } + + @Test(dataProvider = "valid") + public void checkValidCombinations(String explicitHelidonVersion, + String explicitPrefix, + String expectedPrefix, + String generatorName, + String libraryName) { + List files = runTest(explicitHelidonVersion, explicitPrefix, generatorName, libraryName); + checkFileForPackagePrefix(files, generatorName, libraryName, expectedPrefix); + } + + @Test(dataProvider = "invalid") + public void checkInvalidCombinations(String explicitHelidonVersion, + String explicitPrefix, + String generatorName, + String libraryName) { + IllegalArgumentException e = Assert.assertThrows(IllegalArgumentException.class, + () -> runTest(explicitHelidonVersion, explicitPrefix, generatorName, libraryName)); + Assert.assertTrue("Exception message '" + e.getMessage() + "' contains '" + EXCEPTION_MESSAGE_FRAGMENT + "'", + e.getMessage().contains(EXCEPTION_MESSAGE_FRAGMENT)); + } + + @DataProvider(name = "valid") + public Object [][] createValidData() { + Object [][] settingsForEachRun = new Object[][] { + {null, null, "jakarta"}, + {"3.0.1", null, "jakarta"}, + {"2.5.3", null, "javax"}, + {null, "jakarta", "jakarta"}, + {"3.0.1", "jakarta", "jakarta"}, + {"2.5.3", "javax", "javax"} + }; + + return prepareTestData(settingsForEachRun); + } + + @DataProvider(name = "invalid") + public Object [][] createInvalidData() { + Object [][] settingsForEachRun = new Object[][] { + {"2.5.3", "jakarta"}, + {null, "javax"}, + {"3.0.1", "javax"} + }; + + return prepareTestData(settingsForEachRun); + } + + /** + * Creates test data for each tested generator/library pair for all the version/prefix settings. + * + * @param settingsForEachRun version/prefix settings to test + * @return test data for driving a test method + */ + private Object[][] prepareTestData(Object[][] settingsForEachRun) { + Object [][] result = new Object[GENERATOR_LIBRARY_PAIRS.size() * settingsForEachRun.length][]; + int resultSlot = 0; + + int settingsLength = settingsForEachRun[0].length; + for (List generatorLibraryPair : GENERATOR_LIBRARY_PAIRS) { + for (Object[] settings : settingsForEachRun) { + result[resultSlot] = Arrays.copyOf(settings, settingsLength + 2); + result[resultSlot][settingsLength] = generatorLibraryPair.get(0); // generator + result[resultSlot][settingsLength + 1] = generatorLibraryPair.get(1); // library + resultSlot++; + } + } + return result; + } + + private static List listOf(String... values) { + return new ArrayList<>(Arrays.asList(values)); + } + + private List runTest(String explicitHelidonVersion, + String explicitPackagePrefix, + String generatorName, + String libraryName) { + Map additionalProperties = new HashMap<>(); + CodegenConfigurator clientConfigurator = new CodegenConfigurator() + .setGeneratorName(generatorName) + .setLibrary(libraryName) + .setInputSpec(INPUT_FILE) + .setOutputDir(outputDir); + + if (explicitHelidonVersion != null) { + additionalProperties.put(HELIDON_VERSION_KEY, explicitHelidonVersion); + } + if (explicitPackagePrefix != null) { + additionalProperties.put(PACKAGE_PREFIX_KEY, explicitPackagePrefix); + } + + // Use JSON-B for serialization to force jakarta or json imports into the generated POJOs. + additionalProperties.put(CodegenConstants.SERIALIZATION_LIBRARY, "jsonb"); + + clientConfigurator.setAdditionalProperties(additionalProperties); + + DefaultGenerator generator = new DefaultGenerator(); + generator.opts(clientConfigurator.toClientOptInput()); + + return generator.generate(); + } + + private void checkFileForPackagePrefix(List files, + String generatorName, + String libraryName, + String expectedPrefix) { + // The SE client does not use the rootJavaEEPackage so we don't check any file in that case. + if (generatorName.equals("java-helidon-client") && libraryName.equals("se")) { + return; + } + + // The MP client and server generator create PetAPI containing a wildcard include. + if (libraryName.equals("mp")) { + TestUtils.ensureContainsFile(files, Paths.get(outputDir).toFile(), generatedFilePath(generatorName, libraryName)); + TestUtils.assertFileContains(Paths.get(outputDir + "/" + generatedFilePath(generatorName, libraryName)), + "import " + expectedPrefix + ".ws.rs.*;"); + return; + } + + // The SE server generates 'import {{rootJavaEEPackage}}.json.stream.JsonParser;' in POJOs for JSON-B seriolization. + TestUtils.ensureContainsFile(files, Paths.get(outputDir).toFile(), generatedFilePath(generatorName, libraryName)); + TestUtils.assertFileContains(Paths.get(outputDir + "/" + generatedFilePath(generatorName, libraryName)), + "import " + expectedPrefix + ".json.stream.JsonParser;"); + } + + private String generatedFilePath(String generatorName, String libraryName) { + // The path to the file depends on client or server. + String serverOrClient = (generatorName.contains("server") ? "server" : "client"); + + // The file to check depends on the generator: e.g., PetApi for client, PetService for server. + String apiFileNameSuffix = (generatorName.contains("server") ? "Service" : "Api"); + + // For MP, check api/PetApi or api/PetService; for SE check model/Pet.java. + String filePath = (libraryName.equals("mp") + ? "api/Pet" + apiFileNameSuffix + : "model/Pet") + + ".java"; + + return "src/main/java/org/openapitools/" + + serverOrClient + + "/" + + filePath; + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenTest.java new file mode 100644 index 00000000000..d399c97de46 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenTest.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.java.helidon; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import org.junit.Assert; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +public class JavaHelidonCommonCodegenTest { + + private DefaultGenerator generator; + private CodegenConfigurator configurator; + private String outputDir; + + @BeforeMethod + public void setup() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + outputDir = output.getAbsolutePath().replace('\\', '/'); + + configurator = new CodegenConfigurator() + .setGeneratorName("java-helidon-server") + .setLibrary("mp") + .setInputSpec("src/test/resources/3_0/helidon/petstore-for-testing.yaml") + .setOutputDir(outputDir); + + generator = new DefaultGenerator(); + } + + @Test + public void defaultVersionTest() { + runVersionTest(null, null); + } + + @Test + public void customHelidonVersionOnlyTest() { + runVersionTest("3.0.0", null); + } + + @Test + public void customParentVersionOnlyTest() { + runVersionTest(null, "3.0.0"); + } + + @Test + public void bothEqualsVersionTest() { + runVersionTest("3.0.0", "3.0.0"); + } + + @Test + public void bothNotEqualsVersionTest() { + IllegalArgumentException e = Assert.assertThrows(IllegalArgumentException.class,() -> runVersionTest("1.0.0", "2.0.0")); + Assert.assertEquals( + "Both parentVersion and helidonVersion properties were set with different value.", + e.getMessage()); + } + + private void runVersionTest(String helidonVersion, String parentVersion) { + Map additionalProperties = new HashMap<>(); + String expected = "3.0.1"; + if (parentVersion != null) { + additionalProperties.put(CodegenConstants.PARENT_VERSION, parentVersion); + expected = parentVersion; + } + if (helidonVersion != null) { + additionalProperties.put("helidonVersion", helidonVersion); + expected = helidonVersion; + } + generator.opts(configurator.setAdditionalProperties(additionalProperties) + .toClientOptInput()); + List files = generator.generate(); + + TestUtils.ensureContainsFile(files, Paths.get(outputDir).toFile(), "pom.xml"); + TestUtils.assertFileContains(Paths.get(outputDir + "/pom.xml"), + String.format(Locale.ROOT, "%s", expected)); + } + +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpClientCodegenTest.java new file mode 100644 index 00000000000..28a03cd6944 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpClientCodegenTest.java @@ -0,0 +1,97 @@ +package org.openapitools.codegen.java.helidon; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; + +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import static org.openapitools.codegen.java.assertions.JavaFileAssert.assertThat; + +public class JavaHelidonMpClientCodegenTest { + + private String outputPath; + private List generatedFiles; + + @BeforeClass + public void setup() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + outputPath = output.getAbsolutePath().replace('\\', '/'); + + System.out.println("Generating java-helidon-client MP project in " + outputPath); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java-helidon-client") + .setLibrary("mp") + .setInputSpec("src/test/resources/3_0/helidon/petstore-no-multipart-for-testing.yaml") + .setOutputDir(outputPath); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + generator.opts(clientOptInput); + generatedFiles = generator.generate(); + } + + @Test + public void testPom() { + TestUtils.ensureContainsFile(generatedFiles, new File(outputPath), "pom.xml"); + } + + @Test + public void testPetApi() { + assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/client/api/PetApi.java")) + .assertMethod("addPet", "Pet") + .toFileAssert() + .assertMethod("deletePet", "Long", "String", "Long", "String", "Integer", + "List", "List") + .toFileAssert() + .assertMethod("findPetsByStatus", "List") + .toFileAssert() + .assertMethod("findPetsByTags", "List") + .toFileAssert() + .assertMethod("getPetById", "Long") + .toFileAssert() + .assertMethod("updatePet", "Pet") + .toFileAssert() + .assertMethod("updatePetWithForm", "Long", "String", "String") + .toFileAssert(); + } + + @Test + public void testStoreApi() { + assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/client/api/StoreApi.java")) + .assertMethod("deleteOrder", "String") + .toFileAssert() + .assertMethod("getInventory") + .toFileAssert() + .assertMethod("getOrderById", "BigDecimal") + .toFileAssert() + .assertMethod("placeOrder", "Order") + .toFileAssert(); + } + + @Test + public void testUserApi() { + assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/client/api/UserApi.java")) + .assertMethod("createUser", "User") + .toFileAssert() + .assertMethod("createUsersWithArrayInput", "List") + .toFileAssert() + .assertMethod("createUsersWithListInput", "List") + .toFileAssert() + .assertMethod("getUserByName", "String") + .toFileAssert() + .assertMethod("loginUser", "String", "String", "String", "Long", "BigDecimal") + .toFileAssert() + .assertMethod("updateUser", "String", "User") + .toFileAssert(); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpServerCodegenTest.java new file mode 100644 index 00000000000..599ef9f43d6 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpServerCodegenTest.java @@ -0,0 +1,192 @@ +package org.openapitools.codegen.java.helidon; + +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.java.assertions.JavaFileAssert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Objects; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import static org.openapitools.codegen.CodegenConstants.SERIALIZATION_LIBRARY; + +public class JavaHelidonMpServerCodegenTest { + + private DefaultGenerator generator; + private String outputPath; + private String apiPackage; + private String modelPackage; + + @BeforeMethod + public void setup() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + outputPath = output.getAbsolutePath().replace('\\', '/'); + apiPackage = outputPath + "/src/main/java/org/openapitools/server/api"; + modelPackage = outputPath + "/src/main/java/org/openapitools/server/model"; + generator = new DefaultGenerator(); + } + + private CodegenConfigurator createConfigurator() { + return new CodegenConfigurator() + .setGeneratorName("java-helidon-server") + .setLibrary("mp") + .setInputSpec("src/test/resources/3_0/helidon/petstore-for-testing.yaml") + .setOutputDir(outputPath); + } + + private void generate(CodegenConfigurator config) { + generator.opts(config.toClientOptInput()); + generator.setGenerateMetadata(false); + generator.generate(); + } + + private void generate() { + generate(createConfigurator()); + } + + @Test + public void testRestApiFilesOnly() { + generate(createConfigurator().addAdditionalProperty("fullProject", "false")); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/PetService.java")) + .fileContains("public interface PetService"); + + File outputFile = Paths.get(outputPath).toFile(); + assertThat(Objects.requireNonNull(outputFile.listFiles()).length, is(1)); + } + + @Test + public void testJackson() { + generate(createConfigurator().addAdditionalProperty(SERIALIZATION_LIBRARY, "jackson")); + + JavaFileAssert.assertThat(Paths.get(modelPackage + "/Color.java")) + .fileContains("com.fasterxml.jackson.annotation.JsonCreator") + .fileContains("com.fasterxml.jackson.annotation.JsonValue"); + } + + @Test + public void testJsonb() { + generate(createConfigurator().addAdditionalProperty(SERIALIZATION_LIBRARY, "jsonb")); + + JavaFileAssert.assertThat(Paths.get(modelPackage + "/Color.java")) + .fileContains(".json.bind.annotation.JsonbCreator"); + } + + @Test + public void testAbstractClass() { + generate(createConfigurator().addAdditionalProperty("useAbstractClass", "true")); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/PetService.java")) + .fileContains("public abstract class PetService") + .assertMethod("addPet", "Pet") + .doesNotHaveImplementation(); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/StoreService.java")) + .fileContains("public abstract class StoreService") + .assertMethod("placeOrder", "Order") + .doesNotHaveImplementation() + .hasReturnType("Response"); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/StoreServiceImpl.java")) + .fileContains("public class StoreServiceImpl extends StoreService") + .assertMethod("placeOrder", "Order") + .hasReturnType("Response") + .bodyContainsLines("return Response.ok().entity(\"magic!\").build();"); + } + + @Test + public void testFullProject() { + generate(createConfigurator().addAdditionalProperty("fullProject", "true")); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/PetService.java")) + .fileContains("public interface PetService") + .assertMethod("addPet", "Pet"); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/StoreService.java")) + .fileContains("public interface StoreService") + .assertMethod("placeOrder", "Order") + .hasReturnType("Response"); + } + + @Test + public void validatePetApi() { + generate(); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/PetService.java")) + .fileContains("org.openapitools.server.model.Pet") + .assertMethod("addPet", "Pet") + .toFileAssert() + .assertMethod("addPets", "String", "InputStream", "InputStream", "List", "List", "Integer") + .toFileAssert() + .assertMethod("deletePet", "Long", "String", "Long", "String", "Integer", "List", "List") + .toFileAssert() + .assertMethod("findPetsByStatus", "List") + .toFileAssert() + .assertMethod("findPetsByTags", "List") + .toFileAssert() + .assertMethod("getPetById", "Long") + .toFileAssert() + .assertMethod("updatePet", "Pet") + .toFileAssert() + .assertMethod("updatePetWithForm", "Long", "String", "String") + .toFileAssert() + .assertMethod("uploadFile", "Long", "Long", "String", "InputStream"); + } + + @Test + public void validateStoreApi() { + generate(); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/StoreService.java")) + .fileContains("org.openapitools.server.model.Order") + .assertMethod("deleteOrder", "String") + .toFileAssert() + .assertMethod("getInventory") + .toFileAssert() + .assertMethod("getOrderById", "BigDecimal") + .toFileAssert() + .assertMethod("placeOrder", "Order"); + } + + @Test + public void validateUserApi() { + generate(); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/UserService.java")) + .fileContains("org.openapitools.server.model.User") + .assertMethod("createUser", "User") + .toFileAssert() + .assertMethod("createUsersWithArrayInput", "List") + .toFileAssert() + .assertMethod("createUsersWithListInput", "List") + .toFileAssert() + .assertMethod("deleteUser", "String") + .toFileAssert() + .assertMethod("getUserByName", "String") + .toFileAssert() + .assertMethod("loginUser", "String", "String", "String", "Long", "BigDecimal") + .toFileAssert() + .assertMethod("logoutUser") + .toFileAssert() + .assertMethod("updateUser", "String", "User"); + } + + @Test + public void testGenerateGradleProject() { + generate(createConfigurator().addAdditionalProperty("gradleProject", "true")); + + assertThat(Paths.get(outputPath + "/build.gradle").toFile().exists(), is(true)); + assertThat(Paths.get(outputPath + "/settings.gradle").toFile().exists(), is(true)); + TestUtils.assertFileNotExists(Paths.get(outputPath + "/pom.xml")); + } + +} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeClientCodegenTest.java new file mode 100644 index 00000000000..8ce80c3aca6 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeClientCodegenTest.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.openapitools.codegen.java.helidon; + +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; + +import static org.openapitools.codegen.java.assertions.JavaFileAssert.assertThat; + +public class JavaHelidonSeClientCodegenTest { + + private String outputPath; + private List generatedFiles; + + @BeforeClass + public void setup() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + outputPath = output.getAbsolutePath().replace('\\', '/'); + + System.out.println("Generating java-helidon-client SE project in " + outputPath); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setGeneratorName("java-helidon-client") + .setLibrary("se") + .setInputSpec("src/test/resources/3_0/helidon/petstore-no-multipart-for-testing.yaml") + .setOutputDir(outputPath); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + DefaultGenerator generator = new DefaultGenerator(); + generator.opts(clientOptInput); + generatedFiles = generator.generate(); + } + + @DataProvider(name = "fileSuffix") + public Object[][] fileSuffixes() { + return new Object[][] { + {""}, + {"Impl"} + }; + } + + @Test + public void testPom() { + TestUtils.ensureContainsFile(generatedFiles, new File(outputPath), "pom.xml"); + } + + @Test(dataProvider = "fileSuffix") + public void testPetApi(String fileSuffix) { + assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/client/api/PetApi" + fileSuffix + ".java")) + .assertMethod("addPet", "Pet") + .toFileAssert() + .assertMethod("deletePet", "Long", "String", "Long", "String", "Integer", + "List", "List") + .toFileAssert() + .assertMethod("findPetsByStatus", "List") + .toFileAssert() + .assertMethod("findPetsByTags", "List") + .toFileAssert() + .assertMethod("getPetById", "Long") + .toFileAssert() + .assertMethod("updatePet", "Pet") + .toFileAssert() + .assertMethod("updatePetWithForm", "Long", "String", "String") + .toFileAssert(); + } + + @Test(dataProvider = "fileSuffix") + public void testStoreApi(String fileSuffix) { + assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/client/api/StoreApi" + fileSuffix + ".java")) + .assertMethod("deleteOrder", "String") + .toFileAssert() + .assertMethod("getInventory") + .toFileAssert() + .assertMethod("getOrderById", "BigDecimal") + .toFileAssert() + .assertMethod("placeOrder", "Order") + .toFileAssert(); + } + + @Test(dataProvider = "fileSuffix") + public void testUserApi(String fileSuffix) { + assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/client/api/UserApi" + fileSuffix + ".java")) + .assertMethod("createUser", "User") + .toFileAssert() + .assertMethod("createUsersWithArrayInput", "List") + .toFileAssert() + .assertMethod("createUsersWithListInput", "List") + .toFileAssert() + .assertMethod("getUserByName", "String") + .toFileAssert() + .assertMethod("loginUser", "String", "String", "String", "Long", "BigDecimal") + .toFileAssert() + .assertMethod("updateUser", "String", "User") + .toFileAssert(); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeServerCodegenTest.java new file mode 100644 index 00000000000..fb629a114ed --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeServerCodegenTest.java @@ -0,0 +1,289 @@ +package org.openapitools.codegen.java.helidon; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; + +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.Generator; +import org.openapitools.codegen.TestUtils; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.java.assertions.JavaFileAssert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import static org.testng.Assert.assertTrue; + +public class JavaHelidonSeServerCodegenTest { + + private DefaultGenerator generator; + private String outputPath; + + @BeforeMethod + public void setup() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + outputPath = output.getAbsolutePath().replace('\\', '/'); + + final CodegenConfigurator configurator = codegenConfigurator(new HashMap<>()); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + generator = new DefaultGenerator(); + generator.opts(clientOptInput); + } + + private CodegenConfigurator codegenConfigurator(Map additionalProperties) { + return new CodegenConfigurator() + .setGeneratorName("java-helidon-server") + .setLibrary("se") + .setAdditionalProperties(additionalProperties) + .setInputSpec("src/test/resources/3_0/helidon/petstore-for-testing.yaml") + .setOutputDir(outputPath); + } + + + @Test + public void testGenerateFullProject() { + generator.generate(); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/server/api/PetServiceImpl.java")) + .fileContains( + "public class PetServiceImpl", + "response.status(HTTP_CODE_NOT_IMPLEMENTED).send();" + ); + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/server/Main.java")) + .fileContains( + "import org.openapitools.server.api.PetServiceImpl;", + ".register(\"/\", new PetServiceImpl())" + ); + } + + @Test + public void testGenerateProjectByDefault() { + generator.generate(); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/server/api/PetService.java")) + .fileContains( + "public interface PetService extends Service {", + "default void update(Routing.Rules rules) {", + "void addPet(ServerRequest request, ServerResponse response, Pet pet);", + "void deletePet(ServerRequest request, ServerResponse response);" + ); + TestUtils.assertFileNotExists(Paths.get(outputPath + "/build.gradle")); + TestUtils.assertFileNotExists(Paths.get(outputPath + "/settings.gradle")); + } + + @Test + public void testGenerateGradleProject() { + Map additionalProperties = new HashMap<>(); + additionalProperties.put("gradleProject", true); + final CodegenConfigurator configurator = codegenConfigurator(additionalProperties); + generator.opts(configurator.toClientOptInput()).generate(); + + assertTrue(Paths.get(outputPath + "/build.gradle").toFile().exists()); + assertTrue(Paths.get(outputPath + "/settings.gradle").toFile().exists()); + TestUtils.assertFileNotExists(Paths.get(outputPath + "/pom.xml")); + } + + @Test + public void testGeneratePathParams() throws IOException { + Map additionalProperties = new HashMap<>(); + additionalProperties.put("useAbstractClass", true); + final CodegenConfigurator configurator = codegenConfigurator(additionalProperties); + generator.opts(configurator.toClientOptInput()).generate(); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/server/api/PetService.java")) + .assertMethod("deletePet", "ServerRequest", "ServerResponse") + .bodyContainsLines( + "Long petId = Optional.ofNullable(request.path().param(\"petId\")).map(Long::valueOf).orElse" + + "(null);", + "ValidatorUtils.checkNonNull(petId);" + ) + .toFileAssert() + .assertMethod("getPetById") + .bodyContainsLines( + "Long petId = Optional.ofNullable(request.path().param(\"petId\")).map(Long::valueOf).orElse" + + "(null);", + "ValidatorUtils.checkNonNull(petId);" + ); + } + + @Test + public void testGenerateQueryParams() throws IOException { + Map additionalProperties = new HashMap<>(); + additionalProperties.put("useAbstractClass", true); + final CodegenConfigurator configurator = codegenConfigurator(additionalProperties); + generator.opts(configurator.toClientOptInput()).generate(); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/server/api/PetService.java")) + .fileContains("import java.util.List;") + .assertMethod("findPetsByTags") + .bodyContainsLines( + "List tags = Optional.ofNullable(request.queryParams().toMap().get(\"tags\"))" + + ".orElse(null);", + "ValidatorUtils.checkNonNull(tags);" + ) + .toFileAssert() + .assertMethod("findPetsByStatus") + .bodyContainsLines( + "List status = Optional.ofNullable(request.queryParams().toMap().get(\"status\")).orElse" + + "(null);", + "ValidatorUtils.checkNonNull(status);" + ); + } + + @Test + public void testGenerateBodyParams() throws IOException { + Map additionalProperties = new HashMap<>(); + additionalProperties.put("useAbstractClass", true); + final CodegenConfigurator configurator = codegenConfigurator(additionalProperties); + generator.opts(configurator.toClientOptInput()).generate(); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/server/api/PetService.java")) + .assertMethod("update") + .bodyContainsLines( + "rules.post(\"/pet\", Handler.create(Pet.class, this::addPet));", + "rules.put(\"/pet\", Handler.create(Pet.class, this::updatePet));" + ) + .toFileAssert() + .assertMethod("addPet", "ServerRequest", "ServerResponse", "Pet") + .bodyContainsLines( + "ValidatorUtils.checkNonNull(pet);", + "handleAddPet(request, response, pet);" + ) + .toFileAssert() + .assertMethod("updatePet", "ServerRequest", "ServerResponse", "Pet") + .bodyContainsLines( + "ValidatorUtils.checkNonNull(pet);", + "handleUpdatePet(request, response, pet);" + ); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/server/api/UserService.java")) + .assertMethod("update") + .bodyContainsLines( + "rules.post(\"/user\", Handler.create(User.class, this::createUser));", + "rules.post(\"/user/createWithArray\", this::createUsersWithArrayInput);", + "rules.post(\"/user/createWithList\", this::createUsersWithListInput);", + "rules.put(\"/user/{username}\", Handler.create(User.class, this::updateUser));" + ) + .toFileAssert() + .assertMethod("createUser", "ServerRequest", "ServerResponse", "User") + .bodyContainsLines( + "ValidatorUtils.checkNonNull(user);", + "handleCreateUser(request, response, user);" + ) + .toFileAssert() + .assertMethod("createUsersWithArrayInput", "ServerRequest", "ServerResponse") + .bodyContainsLines( + "Single.create(request.content().as(new GenericType>() { }))", + ".thenAccept(user -> {", + "ValidatorUtils.checkNonNull(user);", + "handleCreateUsersWithArrayInput(request, response, user);", + ".exceptionally(throwable -> handleError(request, response, throwable));" + ); + } + + @Test + public void testGenerateHeaderParams() throws IOException { + Map additionalProperties = new HashMap<>(); + additionalProperties.put("useAbstractClass", true); + final CodegenConfigurator configurator = codegenConfigurator(additionalProperties); + generator.opts(configurator.toClientOptInput()).generate(); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/server/api/PetService.java")) + .assertMethod("deletePet", "ServerRequest", "ServerResponse") + .bodyContainsLines( + "String apiKey = request.headers().value(\"api_key\").orElse(null);", + "Long headerLong = request.headers().value(\"headerLong\").map(Long::valueOf).orElse(null);", + "ValidatorUtils.checkNonNull(headerLong);" + ); + } + + @Test + public void testGenerateCookiesParams() throws IOException { + Map additionalProperties = new HashMap<>(); + additionalProperties.put("useAbstractClass", true); + final CodegenConfigurator configurator = codegenConfigurator(additionalProperties); + generator.opts(configurator.toClientOptInput()).generate(); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/server/api/PetService.java")) + .assertMethod("deletePet", "ServerRequest", "ServerResponse") + .bodyContainsLines( + "String cookieString = request.headers().cookies().toMap().getOrDefault(\"cookieString\", List.of" + + "()).stream().findFirst().orElse(null);", + "ValidatorUtils.checkNonNull(cookieString);", + "Integer cookieInt = request.headers().cookies().toMap().getOrDefault(\"cookieInt\", List.of())" + + ".stream().findFirst().map(Integer::valueOf).orElse(null);", + "List cookieIntArray = Optional.ofNullable(request.headers().cookies().toMap().get" + + "(\"cookieIntArray\")).orElse(null);", + "List cookieStringArray = Optional.ofNullable(request.headers().cookies().toMap().get" + + "(\"cookieStringArray\")).orElse(null);" + ); + } + + @Test + public void testGenerateFormParams() throws IOException { + Map additionalProperties = new HashMap<>(); + additionalProperties.put("useAbstractClass", true); + final CodegenConfigurator configurator = codegenConfigurator(additionalProperties); + generator.opts(configurator.toClientOptInput()).generate(); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/server/api/PetService.java")) + .assertMethod("addPets", "ServerRequest", "ServerResponse") + .bodyContainsLines( + "Map> nonFileFormContent = new HashMap<>();", + "Map> fileFormContent = new HashMap<>();", + " Single formSingle = request.content().asStream(ReadableBodyPart.class)", + "if (\"images[]\".equals(name)) {", + "processFileFormField(name, fileFormContent, part);", + "if (\"image\".equals(name)) {", + "if (\"titles[]\".equals(name)) {", + "processNonFileFormField(name, nonFileFormContent, part);", + "if (\"longArray\".equals(name)) {", + "if (\"stringParam\".equals(name)) {", + "if (\"intParam\".equals(name)) {", + "List images = Optional.ofNullable(fileFormContent.get(\"images[]\")).orElse(null);", + "InputStream image = Optional.ofNullable(fileFormContent.get(\"image\")).flatMap(list->list" + + ".stream().findFirst()).orElse(null);", + "List titles = Optional.ofNullable(nonFileFormContent.get(\"titles[]\")).orElse(null);", + "List longArray = Optional.ofNullable(nonFileFormContent.get(\"longArray\")).orElse(null);", + "Integer intParam = Optional.ofNullable(nonFileFormContent.get(\"intParam\")).flatMap(list->list" + + ".stream().findFirst()).map(Integer::valueOf).orElse(null);" + ); + } + + @Test + public void testGenerateParamsValidation() throws IOException { + Map additionalProperties = new HashMap<>(); + additionalProperties.put("useAbstractClass", true); + final CodegenConfigurator configurator = codegenConfigurator(additionalProperties); + generator.opts(configurator.toClientOptInput()).generate(); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/server/api/PetService.java")) + .assertMethod("findPetsByStatus") + .bodyContainsLines( + "ValidatorUtils.checkNonNull(status);", + "List status = Optional.ofNullable(request.queryParams().toMap().get(\"status\")).orElse" + + "(null);" + ) + .toFileAssert() + .assertMethod("findPetsByTags") + .bodyContainsLines( + "List tags = Optional.ofNullable(request.queryParams().toMap().get(\"tags\")).orElse" + + "(null);", + "ValidatorUtils.checkNonNull(tags);" + ); + + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/server/api/UserService.java")) + .assertMethod("loginUser") + .bodyContainsLines( + "ValidatorUtils.validatePattern(username, \"^[a-zA-Z0-9]+[a-zA-Z0-9\\\\" + + ".\\\\-_]*[a-zA-Z0-9]+$\");", + "" + ); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalBase.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalBase.java new file mode 100644 index 00000000000..c7094725ad1 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalBase.java @@ -0,0 +1,360 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.java.helidon.functional; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.config.CodegenConfigurator; +import org.openapitools.codegen.languages.JavaHelidonCommonCodegen; +import org.testng.SkipException; + +import static java.util.Objects.requireNonNull; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +abstract class FunctionalBase { + + private static final Logger LOGGER = Logger.getLogger(FunctionalBase.class.getName()); + + private static final String MAVEN_SHIM_TARGET = "libexec/bin/mvn"; + private static final String MAVEN_HOME_VAR = "MAVEN_HOME"; + private static final String MVN_HOME_VAR = "MVN_HOME"; + private static final String PATH_VAR = "PATH"; + private static final String MAVEN_BINARY_NAME; + private static final boolean IS_WINDOWS_OS; + private static final List> DEFAULT_HELIDON_VERSIONS_FOR_JAVA_VERSIONS = new ArrayList<>(); + + protected static final String FULL_PROJECT = "fullProject"; + protected static final String USE_ABSTRACT_CLASS = "useAbstractClass"; + + static { + /* + The inferred Helidon version for tests is from the entry for which the Java major version does not exceed + the current runtime Java major version. + + For example, for Java 8 or 9 or 11: 2.5.3. For Java 13 or later: 3.0.1. + */ + DEFAULT_HELIDON_VERSIONS_FOR_JAVA_VERSIONS.add(new AbstractMap.SimpleEntry<>(11, "2.5.3")); + DEFAULT_HELIDON_VERSIONS_FOR_JAVA_VERSIONS.add(new AbstractMap.SimpleEntry<>(13, "3.0.1")); + } + + private String library; + private String generatorName; + private String inputSpec; + protected Path outputPath; + + private Path mvn; + + static { + IS_WINDOWS_OS = System.getProperty("os.name", "unknown") + .toLowerCase(Locale.ENGLISH) + .contains("win"); + MAVEN_BINARY_NAME = IS_WINDOWS_OS ? "mvn.cmd" : "mvn"; + } + + protected CodegenConfigurator createConfigurator() { + try { + return createConfigurator(Files.createTempDirectory("test")); + } catch (IOException e) { + throw new UncheckedIOException("Can not create temp directory", e); + } + } + + protected CodegenConfigurator createConfigurator(Path outputPath) { + Objects.requireNonNull(inputSpec); + this.outputPath = outputPath; + String sanitizedPath = outputPath.toFile() + .getAbsolutePath() + .replace('\\', '/'); + return new CodegenConfigurator() + .setGeneratorName(generatorName) + .setLibrary(library) + .setInputSpec(inputSpec) + .setOutputDir(sanitizedPath); + + } + + protected void generate(CodegenConfigurator config) { + String helidonVersionToUse = chooseHelidonVersion(config); + enforceJavaVersion(helidonVersionToUse); + DefaultGenerator generator = new DefaultGenerator(); + generator.opts(config.toClientOptInput()); + generator.generate(); + } + + protected void generate() { + generate(createConfigurator()); + } + + protected void generate(String inputSpec) { + inputSpec(inputSpec); + generate(createConfigurator()); + } + + protected void generatorName(String generatorName) { + this.generatorName = generatorName; + } + + protected void library(String library) { + this.library = library; + } + + protected void inputSpec(String inputSpec) { + this.inputSpec = inputSpec; + } + + /** + * Run maven command with provided arguments. + * + * @param args maven command arguments + * @return a {@link ProcessReader} + */ + protected ProcessReader runMavenProcess(String... args) { + return runMavenProcess(outputPath.toFile(), args); + } + + /** + * Run maven command and causes the current thread to wait for {@link Process} to terminate. + * + * @param args maven command arguments + * @return a {@link ProcessReader} + */ + protected ProcessReader runMavenProcessAndWait(String... args) { + ProcessReader process = runMavenProcess(args); + process.waitFor(10, TimeUnit.MINUTES); + return process; + } + + /** + * Run maven command in the provided directory. + * + * @param directory from where the command is executed + * @param args maven command arguments + * @return a {@link ProcessReader} + */ + protected ProcessReader runMavenProcess(File directory, String... args) { + List command = new ArrayList<>(Collections.singleton(mavenExecutable())); + Collections.addAll(command, args); + try { + Process process = new ProcessBuilder() + .directory(directory) + .command(command) + .start(); + return new ProcessReader(process); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + /** + * Finds the {@code mvn} executable. Searches using the following, in order: + *
    + *
  1. The {@code MAVEN_HOME} environment variable
  2. + *
  3. The {@code MVN_HOME} environment variable
  4. + *
  5. The {@code PATH} environment variable
  6. + *
+ * + * @return The path. + */ + public String mavenExecutable() { + if (mvn == null) { + Path maven; + Optional path = findExecutableInPath(); + if (path.isPresent()) { + maven = path.get(); + } else { + maven = toMavenExecutable(MAVEN_HOME_VAR); + if (maven == null) { + maven = toMavenExecutable(MVN_HOME_VAR); + } + } + try { + assumeTrue( "Maven not found, test is skipped", maven != null); + maven = maven.toRealPath(); + Path shimmed = maven.getParent().getParent().resolve(MAVEN_SHIM_TARGET); + if (Files.exists(shimmed)) { + maven = shimmed; + } + mvn = maven.toRealPath(); + } catch (IOException ex) { + throw new IllegalStateException(ex.getMessage()); + } + } + return mvn.toString(); + } + + private String chooseHelidonVersion(CodegenConfigurator config) { + Map unprocessedAdditionalProperties = config.toContext() + .getGeneratorSettings() + .getAdditionalProperties(); + if (unprocessedAdditionalProperties.containsKey(JavaHelidonCommonCodegen.HELIDON_VERSION)) { + return unprocessedAdditionalProperties.get(JavaHelidonCommonCodegen.HELIDON_VERSION).toString(); + } + String result = inferredHelidonVersion(); + config.addAdditionalProperty(JavaHelidonCommonCodegen.HELIDON_VERSION, result); + return result; + } + + private void enforceJavaVersion(String helidonVersionToUse) { + int currentJavaVersion = getCurrentJavaMajorVersion(); + int requiredJavaVersion = getRequiredJavaVersion(helidonVersionToUse); + String errorJavaVersion = String.format(Locale.ROOT, "Java version must be %s, test is skipped", requiredJavaVersion); + assumeTrue(errorJavaVersion, currentJavaVersion == requiredJavaVersion); + } + + private int getRequiredJavaVersion(String helidonVersionToUse) { + return helidonVersionToUse + .startsWith("3.") ? 17 : 11; + } + + private int getCurrentJavaMajorVersion() { + String[] versionElements = System.getProperty("java.version").split("\\."); + int firstElement = Integer.parseInt(versionElements[0]); + if (firstElement == 1) { + return Integer.parseInt(versionElements[1]); + } else { + return firstElement; + } + } + + private String inferredHelidonVersion() { + int javaMajorVersion = getCurrentJavaMajorVersion(); + String result = null; + for (Map.Entry javaToHelidonVersionMapping : DEFAULT_HELIDON_VERSIONS_FOR_JAVA_VERSIONS) { + if (javaToHelidonVersionMapping.getKey() <= javaMajorVersion) { + result = javaToHelidonVersionMapping.getValue(); + } + } + if (result == null) { + String message = String.format(Locale.ROOT, "Unable to infer Helidon version from current Java major version %d using mapping %s", + javaMajorVersion, DEFAULT_HELIDON_VERSIONS_FOR_JAVA_VERSIONS); + LOGGER.log(Level.WARNING, message); + throw new SkipException(message); + } + return result; + } + + /** + * Find an executable in the {@code PATH} environment variable, if present. + * + * @return The path. + */ + private Optional findExecutableInPath() { + return Arrays.stream(requireNonNull(System.getenv(PATH_VAR)).split(File.pathSeparator)) + .map(Paths::get) + .map(path -> path.resolve(FunctionalBase.MAVEN_BINARY_NAME)) + .filter(Files::isExecutable) + .findFirst(); + } + + private Path toMavenExecutable(String mavenHomeEnvVar) { + Path mavenHome = envVarPath(mavenHomeEnvVar); + if (mavenHome != null) { + if (Files.isDirectory(mavenHome)) { + Path executable = mavenHome.resolve("bin").resolve(MAVEN_BINARY_NAME); + if (Files.exists(executable) && (IS_WINDOWS_OS || Files.isExecutable(executable))) { + return executable; + } + } + } + return null; + } + + private static Path envVarPath(String var) { + final String path = System.getenv(var); + return path == null ? null : Paths.get(path); + } + + /** + * Allow junit to skip test without throwing an exception and report tests as failed. + * + * @param message warning message + * @param condition to be checked + */ + protected static void assumeTrue(String message, boolean condition) { + if (!condition) { + LOGGER.log(Level.WARNING, message); + throw new SkipException(message); + } + } + + /** + * Convenience method to build project using Maven and verify test output. + * + * @param jarPath path to expected jar file + */ + protected void buildAndVerify(String jarPath) { + ProcessReader reader = runMavenProcessAndWait("package"); + Path executableJar = outputPath.resolve(jarPath); + String output = reader.readOutputConsole(); + assertThat(output, containsString("BUILD SUCCESS")); + assertThat(output, containsString("Errors: 0")); + assertThat(output, containsString("Failures: 0")); + assertThat(output, containsString("Skipped: 0")); + assertThat(Files.exists(executableJar), is(true)); + } + + /** + * {@link Process} wrapper to read I/O Stream. + */ + static class ProcessReader { + + private final Process process; + private final BufferedReader consoleReader; + + ProcessReader(Process process) { + this.process = process; + this.consoleReader = new BufferedReader(new InputStreamReader(process.getInputStream(), StandardCharsets.UTF_8)); + } + + public String readOutputConsole() { + return consoleReader.lines().collect(Collectors.joining("\n")); + } + + @SuppressWarnings("UnusedReturnValue") + public boolean waitFor(long timeout, TimeUnit unit) { + try { + return process.waitFor(timeout, unit); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonClientBase.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonClientBase.java new file mode 100644 index 00000000000..a3997aea8e3 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonClientBase.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.openapitools.codegen.java.helidon.functional; + +import org.testng.annotations.Test; + +import java.nio.file.Files; +import java.nio.file.Path; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; + +public class FunctionalHelidonClientBase extends FunctionalBase { + @Test + void buildPetstore() { + generate("src/test/resources/3_0/petstore.yaml"); + buildAndVerify("target/openapi-java-client.jar"); + } + + @Test + void buildPetstoreWithFakeEndpoints() { + generate("src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml"); + buildAndVerify("target/openapi-java-client.jar"); + } + + @Test + void buildPetstoreNoMultipart() { + generate("src/test/resources/3_0/helidon/petstore-no-multipart-for-testing.yaml"); + buildAndVerify("target/openapi-java-client.jar"); + } + + @Test + void verifyFullProjectSemantics() { + inputSpec("src/test/resources/3_0/petstore.yaml"); + + // Generate project for first time and record pom's timestamp + generate(createConfigurator()); + buildAndVerify("target/openapi-java-client.jar"); + Path pom1 = outputPath.resolve("pom.xml"); + assertThat(Files.exists(pom1), is(true)); + long lastModified = pom1.toFile().lastModified(); + + // Re-generate project over same directory with fullProject unspecified + generate(createConfigurator(outputPath)); + Path pom2 = outputPath.resolve("pom.xml"); + assertThat(Files.exists(pom2), is(true)); + assertThat(pom2.toFile().lastModified(), is(lastModified)); // not overwritten + + // Re-generate project over same directory with fullProject false + generate(createConfigurator(outputPath).addAdditionalProperty(FULL_PROJECT, "false")); + Path pom3 = outputPath.resolve("pom.xml"); + assertThat(Files.exists(pom3), is(true)); + assertThat(pom3.toFile().lastModified(), is(lastModified)); // not overwritten + + // Re-generate project over same directory with fullProject true + generate(createConfigurator(outputPath).addAdditionalProperty(FULL_PROJECT, "true")); + Path pom4 = outputPath.resolve("pom.xml"); + assertThat(Files.exists(pom4), is(true)); + assertThat(pom4.toFile().lastModified(), is(not(lastModified))); // overwritten + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPClientTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPClientTest.java new file mode 100644 index 00000000000..2837e5f69b8 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPClientTest.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.java.helidon.functional; + +import org.testng.annotations.BeforeClass; + +public class FunctionalHelidonMPClientTest extends FunctionalHelidonClientBase { + + @BeforeClass + public void setup() { + library("mp"); + generatorName("java-helidon-client"); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPServerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPServerTest.java new file mode 100644 index 00000000000..2f62ffcab7d --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPServerTest.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.java.helidon.functional; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.nio.file.Files; +import java.nio.file.Path; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.openapitools.codegen.CodegenConstants.SERIALIZATION_LIBRARY; + +public class FunctionalHelidonMPServerTest extends FunctionalBase { + + @BeforeClass + public void setup() { + library("mp"); + generatorName("java-helidon-server"); + inputSpec("src/test/resources/3_0/helidon/petstore-for-testing.yaml"); + } + + @Test + void buildProjectDefaultOptions() { + generate(); + buildAndVerify("target/openapi-java-server.jar"); + } + + @Test + void buildProjectAbstractClasses() { + generate(createConfigurator().addAdditionalProperty(USE_ABSTRACT_CLASS, "true")); + buildAndVerify("target/openapi-java-server.jar"); + } + + @Test + void buildFullProject() { + generate(createConfigurator().addAdditionalProperty(FULL_PROJECT, "true")); + buildAndVerify("target/openapi-java-server.jar"); + } + + @Test + void verifyFullProjectSemantics() { + // Generate project for first time and record pom's timestamp + generate(createConfigurator()); + buildAndVerify("target/openapi-java-server.jar"); + Path pom1 = outputPath.resolve("pom.xml"); + assertThat(Files.exists(pom1), is(true)); + long lastModified = pom1.toFile().lastModified(); + + // Re-generate project over same directory with fullProject unspecified + generate(createConfigurator(outputPath)); + Path pom2 = outputPath.resolve("pom.xml"); + assertThat(Files.exists(pom2), is(true)); + assertThat(pom2.toFile().lastModified(), is(lastModified)); // not overwritten + + // Re-generate project over same directory with fullProject false + generate(createConfigurator(outputPath).addAdditionalProperty(FULL_PROJECT, "false")); + Path pom3 = outputPath.resolve("pom.xml"); + assertThat(Files.exists(pom3), is(true)); + assertThat(pom3.toFile().lastModified(), is(lastModified)); // not overwritten + + // Re-generate project over same directory with fullProject true + generate(createConfigurator(outputPath).addAdditionalProperty(FULL_PROJECT, "true")); + Path pom4 = outputPath.resolve("pom.xml"); + assertThat(Files.exists(pom4), is(true)); + assertThat(pom4.toFile().lastModified(), is(not(lastModified))); // overwritten + } + + @Test + void buildJsonbProject() { + generate(createConfigurator().addAdditionalProperty(SERIALIZATION_LIBRARY, "jsonb")); + buildAndVerify("target/openapi-java-server.jar"); + } + + @Test + void buildJacksonProject() { + generate(createConfigurator().addAdditionalProperty(SERIALIZATION_LIBRARY, "jackson")); + buildAndVerify("target/openapi-java-server.jar"); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSEClientTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSEClientTest.java new file mode 100644 index 00000000000..1a4341e5c65 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSEClientTest.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.java.helidon.functional; + + +import org.testng.annotations.BeforeClass; + +public class FunctionalHelidonSEClientTest extends FunctionalHelidonClientBase { + + @BeforeClass + public void setup() { + library("se"); + generatorName("java-helidon-client"); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSeServerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSeServerTest.java new file mode 100644 index 00000000000..3ef3bb45e95 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSeServerTest.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.java.helidon.functional; + +import java.nio.file.Files; +import java.nio.file.Path; + +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; + +public class FunctionalHelidonSeServerTest extends FunctionalBase { + + @BeforeClass + public void setup() { + library("se"); + generatorName("java-helidon-server"); + } + + @Test + void buildPetstoreWithDefaultOptions() { + generate("src/test/resources/3_0/petstore.yaml"); + buildAndVerify("target/openapi-java-server.jar"); + } + + @Test + void buildPetstoreWithAbstractClasses() { + inputSpec("src/test/resources/3_0/petstore.yaml"); + generate(createConfigurator().addAdditionalProperty(FunctionalBase.USE_ABSTRACT_CLASS, "true")); + buildAndVerify("target/openapi-java-server.jar"); + } + + @Test + void verifyFullProject() { + inputSpec("src/test/resources/3_0/petstore.yaml"); + + // Generate project for first time and record pom's timestamp + generate(createConfigurator()); + buildAndVerify("target/openapi-java-server.jar"); + Path pom1 = outputPath.resolve("pom.xml"); + assertThat(Files.exists(pom1), is(true)); + long lastModified = pom1.toFile().lastModified(); + + // Re-generate project over same directory with fullProject unspecified + generate(createConfigurator(outputPath)); + Path pom2 = outputPath.resolve("pom.xml"); + assertThat(Files.exists(pom2), is(true)); + assertThat(pom2.toFile().lastModified(), is(lastModified)); // not overwritten + + // Re-generate project over same directory with fullProject false + generate(createConfigurator(outputPath).addAdditionalProperty(FULL_PROJECT, "false")); + Path pom3 = outputPath.resolve("pom.xml"); + assertThat(Files.exists(pom3), is(true)); + assertThat(pom3.toFile().lastModified(), is(lastModified)); // not overwritten + + // Re-generate project over same directory with fullProject true + generate(createConfigurator(outputPath).addAdditionalProperty(FULL_PROJECT, "true")); + Path pom4 = outputPath.resolve("pom.xml"); + assertThat(Files.exists(pom4), is(true)); + assertThat(pom4.toFile().lastModified(), is(not(lastModified))); // overwritten + } +} diff --git a/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-for-testing.yaml new file mode 100644 index 00000000000..7384758e953 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-for-testing.yaml @@ -0,0 +1,860 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.helidon.io:8080/v2' +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. For this sample, you can use the api key + `special-key` to test the authorization filters. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/schemas/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: integer + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: headerLong + in: header + required: true + schema: + type: integer + format: int64 + - name: cookieString + in: cookie + schema: + type: string + required: true + - name: cookieInt + in: cookie + schema: + type: integer + format: int32 + required: false + - name: cookieIntArray + in: cookie + schema: + type: array + items: + type: integer + required: false + - name: cookieStringArray + in: cookie + schema: + type: array + items: + type: string + required: false + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + - name: petDate + in: path + description: Date for test + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /pet/upload: + post: + tags: + - pet + summary: Add a few pets using form + description: '' + operationId: addPets + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/PetsForm' + description: Object that that contains info about pets + required: true + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{orderId}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: number + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + - name: sizeString + in: query + description: String param to test Size constraint + required: true + schema: + type: string + minLength: 5 + maxLength: 10 + - name: minLong + in: query + description: Min Long param for test + required: true + schema: + type: integer + format: int64 + minimum: 10 + - name: minDecimal + in: query + description: Min Decimal param for test + required: true + schema: + type: number + minimum: 0 + exclusiveMinimum: true + responses: + '200': + description: successful operation + headers: + Set-Cookie: + description: >- + Cookie authentication key for use with the `api_key` + apiKey authentication. + schema: + type: string + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - api_key: [] +externalDocs: + description: Find out more about Swagger + url: 'http://swagger.io' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + schemas: + AnyValue: {} + Color: + type: string + enum: + - black + - white + - red + - green + - blue + Order: + title: Pet Order + description: An order for a pets from the pet store + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + xml: + name: Category + User: + title: a User + description: A User who is purchasing from the pet store + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + title: An uploaded response + description: Describes the result of uploading an image resource + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + PetsForm: + type: object + properties: + images[]: + type: array + items: + type: string + format: binary + image: + type: string + format: binary + titles[]: + type: array + items: + type: string + longArray: + type: array + items: + type: integer + format: int64 + stringParam: + type: string + intParam: + type: integer + format: int32 + required: + - stringParam \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-no-multipart-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-no-multipart-for-testing.yaml new file mode 100644 index 00000000000..bcf99067930 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/helidon/petstore-no-multipart-for-testing.yaml @@ -0,0 +1,789 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.helidon.io:8080/v2' +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. For this sample, you can use the api key + `special-key` to test the authorization filters. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/schemas/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: integer + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: headerLong + in: header + required: true + schema: + type: integer + format: int64 + - name: cookieString + in: cookie + schema: + type: string + required: true + - name: cookieInt + in: cookie + schema: + type: integer + format: int32 + required: false + - name: cookieIntArray + in: cookie + schema: + type: array + items: + type: integer + required: false + - name: cookieStringArray + in: cookie + schema: + type: array + items: + type: string + required: false + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{orderId}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: number + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + - name: sizeString + in: query + description: String param to test Size constraint + required: true + schema: + type: string + minLength: 5 + maxLength: 10 + - name: minLong + in: query + description: Min Long param for test + required: true + schema: + type: integer + format: int64 + minimum: 10 + - name: minDecimal + in: query + description: Min Decimal param for test + required: true + schema: + type: number + minimum: 0 + exclusiveMinimum: true + responses: + '200': + description: successful operation + headers: + Set-Cookie: + description: >- + Cookie authentication key for use with the `api_key` + apiKey authentication. + schema: + type: string + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - api_key: [] +externalDocs: + description: Find out more about Swagger + url: 'http://swagger.io' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + schemas: + AnyValue: {} + Color: + type: string + enum: + - black + - white + - red + - green + - blue + Order: + title: Pet Order + description: An order for a pets from the pet store + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + xml: + name: Category + User: + title: a User + description: A User who is purchasing from the pet store + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + title: An uploaded response + description: Describes the result of uploading an image resource + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + PetsForm: + type: object + properties: + images[]: + type: array + items: + type: string + format: binary + image: + type: string + format: binary + titles[]: + type: array + items: + type: string + longArray: + type: array + items: + type: integer + format: int64 + stringParam: + type: string + intParam: + type: integer + format: int32 + required: + - stringParam \ No newline at end of file diff --git a/pom.xml b/pom.xml index 54b36bd4bce..7ca26d656a7 100644 --- a/pom.xml +++ b/pom.xml @@ -744,6 +744,30 @@ samples/server/petstore/java-micronaut-server + + java-helidon-client + + + env + java + + + + samples/client/petstore/java-helidon-client + + + + java-helidon-server + + + env + java + + + + samples/server/petstore/java-helidon-server + + java-msf4j-server From 40c1b2c471a2e1fc699031e534d22c7f7a0ca46b Mon Sep 17 00:00:00 2001 From: tvallin Date: Fri, 23 Sep 2022 17:11:16 -0500 Subject: [PATCH 07/18] Add functional test discovery and execution Signed-off-by: tvallin --- .github/workflows/openapi-generator.yaml | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index e7053340e0a..423cec99062 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -80,6 +80,44 @@ jobs: name: surefire-test-results path: '**/surefire-reports/TEST-*.xml' + functional-test: + name: Functional tests + runs-on: ubuntu-latest + needs: + - build + strategy: + matrix: + java-version: [11, 17] + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java-version }} + distribution: 'temurin' + - name: Cache maven dependencies + uses: actions/cache@v3 + env: + cache-name: cache-maven-repository + with: + path: | + ~/.m2/repository + ~/.gradle + !~/.gradle/caches/*/plugin-resolution/ + !~/.m2/repository/org/openapitools/ + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + - name: Run unit tests + run: cd modules/openapi-generator && mvn --no-snapshot-updates --batch-mode -Dtest="**/functional/*Test" test -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - name: Publish unit test reports + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: surefire-test-results + path: '**/surefire-reports/TEST-*.xml' + documentation: name: Docs up-to-date runs-on: ubuntu-latest From 58ffb09fd400b5cccf230da329766306857e5ece Mon Sep 17 00:00:00 2001 From: "tim.quinn@oracle.com" Date: Fri, 23 Sep 2022 17:18:50 -0500 Subject: [PATCH 08/18] Add generated Helidon doc files Signed-off-by: tim.quinn@oracle.com --- docs/generators/java-helidon-client.md | 316 ++++++++++++++++++++++++ docs/generators/java-helidon-server.md | 318 +++++++++++++++++++++++++ 2 files changed, 634 insertions(+) create mode 100644 docs/generators/java-helidon-client.md create mode 100644 docs/generators/java-helidon-server.md diff --git a/docs/generators/java-helidon-client.md b/docs/generators/java-helidon-client.md new file mode 100644 index 00000000000..13b1af6a314 --- /dev/null +++ b/docs/generators/java-helidon-client.md @@ -0,0 +1,316 @@ +--- +title: Documentation for the java-helidon-client Generator +--- + +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-helidon-client | pass this to the generate command after -g | +| generator stability | BETA | | +| generator type | CLIENT | | +| generator language | Java | | +| generator default templating engine | mustache | | +| helpTxt | Generates a Helidon MP or SE client | | + +## CONFIG OPTIONS +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|apiPackage|package for generated api classes| |org.openapitools.client.api| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| +|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-client| +|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|configKey|Config key in @RegisterRestClient. Default to none.| |null| +|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| +|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| +|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| +|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| || +|groupId|groupId in generated pom.xml| |org.openapitools| +|helidonVersion|Helidon version for generated code| |3.0.1| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| +|invokerPackage|root package for generated code| |org.openapitools.client| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|library|library template (sub-template) to use|
**mp**
Helidon MP Client
**se**
Helidon SE Client
|mp| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.client.model| +|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|rootJavaEEPackage|Root package name for Java EE| |Helidon 2.x and earlier: javax; Helidon 3.x and later: jakarta| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|serializationLibrary|Serialization library, defaults to Jackson|
**jsonb**
Use JSON-B as serialization library
**jackson**
Use Jackson as serialization library
|null| +|snapshotVersion|Uses a SNAPSHOT version.|
**true**
Use a SnapShot Version
**false**
Use a Release Version
|null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|sourceFolder|source folder for generated code| |src/main/java| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| + +## SUPPORTED VENDOR EXTENSIONS + +| Extension name | Description | Applicable for | Default value | +| -------------- | ----------- | -------------- | ------------- | +|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL| +|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array +|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value +|x-tags|Specify multiple swagger tags for operation|OPERATION|null +|x-accepts|Specify custom value for 'Accept' header for operation|OPERATION|null +|x-content-type|Specify custom value for 'Content-Type' header for operation|OPERATION|null +|x-class-extra-annotation|List of custom annotations to be added to model|MODEL|null +|x-field-extra-annotation|List of custom annotations to be added to property|FIELD|null +|x-webclient-blocking|Specifies if method for specific operation should be blocking or non-blocking(ex: return `Mono/Flux` or `return T/List/Set` & execute `.block()` inside generated method)|OPERATION|false + + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | +|Array|java.util.List| +|ArrayList|java.util.ArrayList| +|BigDecimal|java.math.BigDecimal| +|Date|java.util.Date| +|DateTime|org.joda.time.*| +|File|java.io.File| +|HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| +|Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|ArrayList| +|map|HashMap| +|set|LinkedHashSet| + + +## LANGUAGE PRIMITIVES + +
    +
  • Boolean
  • +
  • Double
  • +
  • Float
  • +
  • Integer
  • +
  • Long
  • +
  • Object
  • +
  • String
  • +
  • boolean
  • +
  • byte[]
  • +
+ +## RESERVED WORDS + +
    +
  • abstract
  • +
  • apiclient
  • +
  • apiexception
  • +
  • apiresponse
  • +
  • assert
  • +
  • boolean
  • +
  • break
  • +
  • byte
  • +
  • case
  • +
  • catch
  • +
  • char
  • +
  • class
  • +
  • configuration
  • +
  • const
  • +
  • continue
  • +
  • default
  • +
  • do
  • +
  • double
  • +
  • else
  • +
  • enum
  • +
  • extends
  • +
  • file
  • +
  • final
  • +
  • finally
  • +
  • float
  • +
  • for
  • +
  • goto
  • +
  • if
  • +
  • implements
  • +
  • import
  • +
  • instanceof
  • +
  • int
  • +
  • interface
  • +
  • list
  • +
  • localreturntype
  • +
  • localvaraccept
  • +
  • localvaraccepts
  • +
  • localvarauthnames
  • +
  • localvarcollectionqueryparams
  • +
  • localvarcontenttype
  • +
  • localvarcontenttypes
  • +
  • localvarcookieparams
  • +
  • localvarformparams
  • +
  • localvarheaderparams
  • +
  • localvarpath
  • +
  • localvarpostbody
  • +
  • localvarqueryparams
  • +
  • long
  • +
  • native
  • +
  • new
  • +
  • null
  • +
  • object
  • +
  • package
  • +
  • private
  • +
  • protected
  • +
  • public
  • +
  • return
  • +
  • short
  • +
  • static
  • +
  • strictfp
  • +
  • stringutil
  • +
  • super
  • +
  • switch
  • +
  • synchronized
  • +
  • this
  • +
  • throw
  • +
  • throws
  • +
  • transient
  • +
  • try
  • +
  • void
  • +
  • volatile
  • +
  • while
  • +
+ +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Uuid|✗| +|Array|✓|OAS2,OAS3 +|Null|✗|OAS3 +|AnyType|✗|OAS2,OAS3 +|Object|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✓|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✓|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✗|OAS2,OAS3 +|Union|✗|OAS3 +|allOf|✗|OAS2,OAS3 +|anyOf|✗|OAS3 +|oneOf|✗|OAS3 +|not|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✗|OAS2,OAS3 +|ApiKey|✗|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✗|OAS3 +|OAuth2_Implicit|✗|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 diff --git a/docs/generators/java-helidon-server.md b/docs/generators/java-helidon-server.md new file mode 100644 index 00000000000..a33de1eb380 --- /dev/null +++ b/docs/generators/java-helidon-server.md @@ -0,0 +1,318 @@ +--- +title: Documentation for the java-helidon-server Generator +--- + +## METADATA + +| Property | Value | Notes | +| -------- | ----- | ----- | +| generator name | java-helidon-server | pass this to the generate command after -g | +| generator stability | BETA | | +| generator type | SERVER | | +| generator language | Java | | +| generator default templating engine | mustache | | +| helpTxt | Generates a Java Helidon Server application. | | + +## CONFIG OPTIONS +These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details. + +| Option | Description | Values | Default | +| ------ | ----------- | ------ | ------- | +|additionalEnumTypeAnnotations|Additional annotations for enum type(class level annotations)| |null| +|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null| +|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| +|apiPackage|package for generated api classes| |org.openapitools.server.api| +|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java| +|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-java-server| +|artifactUrl|artifact URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| +|artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |1.0.0| +|bigDecimalAsString|Treat BigDecimal values as Strings to avoid precision loss.| |false| +|booleanGetterPrefix|Set booleanGetterPrefix| |get| +|dateLibrary|Option. Date library to use|
**joda**
Joda (for legacy app only)
**legacy**
Legacy java.util.Date
**java8-localdatetime**
Java 8 using LocalDateTime (for legacy app only)
**java8**
Java 8 native JSR310 (preferred for jdk 1.8+)
|java8| +|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false**
The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
**true**
Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
|true| +|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| +|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false**
No changes to the enum's are made, this is the default option.
**true**
With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
|false| +|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| +|fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| || +|gradleProject|Whether to generate gradle project instead of maven.| |false| +|groupId|groupId in generated pom.xml| |org.openapitools| +|helidonVersion|Helidon version for generated code| |3.0.1| +|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| +|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false| +|implicitHeaders|Skip header parameters in the generated API methods using @ApiImplicitParams annotation.| |false| +|implicitHeadersRegex|Skip header parameters that matches given regex in the generated API methods using @ApiImplicitParams annotation. Note: this parameter is ignored when implicitHeaders=true| |null| +|invokerPackage|root package for generated code| |org.openapitools.server| +|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
**true**
The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
**false**
The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
|true| +|library|library template (sub-template) to use|
**mp**
Helidon MP Server
**se**
Helidon SE Server
**nima**
Helidon NIMA Server
**nima-annotations**
Helidon NIMA Annotations Server
|se| +|licenseName|The name of the license| |Unlicense| +|licenseUrl|The URL of the license| |http://unlicense.org| +|modelPackage|package for generated models| |org.openapitools.server.model| +|openApiNullable|Enable OpenAPI Jackson Nullable library| |true| +|performBeanValidation|Perform BeanValidation| |false| +|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| +|rootJavaEEPackage|Root package name for Java EE| |Helidon 2.x and earlier: javax; Helidon 3.x and later: jakarta| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| +|serializationLibrary|Serialization library, defaults to Jackson|
**jsonb**
Use JSON-B as serialization library
**jackson**
Use Jackson as serialization library
|null| +|snapshotVersion|Uses a SNAPSHOT version.|
**true**
Use a SnapShot Version
**false**
Use a Release Version
|null| +|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| +|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| +|sourceFolder|source folder for generated code| |src/main/java| +|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| +|useAbstractClass|Whether to generate abstract classes for REST API instead of interfaces.| |false| +|useBeanValidation|Use Bean Validation| |false| +|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| + +## SUPPORTED VENDOR EXTENSIONS + +| Extension name | Description | Applicable for | Default value | +| -------------- | ----------- | -------------- | ------------- | +|x-discriminator-value|Used with model inheritance to specify value for discriminator that identifies current model|MODEL| +|x-implements|Ability to specify interfaces that model must implements|MODEL|empty array +|x-setter-extra-annotation|Custom annotation that can be specified over java setter for specific field|FIELD|When field is array & uniqueItems, then this extension is used to add `@JsonDeserialize(as = LinkedHashSet.class)` over setter, otherwise no value +|x-tags|Specify multiple swagger tags for operation|OPERATION|null +|x-accepts|Specify custom value for 'Accept' header for operation|OPERATION|null +|x-content-type|Specify custom value for 'Content-Type' header for operation|OPERATION|null +|x-class-extra-annotation|List of custom annotations to be added to model|MODEL|null +|x-field-extra-annotation|List of custom annotations to be added to property|FIELD|null + + +## IMPORT MAPPING + +| Type/Alias | Imports | +| ---------- | ------- | +|Array|java.util.List| +|ArrayList|java.util.ArrayList| +|BigDecimal|java.math.BigDecimal| +|Date|java.util.Date| +|DateTime|org.joda.time.*| +|File|java.io.File| +|HashMap|java.util.HashMap| +|LinkedHashSet|java.util.LinkedHashSet| +|List|java.util.*| +|LocalDate|org.joda.time.*| +|LocalDateTime|org.joda.time.*| +|LocalTime|org.joda.time.*| +|Map|java.util.Map| +|Set|java.util.*| +|Timestamp|java.sql.Timestamp| +|URI|java.net.URI| +|UUID|java.util.UUID| + + +## INSTANTIATION TYPES + +| Type/Alias | Instantiated By | +| ---------- | --------------- | +|array|ArrayList| +|map|HashMap| +|set|LinkedHashSet| + + +## LANGUAGE PRIMITIVES + +
    +
  • Boolean
  • +
  • Double
  • +
  • Float
  • +
  • Integer
  • +
  • Long
  • +
  • Object
  • +
  • String
  • +
  • boolean
  • +
  • byte[]
  • +
+ +## RESERVED WORDS + +
    +
  • abstract
  • +
  • apiclient
  • +
  • apiexception
  • +
  • apiresponse
  • +
  • assert
  • +
  • boolean
  • +
  • break
  • +
  • byte
  • +
  • case
  • +
  • catch
  • +
  • char
  • +
  • class
  • +
  • configuration
  • +
  • const
  • +
  • continue
  • +
  • default
  • +
  • do
  • +
  • double
  • +
  • else
  • +
  • enum
  • +
  • extends
  • +
  • file
  • +
  • final
  • +
  • finally
  • +
  • float
  • +
  • for
  • +
  • goto
  • +
  • if
  • +
  • implements
  • +
  • import
  • +
  • instanceof
  • +
  • int
  • +
  • interface
  • +
  • list
  • +
  • localreturntype
  • +
  • localvaraccept
  • +
  • localvaraccepts
  • +
  • localvarauthnames
  • +
  • localvarcollectionqueryparams
  • +
  • localvarcontenttype
  • +
  • localvarcontenttypes
  • +
  • localvarcookieparams
  • +
  • localvarformparams
  • +
  • localvarheaderparams
  • +
  • localvarpath
  • +
  • localvarpostbody
  • +
  • localvarqueryparams
  • +
  • long
  • +
  • native
  • +
  • new
  • +
  • null
  • +
  • object
  • +
  • package
  • +
  • private
  • +
  • protected
  • +
  • public
  • +
  • return
  • +
  • short
  • +
  • static
  • +
  • strictfp
  • +
  • stringutil
  • +
  • super
  • +
  • switch
  • +
  • synchronized
  • +
  • this
  • +
  • throw
  • +
  • throws
  • +
  • transient
  • +
  • try
  • +
  • void
  • +
  • volatile
  • +
  • while
  • +
+ +## FEATURE SET + + +### Client Modification Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasePath|✓|ToolingExtension +|Authorizations|✗|ToolingExtension +|UserAgent|✗|ToolingExtension +|MockServer|✗|ToolingExtension + +### Data Type Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Custom|✗|OAS2,OAS3 +|Int32|✓|OAS2,OAS3 +|Int64|✓|OAS2,OAS3 +|Float|✓|OAS2,OAS3 +|Double|✓|OAS2,OAS3 +|Decimal|✓|ToolingExtension +|String|✓|OAS2,OAS3 +|Byte|✓|OAS2,OAS3 +|Binary|✓|OAS2,OAS3 +|Boolean|✓|OAS2,OAS3 +|Date|✓|OAS2,OAS3 +|DateTime|✓|OAS2,OAS3 +|Password|✓|OAS2,OAS3 +|File|✓|OAS2 +|Uuid|✗| +|Array|✓|OAS2,OAS3 +|Null|✗|OAS3 +|AnyType|✗|OAS2,OAS3 +|Object|✓|OAS2,OAS3 +|Maps|✓|ToolingExtension +|CollectionFormat|✓|OAS2 +|CollectionFormatMulti|✓|OAS2 +|Enum|✓|OAS2,OAS3 +|ArrayOfEnum|✓|ToolingExtension +|ArrayOfModel|✓|ToolingExtension +|ArrayOfCollectionOfPrimitives|✓|ToolingExtension +|ArrayOfCollectionOfModel|✓|ToolingExtension +|ArrayOfCollectionOfEnum|✓|ToolingExtension +|MapOfEnum|✓|ToolingExtension +|MapOfModel|✓|ToolingExtension +|MapOfCollectionOfPrimitives|✓|ToolingExtension +|MapOfCollectionOfModel|✓|ToolingExtension +|MapOfCollectionOfEnum|✓|ToolingExtension + +### Documentation Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Readme|✓|ToolingExtension +|Model|✓|ToolingExtension +|Api|✓|ToolingExtension + +### Global Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Host|✓|OAS2,OAS3 +|BasePath|✓|OAS2,OAS3 +|Info|✓|OAS2,OAS3 +|Schemes|✗|OAS2,OAS3 +|PartialSchemes|✓|OAS2,OAS3 +|Consumes|✓|OAS2 +|Produces|✓|OAS2 +|ExternalDocumentation|✓|OAS2,OAS3 +|Examples|✓|OAS2,OAS3 +|XMLStructureDefinitions|✗|OAS2,OAS3 +|MultiServer|✗|OAS3 +|ParameterizedServer|✗|OAS3 +|ParameterStyling|✗|OAS3 +|Callbacks|✗|OAS3 +|LinkObjects|✗|OAS3 + +### Parameter Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Path|✓|OAS2,OAS3 +|Query|✓|OAS2,OAS3 +|Header|✓|OAS2,OAS3 +|Body|✓|OAS2 +|FormUnencoded|✓|OAS2 +|FormMultipart|✓|OAS2 +|Cookie|✓|OAS3 + +### Schema Support Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|Simple|✓|OAS2,OAS3 +|Composite|✓|OAS2,OAS3 +|Polymorphism|✗|OAS2,OAS3 +|Union|✗|OAS3 +|allOf|✗|OAS2,OAS3 +|anyOf|✗|OAS3 +|oneOf|✗|OAS3 +|not|✗|OAS3 + +### Security Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|BasicAuth|✗|OAS2,OAS3 +|ApiKey|✗|OAS2,OAS3 +|OpenIDConnect|✗|OAS3 +|BearerToken|✗|OAS3 +|OAuth2_Implicit|✗|OAS2,OAS3 +|OAuth2_Password|✗|OAS2,OAS3 +|OAuth2_ClientCredentials|✗|OAS2,OAS3 +|OAuth2_AuthorizationCode|✗|OAS2,OAS3 + +### Wire Format Feature +| Name | Supported | Defined By | +| ---- | --------- | ---------- | +|JSON|✓|OAS2,OAS3 +|XML|✓|OAS2,OAS3 +|PROTOBUF|✗|ToolingExtension +|Custom|✗|OAS2,OAS3 From 88ee081ad4088fdd13d0008c58523d0f4d93a96a Mon Sep 17 00:00:00 2001 From: "tim.quinn@oracle.com" Date: Fri, 23 Sep 2022 17:19:10 -0500 Subject: [PATCH 09/18] Add generated Helidon sample files Signed-off-by: tim.quinn@oracle.com --- .../mp/.openapi-generator-ignore | 23 + .../mp/.openapi-generator/FILES | 172 ++ .../mp/.openapi-generator/VERSION | 1 + .../petstore/java-helidon-client/mp/README.md | 7 + .../mp/docs/AdditionalPropertiesClass.md | 14 + .../mp/docs/AllOfWithSingleRef.md | 14 + .../java-helidon-client/mp/docs/Animal.md | 14 + .../mp/docs/AnotherFakeApi.md | 44 + .../mp/docs/ArrayOfArrayOfNumberOnly.md | 13 + .../mp/docs/ArrayOfNumberOnly.md | 13 + .../java-helidon-client/mp/docs/ArrayTest.md | 15 + .../mp/docs/Capitalization.md | 18 + .../java-helidon-client/mp/docs/Cat.md | 13 + .../java-helidon-client/mp/docs/CatAllOf.md | 13 + .../java-helidon-client/mp/docs/Category.md | 14 + .../java-helidon-client/mp/docs/ClassModel.md | 14 + .../java-helidon-client/mp/docs/Client.md | 13 + .../java-helidon-client/mp/docs/DefaultApi.md | 39 + .../mp/docs/DeprecatedObject.md | 13 + .../java-helidon-client/mp/docs/Dog.md | 13 + .../java-helidon-client/mp/docs/DogAllOf.md | 13 + .../java-helidon-client/mp/docs/EnumArrays.md | 32 + .../java-helidon-client/mp/docs/EnumClass.md | 15 + .../java-helidon-client/mp/docs/EnumTest.md | 58 + .../java-helidon-client/mp/docs/FakeApi.md | 649 +++++ .../mp/docs/FakeClassnameTags123Api.md | 44 + .../mp/docs/FileSchemaTestClass.md | 14 + .../java-helidon-client/mp/docs/Foo.md | 13 + .../mp/docs/FooGetDefaultResponse.md | 13 + .../java-helidon-client/mp/docs/FormatTest.md | 28 + .../mp/docs/HasOnlyReadOnly.md | 14 + .../mp/docs/HealthCheckResult.md | 14 + .../java-helidon-client/mp/docs/MapTest.md | 25 + ...dPropertiesAndAdditionalPropertiesClass.md | 15 + .../mp/docs/Model200Response.md | 15 + .../mp/docs/ModelApiResponse.md | 15 + .../java-helidon-client/mp/docs/ModelFile.md | 14 + .../java-helidon-client/mp/docs/ModelList.md | 13 + .../mp/docs/ModelReturn.md | 14 + .../java-helidon-client/mp/docs/Name.md | 17 + .../mp/docs/NullableClass.md | 24 + .../java-helidon-client/mp/docs/NumberOnly.md | 13 + .../mp/docs/ObjectWithDeprecatedFields.md | 16 + .../java-helidon-client/mp/docs/Order.md | 28 + .../mp/docs/OuterComposite.md | 15 + .../java-helidon-client/mp/docs/OuterEnum.md | 15 + .../mp/docs/OuterEnumDefaultValue.md | 15 + .../mp/docs/OuterEnumInteger.md | 15 + .../mp/docs/OuterEnumIntegerDefaultValue.md | 15 + .../mp/docs/OuterObjectWithEnumProperty.md | 13 + .../java-helidon-client/mp/docs/Pet.md | 28 + .../java-helidon-client/mp/docs/PetApi.md | 349 +++ .../mp/docs/ReadOnlyFirst.md | 14 + .../mp/docs/SingleRefType.md | 13 + .../mp/docs/SpecialModelName.md | 13 + .../java-helidon-client/mp/docs/StoreApi.md | 153 ++ .../java-helidon-client/mp/docs/Tag.md | 14 + .../java-helidon-client/mp/docs/User.md | 20 + .../java-helidon-client/mp/docs/UserApi.md | 300 +++ .../petstore/java-helidon-client/mp/pom.xml | 78 + .../client/JavaTimeFormatter.java | 64 + .../client/RFC3339DateFormat.java | 57 + .../client/api/AnotherFakeApi.java | 49 + .../openapitools/client/api/ApiException.java | 30 + .../client/api/ApiExceptionMapper.java | 33 + .../openapitools/client/api/DefaultApi.java | 44 + .../org/openapitools/client/api/FakeApi.java | 169 ++ .../client/api/FakeClassnameTags123Api.java | 49 + .../org/openapitools/client/api/PetApi.java | 126 + .../org/openapitools/client/api/StoreApi.java | 75 + .../org/openapitools/client/api/UserApi.java | 110 + .../model/AdditionalPropertiesClass.java | 108 + .../client/model/AllOfWithSingleRef.java | 97 + .../org/openapitools/client/model/Animal.java | 101 + .../model/ArrayOfArrayOfNumberOnly.java | 81 + .../client/model/ArrayOfNumberOnly.java | 81 + .../openapitools/client/model/ArrayTest.java | 137 ++ .../client/model/Capitalization.java | 191 ++ .../org/openapitools/client/model/Cat.java | 77 + .../openapitools/client/model/CatAllOf.java | 73 + .../openapitools/client/model/Category.java | 96 + .../openapitools/client/model/ClassModel.java | 76 + .../org/openapitools/client/model/Client.java | 73 + .../client/model/DeprecatedObject.java | 73 + .../org/openapitools/client/model/Dog.java | 77 + .../openapitools/client/model/DogAllOf.java | 73 + .../openapitools/client/model/EnumArrays.java | 145 ++ .../openapitools/client/model/EnumClass.java | 52 + .../openapitools/client/model/EnumTest.java | 326 +++ .../client/model/FileSchemaTestClass.java | 104 + .../org/openapitools/client/model/Foo.java | 73 + .../client/model/FooGetDefaultResponse.java | 74 + .../openapitools/client/model/FormatTest.java | 439 ++++ .../client/model/HasOnlyReadOnly.java | 74 + .../client/model/HealthCheckResult.java | 80 + .../openapitools/client/model/MapTest.java | 185 ++ ...ropertiesAndAdditionalPropertiesClass.java | 129 + .../client/model/Model200Response.java | 99 + .../client/model/ModelApiResponse.java | 119 + .../openapitools/client/model/ModelFile.java | 79 + .../openapitools/client/model/ModelList.java | 73 + .../client/model/ModelReturn.java | 76 + .../org/openapitools/client/model/Name.java | 123 + .../client/model/NullableClass.java | 367 +++ .../openapitools/client/model/NumberOnly.java | 74 + .../model/ObjectWithDeprecatedFields.java | 157 ++ .../org/openapitools/client/model/Order.java | 213 ++ .../client/model/OuterComposite.java | 120 + .../openapitools/client/model/OuterEnum.java | 52 + .../client/model/OuterEnumDefaultValue.java | 52 + .../client/model/OuterEnumInteger.java | 52 + .../model/OuterEnumIntegerDefaultValue.java | 52 + .../model/OuterObjectWithEnumProperty.java | 74 + .../org/openapitools/client/model/Pet.java | 230 ++ .../client/model/ReadOnlyFirst.java | 85 + .../client/model/SingleRefType.java | 50 + .../client/model/SpecialModelName.java | 73 + .../org/openapitools/client/model/Tag.java | 96 + .../org/openapitools/client/model/User.java | 237 ++ .../client/api/AnotherFakeApiTest.java | 64 + .../client/api/DefaultApiTest.java | 60 + .../openapitools/client/api/FakeApiTest.java | 259 ++ .../api/FakeClassnameTags123ApiTest.java | 64 + .../openapitools/client/api/PetApiTest.java | 179 ++ .../openapitools/client/api/StoreApiTest.java | 106 + .../openapitools/client/api/UserApiTest.java | 163 ++ .../model/AdditionalPropertiesClassTest.java | 57 + .../client/model/AllOfWithSingleRefTest.java | 56 + .../openapitools/client/model/AnimalTest.java | 60 + .../model/ArrayOfArrayOfNumberOnlyTest.java | 50 + .../client/model/ArrayOfNumberOnlyTest.java | 50 + .../client/model/ArrayTestTest.java | 66 + .../client/model/CapitalizationTest.java | 87 + .../client/model/CatAllOfTest.java | 47 + .../openapitools/client/model/CatTest.java | 67 + .../client/model/CategoryTest.java | 55 + .../client/model/ClassModelTest.java | 47 + .../openapitools/client/model/ClientTest.java | 47 + .../client/model/DeprecatedObjectTest.java | 47 + .../client/model/DogAllOfTest.java | 47 + .../openapitools/client/model/DogTest.java | 67 + .../client/model/EnumArraysTest.java | 57 + .../client/model/EnumClassTest.java | 32 + .../client/model/EnumTestTest.java | 111 + .../client/model/FileSchemaTestClassTest.java | 58 + .../model/FooGetDefaultResponseTest.java | 48 + .../openapitools/client/model/FooTest.java | 47 + .../client/model/FormatTestTest.java | 172 ++ .../client/model/HasOnlyReadOnlyTest.java | 55 + .../client/model/HealthCheckResultTest.java | 51 + .../client/model/MapTestTest.java | 73 + ...rtiesAndAdditionalPropertiesClassTest.java | 68 + .../client/model/Model200ResponseTest.java | 55 + .../client/model/ModelApiResponseTest.java | 63 + .../client/model/ModelFileTest.java | 47 + .../client/model/ModelListTest.java | 47 + .../client/model/ModelReturnTest.java | 47 + .../openapitools/client/model/NameTest.java | 71 + .../client/model/NullableClassTest.java | 146 ++ .../client/model/NumberOnlyTest.java | 48 + .../model/ObjectWithDeprecatedFieldsTest.java | 75 + .../openapitools/client/model/OrderTest.java | 88 + .../client/model/OuterCompositeTest.java | 64 + .../model/OuterEnumDefaultValueTest.java | 32 + .../OuterEnumIntegerDefaultValueTest.java | 32 + .../client/model/OuterEnumIntegerTest.java | 32 + .../client/model/OuterEnumTest.java | 32 + .../OuterObjectWithEnumPropertyTest.java | 48 + .../openapitools/client/model/PetTest.java | 94 + .../client/model/ReadOnlyFirstTest.java | 55 + .../client/model/SingleRefTypeTest.java | 32 + .../client/model/SpecialModelNameTest.java | 47 + .../openapitools/client/model/TagTest.java | 55 + .../openapitools/client/model/UserTest.java | 103 + .../se/.openapi-generator-ignore | 23 + .../se/.openapi-generator/FILES | 181 ++ .../se/.openapi-generator/VERSION | 1 + .../petstore/java-helidon-client/se/README.md | 24 + .../se/docs/AdditionalPropertiesClass.md | 14 + .../se/docs/AllOfWithSingleRef.md | 14 + .../java-helidon-client/se/docs/Animal.md | 14 + .../se/docs/AnotherFakeApi.md | 75 + .../se/docs/ArrayOfArrayOfNumberOnly.md | 13 + .../se/docs/ArrayOfNumberOnly.md | 13 + .../java-helidon-client/se/docs/ArrayTest.md | 15 + .../se/docs/Capitalization.md | 18 + .../java-helidon-client/se/docs/Cat.md | 13 + .../java-helidon-client/se/docs/CatAllOf.md | 13 + .../java-helidon-client/se/docs/Category.md | 14 + .../java-helidon-client/se/docs/ClassModel.md | 14 + .../java-helidon-client/se/docs/Client.md | 13 + .../java-helidon-client/se/docs/DefaultApi.md | 69 + .../se/docs/DeprecatedObject.md | 13 + .../java-helidon-client/se/docs/Dog.md | 13 + .../java-helidon-client/se/docs/DogAllOf.md | 13 + .../java-helidon-client/se/docs/EnumArrays.md | 32 + .../java-helidon-client/se/docs/EnumClass.md | 15 + .../java-helidon-client/se/docs/EnumTest.md | 58 + .../java-helidon-client/se/docs/FakeApi.md | 1214 +++++++++ .../se/docs/FakeClassnameTags123Api.md | 82 + .../se/docs/FileSchemaTestClass.md | 14 + .../java-helidon-client/se/docs/Foo.md | 13 + .../se/docs/FooGetDefaultResponse.md | 13 + .../java-helidon-client/se/docs/FormatTest.md | 28 + .../se/docs/HasOnlyReadOnly.md | 14 + .../se/docs/HealthCheckResult.md | 14 + .../java-helidon-client/se/docs/MapTest.md | 25 + ...dPropertiesAndAdditionalPropertiesClass.md | 15 + .../se/docs/Model200Response.md | 15 + .../se/docs/ModelApiResponse.md | 15 + .../java-helidon-client/se/docs/ModelFile.md | 14 + .../java-helidon-client/se/docs/ModelList.md | 13 + .../se/docs/ModelReturn.md | 14 + .../java-helidon-client/se/docs/Name.md | 17 + .../se/docs/NullableClass.md | 24 + .../java-helidon-client/se/docs/NumberOnly.md | 13 + .../se/docs/ObjectWithDeprecatedFields.md | 16 + .../java-helidon-client/se/docs/Order.md | 28 + .../se/docs/OuterComposite.md | 15 + .../java-helidon-client/se/docs/OuterEnum.md | 15 + .../se/docs/OuterEnumDefaultValue.md | 15 + .../se/docs/OuterEnumInteger.md | 15 + .../se/docs/OuterEnumIntegerDefaultValue.md | 15 + .../se/docs/OuterObjectWithEnumProperty.md | 13 + .../java-helidon-client/se/docs/Pet.md | 28 + .../java-helidon-client/se/docs/PetApi.md | 678 ++++++ .../se/docs/ReadOnlyFirst.md | 14 + .../se/docs/SingleRefType.md | 13 + .../se/docs/SpecialModelName.md | 13 + .../java-helidon-client/se/docs/StoreApi.md | 282 +++ .../java-helidon-client/se/docs/Tag.md | 14 + .../java-helidon-client/se/docs/User.md | 20 + .../java-helidon-client/se/docs/UserApi.md | 543 +++++ .../petstore/java-helidon-client/se/pom.xml | 69 + .../org/openapitools/client/ApiClient.java | 241 ++ .../org/openapitools/client/ApiResponse.java | 43 + .../openapitools/client/ApiResponseBase.java | 45 + .../java/org/openapitools/client/Pair.java | 56 + .../client/RFC3339DateFormat.java | 57 + .../client/api/AnotherFakeApi.java | 35 + .../client/api/AnotherFakeApiImpl.java | 97 + .../openapitools/client/api/DefaultApi.java | 27 + .../client/api/DefaultApiImpl.java | 91 + .../org/openapitools/client/api/FakeApi.java | 146 ++ .../openapitools/client/api/FakeApiImpl.java | 887 +++++++ .../client/api/FakeClassnameTags123Api.java | 35 + .../api/FakeClassnameTags123ApiImpl.java | 97 + .../org/openapitools/client/api/PetApi.java | 111 + .../openapitools/client/api/PetApiImpl.java | 463 ++++ .../openapitools/client/api/ResponseType.java | 43 + .../org/openapitools/client/api/StoreApi.java | 58 + .../openapitools/client/api/StoreApiImpl.java | 212 ++ .../org/openapitools/client/api/UserApi.java | 93 + .../openapitools/client/api/UserApiImpl.java | 383 +++ .../model/AdditionalPropertiesClass.java | 108 + .../client/model/AllOfWithSingleRef.java | 97 + .../org/openapitools/client/model/Animal.java | 101 + .../model/ArrayOfArrayOfNumberOnly.java | 81 + .../client/model/ArrayOfNumberOnly.java | 81 + .../openapitools/client/model/ArrayTest.java | 137 ++ .../client/model/Capitalization.java | 191 ++ .../org/openapitools/client/model/Cat.java | 77 + .../openapitools/client/model/CatAllOf.java | 73 + .../openapitools/client/model/Category.java | 96 + .../openapitools/client/model/ClassModel.java | 76 + .../org/openapitools/client/model/Client.java | 73 + .../client/model/DeprecatedObject.java | 73 + .../org/openapitools/client/model/Dog.java | 77 + .../openapitools/client/model/DogAllOf.java | 73 + .../openapitools/client/model/EnumArrays.java | 145 ++ .../openapitools/client/model/EnumClass.java | 52 + .../openapitools/client/model/EnumTest.java | 326 +++ .../client/model/FileSchemaTestClass.java | 104 + .../org/openapitools/client/model/Foo.java | 73 + .../client/model/FooGetDefaultResponse.java | 74 + .../openapitools/client/model/FormatTest.java | 439 ++++ .../client/model/HasOnlyReadOnly.java | 74 + .../client/model/HealthCheckResult.java | 80 + .../openapitools/client/model/MapTest.java | 185 ++ ...ropertiesAndAdditionalPropertiesClass.java | 129 + .../client/model/Model200Response.java | 99 + .../client/model/ModelApiResponse.java | 119 + .../openapitools/client/model/ModelFile.java | 79 + .../openapitools/client/model/ModelList.java | 73 + .../client/model/ModelReturn.java | 76 + .../org/openapitools/client/model/Name.java | 123 + .../client/model/NullableClass.java | 367 +++ .../openapitools/client/model/NumberOnly.java | 74 + .../model/ObjectWithDeprecatedFields.java | 157 ++ .../org/openapitools/client/model/Order.java | 213 ++ .../client/model/OuterComposite.java | 120 + .../openapitools/client/model/OuterEnum.java | 52 + .../client/model/OuterEnumDefaultValue.java | 52 + .../client/model/OuterEnumInteger.java | 52 + .../model/OuterEnumIntegerDefaultValue.java | 52 + .../model/OuterObjectWithEnumProperty.java | 74 + .../org/openapitools/client/model/Pet.java | 230 ++ .../client/model/ReadOnlyFirst.java | 85 + .../client/model/SingleRefType.java | 50 + .../client/model/SpecialModelName.java | 73 + .../org/openapitools/client/model/Tag.java | 96 + .../org/openapitools/client/model/User.java | 237 ++ .../client/api/AnotherFakeApiTest.java | 74 + .../client/api/DefaultApiTest.java | 69 + .../openapitools/client/api/FakeApiTest.java | 440 ++++ .../api/FakeClassnameTags123ApiTest.java | 74 + .../openapitools/client/api/PetApiTest.java | 235 ++ .../openapitools/client/api/StoreApiTest.java | 126 + .../openapitools/client/api/UserApiTest.java | 203 ++ .../model/AdditionalPropertiesClassTest.java | 57 + .../client/model/AllOfWithSingleRefTest.java | 56 + .../openapitools/client/model/AnimalTest.java | 60 + .../model/ArrayOfArrayOfNumberOnlyTest.java | 50 + .../client/model/ArrayOfNumberOnlyTest.java | 50 + .../client/model/ArrayTestTest.java | 66 + .../client/model/CapitalizationTest.java | 87 + .../client/model/CatAllOfTest.java | 47 + .../openapitools/client/model/CatTest.java | 67 + .../client/model/CategoryTest.java | 55 + .../client/model/ClassModelTest.java | 47 + .../openapitools/client/model/ClientTest.java | 47 + .../client/model/DeprecatedObjectTest.java | 47 + .../client/model/DogAllOfTest.java | 47 + .../openapitools/client/model/DogTest.java | 67 + .../client/model/EnumArraysTest.java | 57 + .../client/model/EnumClassTest.java | 32 + .../client/model/EnumTestTest.java | 111 + .../client/model/FileSchemaTestClassTest.java | 58 + .../model/FooGetDefaultResponseTest.java | 48 + .../openapitools/client/model/FooTest.java | 47 + .../client/model/FormatTestTest.java | 172 ++ .../client/model/HasOnlyReadOnlyTest.java | 55 + .../client/model/HealthCheckResultTest.java | 51 + .../client/model/MapTestTest.java | 73 + ...rtiesAndAdditionalPropertiesClassTest.java | 68 + .../client/model/Model200ResponseTest.java | 55 + .../client/model/ModelApiResponseTest.java | 63 + .../client/model/ModelFileTest.java | 47 + .../client/model/ModelListTest.java | 47 + .../client/model/ModelReturnTest.java | 47 + .../openapitools/client/model/NameTest.java | 71 + .../client/model/NullableClassTest.java | 146 ++ .../client/model/NumberOnlyTest.java | 48 + .../model/ObjectWithDeprecatedFieldsTest.java | 75 + .../openapitools/client/model/OrderTest.java | 88 + .../client/model/OuterCompositeTest.java | 64 + .../model/OuterEnumDefaultValueTest.java | 32 + .../OuterEnumIntegerDefaultValueTest.java | 32 + .../client/model/OuterEnumIntegerTest.java | 32 + .../client/model/OuterEnumTest.java | 32 + .../OuterObjectWithEnumPropertyTest.java | 48 + .../openapitools/client/model/PetTest.java | 94 + .../client/model/ReadOnlyFirstTest.java | 55 + .../client/model/SingleRefTypeTest.java | 32 + .../client/model/SpecialModelNameTest.java | 47 + .../openapitools/client/model/TagTest.java | 55 + .../openapitools/client/model/UserTest.java | 103 + .../mp/.openapi-generator-ignore | 23 + .../mp/.openapi-generator/FILES | 121 + .../mp/.openapi-generator/VERSION | 1 + .../petstore/java-helidon-server/mp/README.md | 74 + .../petstore/java-helidon-server/mp/pom.xml | 82 + .../server/JavaTimeFormatter.java | 64 + .../server/RFC3339DateFormat.java | 50 + .../openapitools/server/RestApplication.java | 11 + .../server/api/AnotherFakeService.java | 35 + .../server/api/AnotherFakeServiceImpl.java | 37 + .../server/api/DefaultService.java | 34 + .../server/api/DefaultServiceImpl.java | 36 + .../api/FakeClassnameTags123Service.java | 35 + .../api/FakeClassnameTags123ServiceImpl.java | 37 + .../openapitools/server/api/FakeService.java | 127 + .../server/api/FakeServiceImpl.java | 161 ++ .../openapitools/server/api/PetService.java | 79 + .../server/api/PetServiceImpl.java | 97 + .../openapitools/server/api/StoreService.java | 51 + .../server/api/StoreServiceImpl.java | 59 + .../openapitools/server/api/UserService.java | 69 + .../server/api/UserServiceImpl.java | 85 + .../model/AdditionalPropertiesClass.java | 108 + .../server/model/AllOfWithSingleRef.java | 97 + .../org/openapitools/server/model/Animal.java | 102 + .../model/ArrayOfArrayOfNumberOnly.java | 81 + .../server/model/ArrayOfNumberOnly.java | 81 + .../openapitools/server/model/ArrayTest.java | 137 ++ .../server/model/Capitalization.java | 191 ++ .../org/openapitools/server/model/Cat.java | 77 + .../openapitools/server/model/CatAllOf.java | 74 + .../openapitools/server/model/Category.java | 97 + .../openapitools/server/model/ClassModel.java | 76 + .../org/openapitools/server/model/Client.java | 73 + .../server/model/DeprecatedObject.java | 73 + .../org/openapitools/server/model/Dog.java | 77 + .../openapitools/server/model/DogAllOf.java | 74 + .../openapitools/server/model/EnumArrays.java | 199 ++ .../openapitools/server/model/EnumClass.java | 69 + .../openapitools/server/model/EnumTest.java | 431 ++++ .../server/model/FileSchemaTestClass.java | 104 + .../org/openapitools/server/model/Foo.java | 73 + .../server/model/FooGetDefaultResponse.java | 75 + .../openapitools/server/model/FormatTest.java | 444 ++++ .../server/model/HasOnlyReadOnly.java | 89 + .../server/model/HealthCheckResult.java | 77 + .../openapitools/server/model/MapTest.java | 213 ++ ...ropertiesAndAdditionalPropertiesClass.java | 129 + .../server/model/Model200Response.java | 100 + .../server/model/ModelApiResponse.java | 120 + .../openapitools/server/model/ModelFile.java | 80 + .../openapitools/server/model/ModelList.java | 74 + .../server/model/ModelReturn.java | 77 + .../org/openapitools/server/model/Name.java | 138 ++ .../server/model/NullableClass.java | 364 +++ .../openapitools/server/model/NumberOnly.java | 74 + .../model/ObjectWithDeprecatedFields.java | 157 ++ .../org/openapitools/server/model/Order.java | 241 ++ .../server/model/OuterComposite.java | 120 + .../openapitools/server/model/OuterEnum.java | 69 + .../server/model/OuterEnumDefaultValue.java | 69 + .../server/model/OuterEnumInteger.java | 69 + .../model/OuterEnumIntegerDefaultValue.java | 69 + .../model/OuterObjectWithEnumProperty.java | 75 + .../org/openapitools/server/model/Pet.java | 260 ++ .../server/model/ReadOnlyFirst.java | 96 + .../server/model/SingleRefType.java | 67 + .../server/model/SpecialModelName.java | 74 + .../org/openapitools/server/model/Tag.java | 96 + .../org/openapitools/server/model/User.java | 237 ++ .../org/openapitools/server/package-info.java | 1 + .../mp/src/main/resources/META-INF/beans.xml | 9 + .../META-INF/microprofile-config.properties | 11 + .../src/main/resources/META-INF/openapi.yml | 2168 +++++++++++++++++ .../mp/src/main/resources/logging.properties | 19 + .../model/AdditionalPropertiesClassTest.java | 50 + .../server/model/AllOfWithSingleRefTest.java | 49 + .../openapitools/server/model/AnimalTest.java | 53 + .../model/ArrayOfArrayOfNumberOnlyTest.java | 43 + .../server/model/ArrayOfNumberOnlyTest.java | 43 + .../server/model/ArrayTestTest.java | 59 + .../server/model/CapitalizationTest.java | 80 + .../server/model/CatAllOfTest.java | 41 + .../openapitools/server/model/CatTest.java | 60 + .../server/model/CategoryTest.java | 48 + .../server/model/ClassModelTest.java | 40 + .../openapitools/server/model/ClientTest.java | 40 + .../server/model/DeprecatedObjectTest.java | 40 + .../server/model/DogAllOfTest.java | 41 + .../openapitools/server/model/DogTest.java | 60 + .../server/model/EnumArraysTest.java | 52 + .../server/model/EnumClassTest.java | 30 + .../server/model/EnumTestTest.java | 104 + .../server/model/FileSchemaTestClassTest.java | 51 + .../model/FooGetDefaultResponseTest.java | 42 + .../openapitools/server/model/FooTest.java | 40 + .../server/model/FormatTestTest.java | 166 ++ .../server/model/HasOnlyReadOnlyTest.java | 49 + .../server/model/HealthCheckResultTest.java | 41 + .../server/model/MapTestTest.java | 68 + ...rtiesAndAdditionalPropertiesClassTest.java | 61 + .../server/model/Model200ResponseTest.java | 49 + .../server/model/ModelApiResponseTest.java | 57 + .../server/model/ModelFileTest.java | 41 + .../server/model/ModelListTest.java | 41 + .../server/model/ModelReturnTest.java | 41 + .../openapitools/server/model/NameTest.java | 64 + .../server/model/NullableClassTest.java | 136 ++ .../server/model/NumberOnlyTest.java | 41 + .../model/ObjectWithDeprecatedFieldsTest.java | 68 + .../openapitools/server/model/OrderTest.java | 83 + .../server/model/OuterCompositeTest.java | 57 + .../model/OuterEnumDefaultValueTest.java | 30 + .../OuterEnumIntegerDefaultValueTest.java | 30 + .../server/model/OuterEnumIntegerTest.java | 30 + .../server/model/OuterEnumTest.java | 30 + .../OuterObjectWithEnumPropertyTest.java | 41 + .../openapitools/server/model/PetTest.java | 89 + .../server/model/ReadOnlyFirstTest.java | 48 + .../server/model/SingleRefTypeTest.java | 30 + .../server/model/SpecialModelNameTest.java | 41 + .../openapitools/server/model/TagTest.java | 48 + .../openapitools/server/model/UserTest.java | 96 + .../se/.openapi-generator-ignore | 23 + .../se/.openapi-generator/FILES | 122 + .../se/.openapi-generator/VERSION | 1 + .../petstore/java-helidon-server/se/README.md | 74 + .../petstore/java-helidon-server/se/pom.xml | 103 + .../java/org/openapitools/server/Main.java | 103 + .../server/RFC3339DateFormat.java | 50 + .../server/api/AnotherFakeService.java | 32 + .../server/api/AnotherFakeServiceImpl.java | 22 + .../server/api/DefaultService.java | 30 + .../server/api/DefaultServiceImpl.java | 21 + .../api/FakeClassnameTags123Service.java | 32 + .../api/FakeClassnameTags123ServiceImpl.java | 22 + .../openapitools/server/api/FakeService.java | 177 ++ .../server/api/FakeServiceImpl.java | 98 + .../openapitools/server/api/JsonProvider.java | 20 + .../openapitools/server/api/PetService.java | 100 + .../server/api/PetServiceImpl.java | 57 + .../openapitools/server/api/StoreService.java | 57 + .../server/api/StoreServiceImpl.java | 35 + .../openapitools/server/api/UserService.java | 91 + .../server/api/UserServiceImpl.java | 52 + .../server/api/ValidatorUtils.java | 112 + .../model/AdditionalPropertiesClass.java | 85 + .../server/model/AllOfWithSingleRef.java | 84 + .../org/openapitools/server/model/Animal.java | 88 + .../model/ArrayOfArrayOfNumberOnly.java | 69 + .../server/model/ArrayOfNumberOnly.java | 69 + .../openapitools/server/model/ArrayTest.java | 103 + .../server/model/Capitalization.java | 151 ++ .../org/openapitools/server/model/Cat.java | 70 + .../openapitools/server/model/CatAllOf.java | 67 + .../openapitools/server/model/Category.java | 83 + .../openapitools/server/model/ClassModel.java | 68 + .../org/openapitools/server/model/Client.java | 66 + .../server/model/DeprecatedObject.java | 66 + .../org/openapitools/server/model/Dog.java | 70 + .../openapitools/server/model/DogAllOf.java | 67 + .../openapitools/server/model/EnumArrays.java | 161 ++ .../openapitools/server/model/EnumClass.java | 44 + .../openapitools/server/model/EnumTest.java | 343 +++ .../server/model/FileSchemaTestClass.java | 86 + .../org/openapitools/server/model/Foo.java | 66 + .../server/model/FooGetDefaultResponse.java | 68 + .../openapitools/server/model/FormatTest.java | 337 +++ .../server/model/HasOnlyReadOnly.java | 84 + .../server/model/HealthCheckResult.java | 69 + .../openapitools/server/model/MapTest.java | 158 ++ ...ropertiesAndAdditionalPropertiesClass.java | 105 + .../server/model/Model200Response.java | 86 + .../server/model/ModelApiResponse.java | 101 + .../openapitools/server/model/ModelFile.java | 69 + .../openapitools/server/model/ModelList.java | 67 + .../server/model/ModelReturn.java | 69 + .../org/openapitools/server/model/Name.java | 119 + .../server/model/NullableClass.java | 261 ++ .../openapitools/server/model/NumberOnly.java | 67 + .../model/ObjectWithDeprecatedFields.java | 121 + .../org/openapitools/server/model/Order.java | 192 ++ .../server/model/OuterComposite.java | 101 + .../openapitools/server/model/OuterEnum.java | 44 + .../server/model/OuterEnumDefaultValue.java | 44 + .../server/model/OuterEnumInteger.java | 44 + .../model/OuterEnumIntegerDefaultValue.java | 44 + .../model/OuterObjectWithEnumProperty.java | 67 + .../org/openapitools/server/model/Pet.java | 198 ++ .../server/model/ReadOnlyFirst.java | 83 + .../server/model/SingleRefType.java | 43 + .../server/model/SpecialModelName.java | 67 + .../org/openapitools/server/model/Tag.java | 83 + .../org/openapitools/server/model/User.java | 185 ++ .../org/openapitools/server/package-info.java | 1 + .../src/main/resources/META-INF/openapi.yml | 2168 +++++++++++++++++ .../se/src/main/resources/application.yaml | 3 + .../se/src/main/resources/logging.properties | 19 + .../org/openapitools/server/MainTest.java | 47 + .../model/AdditionalPropertiesClassTest.java | 50 + .../server/model/AllOfWithSingleRefTest.java | 49 + .../openapitools/server/model/AnimalTest.java | 53 + .../model/ArrayOfArrayOfNumberOnlyTest.java | 43 + .../server/model/ArrayOfNumberOnlyTest.java | 43 + .../server/model/ArrayTestTest.java | 59 + .../server/model/CapitalizationTest.java | 80 + .../server/model/CatAllOfTest.java | 41 + .../openapitools/server/model/CatTest.java | 60 + .../server/model/CategoryTest.java | 48 + .../server/model/ClassModelTest.java | 40 + .../openapitools/server/model/ClientTest.java | 40 + .../server/model/DeprecatedObjectTest.java | 40 + .../server/model/DogAllOfTest.java | 41 + .../openapitools/server/model/DogTest.java | 60 + .../server/model/EnumArraysTest.java | 52 + .../server/model/EnumClassTest.java | 30 + .../server/model/EnumTestTest.java | 104 + .../server/model/FileSchemaTestClassTest.java | 51 + .../model/FooGetDefaultResponseTest.java | 42 + .../openapitools/server/model/FooTest.java | 40 + .../server/model/FormatTestTest.java | 166 ++ .../server/model/HasOnlyReadOnlyTest.java | 49 + .../server/model/HealthCheckResultTest.java | 41 + .../server/model/MapTestTest.java | 68 + ...rtiesAndAdditionalPropertiesClassTest.java | 61 + .../server/model/Model200ResponseTest.java | 49 + .../server/model/ModelApiResponseTest.java | 57 + .../server/model/ModelFileTest.java | 41 + .../server/model/ModelListTest.java | 41 + .../server/model/ModelReturnTest.java | 41 + .../openapitools/server/model/NameTest.java | 64 + .../server/model/NullableClassTest.java | 136 ++ .../server/model/NumberOnlyTest.java | 41 + .../model/ObjectWithDeprecatedFieldsTest.java | 68 + .../openapitools/server/model/OrderTest.java | 83 + .../server/model/OuterCompositeTest.java | 57 + .../model/OuterEnumDefaultValueTest.java | 30 + .../OuterEnumIntegerDefaultValueTest.java | 30 + .../server/model/OuterEnumIntegerTest.java | 30 + .../server/model/OuterEnumTest.java | 30 + .../OuterObjectWithEnumPropertyTest.java | 41 + .../openapitools/server/model/PetTest.java | 89 + .../server/model/ReadOnlyFirstTest.java | 48 + .../server/model/SingleRefTypeTest.java | 30 + .../server/model/SpecialModelNameTest.java | 41 + .../openapitools/server/model/TagTest.java | 48 + .../openapitools/server/model/UserTest.java | 96 + 604 files changed, 53483 insertions(+) create mode 100644 samples/client/petstore/java-helidon-client/mp/.openapi-generator-ignore create mode 100644 samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES create mode 100644 samples/client/petstore/java-helidon-client/mp/.openapi-generator/VERSION create mode 100644 samples/client/petstore/java-helidon-client/mp/README.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/AllOfWithSingleRef.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/Animal.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/ArrayTest.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/Capitalization.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/Cat.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/CatAllOf.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/Category.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/ClassModel.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/Client.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/DefaultApi.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/DeprecatedObject.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/Dog.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/DogAllOf.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/EnumArrays.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/EnumClass.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/EnumTest.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/Foo.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/FooGetDefaultResponse.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/FormatTest.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/HealthCheckResult.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/MapTest.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/Model200Response.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/ModelFile.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/ModelList.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/ModelReturn.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/Name.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/NullableClass.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/NumberOnly.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/ObjectWithDeprecatedFields.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/Order.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/OuterComposite.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/OuterEnum.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/OuterEnumInteger.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/OuterObjectWithEnumProperty.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/Pet.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/PetApi.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/SingleRefType.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/SpecialModelName.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/StoreApi.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/Tag.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/User.md create mode 100644 samples/client/petstore/java-helidon-client/mp/docs/UserApi.md create mode 100644 samples/client/petstore/java-helidon-client/mp/pom.xml create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/JavaTimeFormatter.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/RFC3339DateFormat.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/ApiException.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/PetApi.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/StoreApi.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/UserApi.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Capitalization.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/CatAllOf.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Category.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ClassModel.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Client.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/DeprecatedObject.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Dog.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/DogAllOf.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumArrays.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumClass.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Foo.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FormatTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/HealthCheckResult.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/MapTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Model200Response.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelApiResponse.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelReturn.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Name.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/NullableClass.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/NumberOnly.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Order.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterComposite.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnum.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumInteger.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Pet.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SingleRefType.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialModelName.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Tag.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/User.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/PetApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/UserApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AnimalTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CatAllOfTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CatTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CategoryTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClientTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DogAllOfTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DogTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MapTestTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NameTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OrderTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/PetTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/TagTest.java create mode 100644 samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/UserTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/.openapi-generator-ignore create mode 100644 samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES create mode 100644 samples/client/petstore/java-helidon-client/se/.openapi-generator/VERSION create mode 100644 samples/client/petstore/java-helidon-client/se/README.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/AllOfWithSingleRef.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/Animal.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/ArrayTest.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/Capitalization.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/Cat.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/CatAllOf.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/Category.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/ClassModel.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/Client.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/DefaultApi.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/DeprecatedObject.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/Dog.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/DogAllOf.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/EnumArrays.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/EnumClass.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/EnumTest.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/FakeApi.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/Foo.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/FooGetDefaultResponse.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/FormatTest.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/HealthCheckResult.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/MapTest.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/Model200Response.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/ModelFile.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/ModelList.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/ModelReturn.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/Name.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/NullableClass.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/NumberOnly.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/ObjectWithDeprecatedFields.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/Order.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/OuterComposite.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/OuterEnum.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/OuterEnumInteger.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/OuterObjectWithEnumProperty.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/Pet.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/PetApi.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/SingleRefType.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/SpecialModelName.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/StoreApi.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/Tag.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/User.md create mode 100644 samples/client/petstore/java-helidon-client/se/docs/UserApi.md create mode 100644 samples/client/petstore/java-helidon-client/se/pom.xml create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiResponseBase.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/Pair.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/RFC3339DateFormat.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/DefaultApiImpl.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/PetApi.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/PetApiImpl.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/ResponseType.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/StoreApi.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/StoreApiImpl.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/UserApi.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/UserApiImpl.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Capitalization.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/CatAllOf.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Category.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ClassModel.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Client.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/DeprecatedObject.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Dog.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/DogAllOf.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumArrays.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumClass.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Foo.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FormatTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/HealthCheckResult.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/MapTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Model200Response.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelApiResponse.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelReturn.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Name.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/NullableClass.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/NumberOnly.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Order.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterComposite.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnum.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumInteger.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Pet.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SingleRefType.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialModelName.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Tag.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/User.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/DefaultApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/PetApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/StoreApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/UserApiTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AnimalTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayTestTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CatAllOfTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CatTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CategoryTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClassModelTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClientTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DogAllOfTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DogTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumArraysTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumClassTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumTestTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FormatTestTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MapTestTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NameTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NullableClassTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OrderTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/PetTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/TagTest.java create mode 100644 samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/UserTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/.openapi-generator-ignore create mode 100644 samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-helidon-server/mp/.openapi-generator/VERSION create mode 100644 samples/server/petstore/java-helidon-server/mp/README.md create mode 100644 samples/server/petstore/java-helidon-server/mp/pom.xml create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/JavaTimeFormatter.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/RFC3339DateFormat.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/RestApplication.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultService.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetService.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreService.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserService.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Capitalization.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/CatAllOf.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Category.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ClassModel.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Client.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/DeprecatedObject.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Dog.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/DogAllOf.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumArrays.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumClass.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Foo.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FormatTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/HealthCheckResult.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/MapTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Model200Response.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelApiResponse.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelFile.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelList.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelReturn.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Name.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/NullableClass.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/NumberOnly.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Order.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterComposite.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnum.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumInteger.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Pet.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SingleRefType.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialModelName.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Tag.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/User.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/package-info.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/beans.xml create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/microprofile-config.properties create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml create mode 100644 samples/server/petstore/java-helidon-server/mp/src/main/resources/logging.properties create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AnimalTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CatAllOfTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CatTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CategoryTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClientTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DogAllOfTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DogTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MapTestTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelListTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NameTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OrderTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/PetTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/TagTest.java create mode 100644 samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/UserTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/.openapi-generator-ignore create mode 100644 samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES create mode 100644 samples/server/petstore/java-helidon-server/se/.openapi-generator/VERSION create mode 100644 samples/server/petstore/java-helidon-server/se/README.md create mode 100644 samples/server/petstore/java-helidon-server/se/pom.xml create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/Main.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/RFC3339DateFormat.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/AnotherFakeService.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/DefaultService.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/JsonProvider.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/PetService.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/PetServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/StoreService.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/StoreServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/UserService.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/UserServiceImpl.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/ValidatorUtils.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Capitalization.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/CatAllOf.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Category.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ClassModel.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Client.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/DeprecatedObject.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Dog.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/DogAllOf.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumArrays.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumClass.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Foo.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FormatTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/HealthCheckResult.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/MapTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Model200Response.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelApiResponse.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelFile.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelList.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelReturn.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Name.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NullableClass.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NumberOnly.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Order.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterComposite.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnum.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumInteger.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Pet.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SingleRefType.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialModelName.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Tag.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/User.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/package-info.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/resources/application.yaml create mode 100644 samples/server/petstore/java-helidon-server/se/src/main/resources/logging.properties create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/MainTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AnimalTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayTestTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CapitalizationTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CatAllOfTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CatTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CategoryTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClassModelTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClientTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DogAllOfTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DogTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumArraysTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumClassTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumTestTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FormatTestTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MapTestTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelFileTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelListTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelReturnTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NameTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NullableClassTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OrderTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/PetTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/TagTest.java create mode 100644 samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/UserTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/.openapi-generator-ignore b/samples/client/petstore/java-helidon-client/mp/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES new file mode 100644 index 00000000000..eb34506786e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES @@ -0,0 +1,172 @@ +.openapi-generator-ignore +README.md +docs/AdditionalPropertiesClass.md +docs/AllOfWithSingleRef.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelFile.md +docs/ModelList.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterObjectWithEnumProperty.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SingleRefType.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +pom.xml +src/main/java/org/openapitools/client/JavaTimeFormatter.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/ApiException.java +src/main/java/org/openapitools/client/api/ApiExceptionMapper.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/DeprecatedObject.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java +src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelFile.java +src/main/java/org/openapitools/client/model/ModelList.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/client/model/OuterEnumInteger.java +src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SingleRefType.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/User.java +src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/api/FakeApiTest.java +src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +src/test/java/org/openapitools/client/api/PetApiTest.java +src/test/java/org/openapitools/client/api/StoreApiTest.java +src/test/java/org/openapitools/client/api/UserApiTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +src/test/java/org/openapitools/client/model/AnimalTest.java +src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/client/model/ArrayTestTest.java +src/test/java/org/openapitools/client/model/CapitalizationTest.java +src/test/java/org/openapitools/client/model/CatAllOfTest.java +src/test/java/org/openapitools/client/model/CatTest.java +src/test/java/org/openapitools/client/model/CategoryTest.java +src/test/java/org/openapitools/client/model/ClassModelTest.java +src/test/java/org/openapitools/client/model/ClientTest.java +src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +src/test/java/org/openapitools/client/model/DogAllOfTest.java +src/test/java/org/openapitools/client/model/DogTest.java +src/test/java/org/openapitools/client/model/EnumArraysTest.java +src/test/java/org/openapitools/client/model/EnumClassTest.java +src/test/java/org/openapitools/client/model/EnumTestTest.java +src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +src/test/java/org/openapitools/client/model/FooTest.java +src/test/java/org/openapitools/client/model/FormatTestTest.java +src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +src/test/java/org/openapitools/client/model/MapTestTest.java +src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +src/test/java/org/openapitools/client/model/Model200ResponseTest.java +src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +src/test/java/org/openapitools/client/model/ModelFileTest.java +src/test/java/org/openapitools/client/model/ModelListTest.java +src/test/java/org/openapitools/client/model/ModelReturnTest.java +src/test/java/org/openapitools/client/model/NameTest.java +src/test/java/org/openapitools/client/model/NullableClassTest.java +src/test/java/org/openapitools/client/model/NumberOnlyTest.java +src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +src/test/java/org/openapitools/client/model/OrderTest.java +src/test/java/org/openapitools/client/model/OuterCompositeTest.java +src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +src/test/java/org/openapitools/client/model/OuterEnumTest.java +src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +src/test/java/org/openapitools/client/model/PetTest.java +src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +src/test/java/org/openapitools/client/model/TagTest.java +src/test/java/org/openapitools/client/model/UserTest.java diff --git a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/VERSION b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/VERSION new file mode 100644 index 00000000000..7b7e20b5703 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java-helidon-client/mp/README.md b/samples/client/petstore/java-helidon-client/mp/README.md new file mode 100644 index 00000000000..18c68cbe838 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/README.md @@ -0,0 +1,7 @@ +# OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +## Overview +This project was generated using the Helidon OpenAPI Generator. diff --git a/samples/client/petstore/java-helidon-client/mp/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java-helidon-client/mp/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..fe69a56eebf --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/AdditionalPropertiesClass.md @@ -0,0 +1,14 @@ + + +# AdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapProperty** | **Map<String, String>** | | [optional] | +|**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/AllOfWithSingleRef.md b/samples/client/petstore/java-helidon-client/mp/docs/AllOfWithSingleRef.md new file mode 100644 index 00000000000..0a9e61bc682 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/AllOfWithSingleRef.md @@ -0,0 +1,14 @@ + + +# AllOfWithSingleRef + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**username** | **String** | | [optional] | +|**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Animal.md b/samples/client/petstore/java-helidon-client/mp/docs/Animal.md new file mode 100644 index 00000000000..d9b32f14c88 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/Animal.md @@ -0,0 +1,14 @@ + + +# Animal + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**className** | **String** | | | +|**color** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/AnotherFakeApi.md b/samples/client/petstore/java-helidon-client/mp/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..86cfd1bdc7c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/AnotherFakeApi.md @@ -0,0 +1,44 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags | + + + +## call123testSpecialTags + +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java-helidon-client/mp/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..0188db3eb13 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java-helidon-client/mp/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..a5753530aad --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/ArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayNumber** | **List<BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ArrayTest.md b/samples/client/petstore/java-helidon-client/mp/docs/ArrayTest.md new file mode 100644 index 00000000000..36077c9df30 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/ArrayTest.md @@ -0,0 +1,15 @@ + + +# ArrayTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayOfString** | **List<String>** | | [optional] | +|**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] | +|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Capitalization.md b/samples/client/petstore/java-helidon-client/mp/docs/Capitalization.md new file mode 100644 index 00000000000..82a812711de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/Capitalization.md @@ -0,0 +1,18 @@ + + +# Capitalization + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**smallCamel** | **String** | | [optional] | +|**capitalCamel** | **String** | | [optional] | +|**smallSnake** | **String** | | [optional] | +|**capitalSnake** | **String** | | [optional] | +|**scAETHFlowPoints** | **String** | | [optional] | +|**ATT_NAME** | **String** | Name of the pet | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Cat.md b/samples/client/petstore/java-helidon-client/mp/docs/Cat.md new file mode 100644 index 00000000000..390dd519c8c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/Cat.md @@ -0,0 +1,13 @@ + + +# Cat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**declawed** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/CatAllOf.md b/samples/client/petstore/java-helidon-client/mp/docs/CatAllOf.md new file mode 100644 index 00000000000..926bc0abd78 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/CatAllOf.md @@ -0,0 +1,13 @@ + + +# CatAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**declawed** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Category.md b/samples/client/petstore/java-helidon-client/mp/docs/Category.md new file mode 100644 index 00000000000..ab6d1ec334d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/Category.md @@ -0,0 +1,14 @@ + + +# Category + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ClassModel.md b/samples/client/petstore/java-helidon-client/mp/docs/ClassModel.md new file mode 100644 index 00000000000..af46dea1f6c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/ClassModel.md @@ -0,0 +1,14 @@ + + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Client.md b/samples/client/petstore/java-helidon-client/mp/docs/Client.md new file mode 100644 index 00000000000..ef07b4ab8b9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/Client.md @@ -0,0 +1,13 @@ + + +# Client + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**client** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/DefaultApi.md b/samples/client/petstore/java-helidon-client/mp/docs/DefaultApi.md new file mode 100644 index 00000000000..d94c3e5f15b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/DefaultApi.md @@ -0,0 +1,39 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | | + + + +## fooGet + +> FooGetDefaultResponse fooGet() + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | response | - | + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/DeprecatedObject.md b/samples/client/petstore/java-helidon-client/mp/docs/DeprecatedObject.md new file mode 100644 index 00000000000..48de1d62442 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/DeprecatedObject.md @@ -0,0 +1,13 @@ + + +# DeprecatedObject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Dog.md b/samples/client/petstore/java-helidon-client/mp/docs/Dog.md new file mode 100644 index 00000000000..972c981c0d0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/Dog.md @@ -0,0 +1,13 @@ + + +# Dog + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**breed** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/DogAllOf.md b/samples/client/petstore/java-helidon-client/mp/docs/DogAllOf.md new file mode 100644 index 00000000000..d4e4ea0d548 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/DogAllOf.md @@ -0,0 +1,13 @@ + + +# DogAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**breed** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/EnumArrays.md b/samples/client/petstore/java-helidon-client/mp/docs/EnumArrays.md new file mode 100644 index 00000000000..b2222d5beb2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/EnumArrays.md @@ -0,0 +1,32 @@ + + +# EnumArrays + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] | +|**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] | + + + +## Enum: JustSymbolEnum + +| Name | Value | +|---- | -----| +| GREATER_THAN_OR_EQUAL_TO | ">=" | +| DOLLAR | "$" | + + + +## Enum: List<ArrayEnumEnum> + +| Name | Value | +|---- | -----| +| FISH | "fish" | +| CRAB | "crab" | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/EnumClass.md b/samples/client/petstore/java-helidon-client/mp/docs/EnumClass.md new file mode 100644 index 00000000000..b314590a759 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/EnumTest.md b/samples/client/petstore/java-helidon-client/mp/docs/EnumTest.md new file mode 100644 index 00000000000..380a2aef0bc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/EnumTest.md @@ -0,0 +1,58 @@ + + +# EnumTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] | +|**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | | +|**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] | +|**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] | +|**outerEnum** | **OuterEnum** | | [optional] | +|**outerEnumInteger** | **OuterEnumInteger** | | [optional] | +|**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] | +|**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] | + + + +## Enum: EnumStringEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumStringRequiredEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumIntegerEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_MINUS_1 | -1 | + + + +## Enum: EnumNumberEnum + +| Name | Value | +|---- | -----| +| NUMBER_1_DOT_1 | 1.1 | +| NUMBER_MINUS_1_DOT_2 | -1.2 | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md b/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md new file mode 100644 index 00000000000..9dfe49d51cc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/FakeApi.md @@ -0,0 +1,649 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | +| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | +| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | +| [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | +| [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | +| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | +| [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | +| [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | +| [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | +| [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model | +| [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | +| [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | +| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | +| [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | + + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeHttpSignatureTest + +> void fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeOuterBooleanSerialize + +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **Boolean**| Input boolean as post body | [optional] | + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + + +## fakeOuterNumberSerialize + +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **BigDecimal**| Input number as post body | [optional] | + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + + +## fakeOuterStringSerialize + +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **String**| Input string as post body | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + + +## fakePropertyEnumIntegerSerialize + +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output enum (int) | - | + + +## testBodyWithBinary + +> void testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **File**| image to upload | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: image/png +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithFileSchema + +> void testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithQueryParams + +> void testBodyWithQueryParams(query, user) + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **query** | **String**| | | +| **user** | [**User**](User.md)| | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testEndpointParameters + +> void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **number** | **BigDecimal**| None | | +| **_double** | **Double**| None | | +| **patternWithoutDelimiter** | **String**| None | | +| **_byte** | **byte[]**| None | | +| **integer** | **Integer**| None | [optional] | +| **int32** | **Integer**| None | [optional] | +| **int64** | **Long**| None | [optional] | +| **_float** | **Float**| None | [optional] | +| **string** | **String**| None | [optional] | +| **binary** | **File**| None | [optional] | +| **date** | **LocalDate**| None | [optional] | +| **dateTime** | **OffsetDateTime**| None | [optional] | +| **password** | **String**| None | [optional] | +| **paramCallback** | **String**| None | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## testEnumParameters + +> void testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] | +| **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] | +| **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] | +| **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] | +| **enumQueryModelArray** | [**List<EnumClass>**](EnumClass.md)| | [optional] | +| **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] | +| **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + + +## testGroupParameters + +> void testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredStringGroup** | **Integer**| Required String in group parameters | | +| **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | | +| **requiredInt64Group** | **Long**| Required Integer in group parameters | | +| **stringGroup** | **Integer**| String in group parameters | [optional] | +| **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] | +| **int64Group** | **Long**| Integer in group parameters | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + + +## testInlineAdditionalProperties + +> void testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testJsonFormData + +> void testJsonFormData(param, param2) + +test json serialization of form data + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **param** | **String**| field1 | | +| **param2** | **String**| field2 | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testQueryParameterCollectionFormat + +> void testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) + + + +To test the collection format in query parameters + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pipe** | [**List<String>**](String.md)| | | +| **ioutil** | [**List<String>**](String.md)| | | +| **http** | [**List<String>**](String.md)| | | +| **url** | [**List<String>**](String.md)| | | +| **context** | [**List<String>**](String.md)| | | +| **allowEmpty** | **String**| | | +| **language** | [**Map<String, String>**](String.md)| | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java-helidon-client/mp/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..bcea773b6fb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/FakeClassnameTags123Api.md @@ -0,0 +1,44 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case | + + + +## testClassname + +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FileSchemaTestClass.md b/samples/client/petstore/java-helidon-client/mp/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..85d1a063669 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/FileSchemaTestClass.md @@ -0,0 +1,14 @@ + + +# FileSchemaTestClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | [**ModelFile**](ModelFile.md) | | [optional] | +|**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Foo.md b/samples/client/petstore/java-helidon-client/mp/docs/Foo.md new file mode 100644 index 00000000000..6b3f0556528 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/Foo.md @@ -0,0 +1,13 @@ + + +# Foo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FooGetDefaultResponse.md b/samples/client/petstore/java-helidon-client/mp/docs/FooGetDefaultResponse.md new file mode 100644 index 00000000000..ff3d7a3a56c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/FooGetDefaultResponse.md @@ -0,0 +1,13 @@ + + +# FooGetDefaultResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**string** | [**Foo**](Foo.md) | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/FormatTest.md b/samples/client/petstore/java-helidon-client/mp/docs/FormatTest.md new file mode 100644 index 00000000000..01b8c777ae0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/FormatTest.md @@ -0,0 +1,28 @@ + + +# FormatTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integer** | **Integer** | | [optional] | +|**int32** | **Integer** | | [optional] | +|**int64** | **Long** | | [optional] | +|**number** | **BigDecimal** | | | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | +|**decimal** | **BigDecimal** | | [optional] | +|**string** | **String** | | [optional] | +|**_byte** | **byte[]** | | | +|**binary** | **File** | | [optional] | +|**date** | **LocalDate** | | | +|**dateTime** | **OffsetDateTime** | | [optional] | +|**uuid** | **UUID** | | [optional] | +|**password** | **String** | | | +|**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] | +|**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/HasOnlyReadOnly.md b/samples/client/petstore/java-helidon-client/mp/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..29da5205dbb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/HasOnlyReadOnly.md @@ -0,0 +1,14 @@ + + +# HasOnlyReadOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**foo** | **String** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/HealthCheckResult.md b/samples/client/petstore/java-helidon-client/mp/docs/HealthCheckResult.md new file mode 100644 index 00000000000..4885e6f1cad --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/HealthCheckResult.md @@ -0,0 +1,14 @@ + + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nullableMessage** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/MapTest.md b/samples/client/petstore/java-helidon-client/mp/docs/MapTest.md new file mode 100644 index 00000000000..54380188e1d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/MapTest.md @@ -0,0 +1,25 @@ + + +# MapTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] | +|**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] | +|**directMap** | **Map<String, Boolean>** | | [optional] | +|**indirectMap** | **Map<String, Boolean>** | | [optional] | + + + +## Enum: Map<String, InnerEnum> + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java-helidon-client/mp/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..a5ddf0faa6a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,15 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **UUID** | | [optional] | +|**dateTime** | **OffsetDateTime** | | [optional] | +|**map** | [**Map<String, Animal>**](Animal.md) | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Model200Response.md b/samples/client/petstore/java-helidon-client/mp/docs/Model200Response.md new file mode 100644 index 00000000000..109411580c6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/Model200Response.md @@ -0,0 +1,15 @@ + + +# Model200Response + +Model for testing model name starting with number + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | [optional] | +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ModelApiResponse.md b/samples/client/petstore/java-helidon-client/mp/docs/ModelApiResponse.md new file mode 100644 index 00000000000..e374c2dd2de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/ModelApiResponse.md @@ -0,0 +1,15 @@ + + +# ModelApiResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**type** | **String** | | [optional] | +|**message** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ModelFile.md b/samples/client/petstore/java-helidon-client/mp/docs/ModelFile.md new file mode 100644 index 00000000000..adcde984f52 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sourceURI** | **String** | Test capitalization | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ModelList.md b/samples/client/petstore/java-helidon-client/mp/docs/ModelList.md new file mode 100644 index 00000000000..f93ab7dde8d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_123list** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ModelReturn.md b/samples/client/petstore/java-helidon-client/mp/docs/ModelReturn.md new file mode 100644 index 00000000000..0bd356861eb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/ModelReturn.md @@ -0,0 +1,14 @@ + + +# ModelReturn + +Model for testing reserved words + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_return** | **Integer** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Name.md b/samples/client/petstore/java-helidon-client/mp/docs/Name.md new file mode 100644 index 00000000000..c901d943530 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/Name.md @@ -0,0 +1,17 @@ + + +# Name + +Model for testing model name same as property name + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | | +|**snakeCase** | **Integer** | | [optional] [readonly] | +|**property** | **String** | | [optional] | +|**_123number** | **Integer** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/NullableClass.md b/samples/client/petstore/java-helidon-client/mp/docs/NullableClass.md new file mode 100644 index 00000000000..fa98c5c6d98 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/NullableClass.md @@ -0,0 +1,24 @@ + + +# NullableClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integerProp** | **Integer** | | [optional] | +|**numberProp** | **BigDecimal** | | [optional] | +|**booleanProp** | **Boolean** | | [optional] | +|**stringProp** | **String** | | [optional] | +|**dateProp** | **LocalDate** | | [optional] | +|**datetimeProp** | **OffsetDateTime** | | [optional] | +|**arrayNullableProp** | **List<Object>** | | [optional] | +|**arrayAndItemsNullableProp** | **List<Object>** | | [optional] | +|**arrayItemsNullable** | **List<Object>** | | [optional] | +|**objectNullableProp** | **Map<String, Object>** | | [optional] | +|**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] | +|**objectItemsNullable** | **Map<String, Object>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/NumberOnly.md b/samples/client/petstore/java-helidon-client/mp/docs/NumberOnly.md new file mode 100644 index 00000000000..b8ed1a4cfae --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/NumberOnly.md @@ -0,0 +1,13 @@ + + +# NumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justNumber** | **BigDecimal** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java-helidon-client/mp/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 00000000000..f1cf571f4c0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,16 @@ + + +# ObjectWithDeprecatedFields + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **String** | | [optional] | +|**id** | **BigDecimal** | | [optional] | +|**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] | +|**bars** | **List<String>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Order.md b/samples/client/petstore/java-helidon-client/mp/docs/Order.md new file mode 100644 index 00000000000..27af32855c5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/Order.md @@ -0,0 +1,28 @@ + + +# Order + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**petId** | **Long** | | [optional] | +|**quantity** | **Integer** | | [optional] | +|**shipDate** | **OffsetDateTime** | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] | +|**complete** | **Boolean** | | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| PLACED | "placed" | +| APPROVED | "approved" | +| DELIVERED | "delivered" | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/OuterComposite.md b/samples/client/petstore/java-helidon-client/mp/docs/OuterComposite.md new file mode 100644 index 00000000000..98b56e0763f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/OuterComposite.md @@ -0,0 +1,15 @@ + + +# OuterComposite + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**myNumber** | **BigDecimal** | | [optional] | +|**myString** | **String** | | [optional] | +|**myBoolean** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/OuterEnum.md b/samples/client/petstore/java-helidon-client/mp/docs/OuterEnum.md new file mode 100644 index 00000000000..1f9b723eb8e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java-helidon-client/mp/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..cbc7f4ba54d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/OuterEnumDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumDefaultValue + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/OuterEnumInteger.md b/samples/client/petstore/java-helidon-client/mp/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..f71dea30ad0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/OuterEnumInteger.md @@ -0,0 +1,15 @@ + + +# OuterEnumInteger + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java-helidon-client/mp/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..99e6389f427 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumIntegerDefaultValue + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/java-helidon-client/mp/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 00000000000..0fafaaa2715 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/OuterObjectWithEnumProperty.md @@ -0,0 +1,13 @@ + + +# OuterObjectWithEnumProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**value** | **OuterEnumInteger** | | | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Pet.md b/samples/client/petstore/java-helidon-client/mp/docs/Pet.md new file mode 100644 index 00000000000..54af77a9f5a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/Pet.md @@ -0,0 +1,28 @@ + + +# Pet + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**category** | [**Category**](Category.md) | | [optional] | +|**name** | **String** | | | +|**photoUrls** | **Set<String>** | | | +|**tags** | [**List<Tag>**](Tag.md) | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| AVAILABLE | "available" | +| PENDING | "pending" | +| SOLD | "sold" | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/PetApi.md b/samples/client/petstore/java-helidon-client/mp/docs/PetApi.md new file mode 100644 index 00000000000..2f1e3c02a2e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/PetApi.md @@ -0,0 +1,349 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | + + + +## addPet + +> void addPet(pet) + +Add a new pet to the store + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + + +## deletePet + +> void deletePet(petId, apiKey) + +Deletes a pet + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| Pet id to delete | | +| **apiKey** | **String**| | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid pet value | - | + + +## findPetsByStatus + +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + + +## findPetsByTags + +> Set<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | [**Set<String>**](String.md)| Tags to filter by | | + +### Return type + +[**Set<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + + +## updatePet + +> void updatePet(pet) + +Update an existing pet + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + + +## updatePetWithForm + +> void updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet that needs to be updated | | +| **name** | **String**| Updated name of the pet | [optional] | +| **status** | **String**| Updated status of the pet | [optional] | + +### Return type + +[**void**](Void.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, _file) + +uploads an image + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | +| **_file** | **File**| file to upload | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **requiredFile** | **File**| file to upload | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/ReadOnlyFirst.md b/samples/client/petstore/java-helidon-client/mp/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..ad6af7ee155 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/ReadOnlyFirst.md @@ -0,0 +1,14 @@ + + +# ReadOnlyFirst + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**baz** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/SingleRefType.md b/samples/client/petstore/java-helidon-client/mp/docs/SingleRefType.md new file mode 100644 index 00000000000..cc269bb871f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/SingleRefType.md @@ -0,0 +1,13 @@ + + +# SingleRefType + +## Enum + + +* `ADMIN` (value: `"admin"`) + +* `USER` (value: `"user"`) + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/SpecialModelName.md b/samples/client/petstore/java-helidon-client/mp/docs/SpecialModelName.md new file mode 100644 index 00000000000..4b6a06e3622 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/SpecialModelName.md @@ -0,0 +1,13 @@ + + +# SpecialModelName + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$specialPropertyName** | **Long** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/StoreApi.md b/samples/client/petstore/java-helidon-client/mp/docs/StoreApi.md new file mode 100644 index 00000000000..299fb326568 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/StoreApi.md @@ -0,0 +1,153 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> void deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **String**| ID of the order that needs to be deleted | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## getInventory + +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **Long**| ID of pet that needs to be fetched | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/Tag.md b/samples/client/petstore/java-helidon-client/mp/docs/Tag.md new file mode 100644 index 00000000000..5088b2dd1c3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/Tag.md @@ -0,0 +1,14 @@ + + +# Tag + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/User.md b/samples/client/petstore/java-helidon-client/mp/docs/User.md new file mode 100644 index 00000000000..08813e4b10b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/User.md @@ -0,0 +1,20 @@ + + +# User + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**username** | **String** | | [optional] | +|**firstName** | **String** | | [optional] | +|**lastName** | **String** | | [optional] | +|**email** | **String** | | [optional] | +|**password** | **String** | | [optional] | +|**phone** | **String** | | [optional] | +|**userStatus** | **Integer** | User Status | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/mp/docs/UserApi.md b/samples/client/petstore/java-helidon-client/mp/docs/UserApi.md new file mode 100644 index 00000000000..5f33613cbe5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/docs/UserApi.md @@ -0,0 +1,300 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createUser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> void createUser(user) + +Create user + +This can only be done by the logged in user. + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**User**](User.md)| Created user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## createUsersWithArrayInput + +> void createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## createUsersWithListInput + +> void createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## deleteUser + +> void deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be deleted | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be fetched. Use user1 for testing. | | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## loginUser + +> String loginUser(username, password) + +Logs user into the system + + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The user name for login | | +| **password** | **String**| The password for login in clear text | | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + + +## logoutUser + +> void logoutUser() + +Logs out current logged in user session + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## updateUser + +> void updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| name that need to be deleted | | +| **user** | [**User**](User.md)| Updated user object | | + +### Return type + +[**void**](Void.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + diff --git a/samples/client/petstore/java-helidon-client/mp/pom.xml b/samples/client/petstore/java-helidon-client/mp/pom.xml new file mode 100644 index 00000000000..ccf28c4c1a6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/pom.xml @@ -0,0 +1,78 @@ + + 4.0.0 + org.openapitools + + io.helidon.applications + helidon-mp + 3.0.1 + + + petstore-helidon-client-mp + petstore-helidon-client-mp + 1.0.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + jar + + + + io.helidon.microprofile.rest-client + helidon-microprofile-rest-client + + + io.helidon.microprofile.config + helidon-microprofile-config + + + org.glassfish.jersey.ext.cdi + jersey-cdi1x + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + jakarta.json + jakarta.json-api + + + org.glassfish.jersey.media + jersey-media-json-jackson + + + org.openapitools + jackson-databind-nullable + 0.2.2 + + + org.junit.jupiter + junit-jupiter-api + test + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-libs + + + + + org.jboss.jandex + jandex-maven-plugin + + + make-index + + + + + + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/JavaTimeFormatter.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/JavaTimeFormatter.java new file mode 100644 index 00000000000..8a222f52403 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonClientCodegen") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 00000000000..dd96c18c0d3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..c2a678cc0f0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -0,0 +1,49 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import org.openapitools.client.model.Client; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("/another-fake/dummy") +public interface AnotherFakeApi { + + /** + * To test special tags + * To test special tags and operation ID starting with number + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client call123testSpecialTags(Client client) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/ApiException.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/ApiException.java new file mode 100644 index 00000000000..c05f1ebf842 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/ApiException.java @@ -0,0 +1,30 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import jakarta.ws.rs.core.Response; + +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private final Response response; + + public ApiException(Response response) { + super("Api response has status code " + response.getStatus()); + this.response = response; + } + + public Response getResponse() { + return this.response; + } +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java new file mode 100644 index 00000000000..4c425b56695 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/ApiExceptionMapper.java @@ -0,0 +1,33 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.Provider; + +import org.eclipse.microprofile.rest.client.ext.ResponseExceptionMapper; + +@Provider +public class ApiExceptionMapper implements ResponseExceptionMapper { + + @Override + public boolean handles(int status, MultivaluedMap headers) { + return status >= 400; + } + + @Override + public ApiException toThrowable(Response response) { + return new ApiException(response); + } +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..a53eaf73daf --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,44 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import org.openapitools.client.model.FooGetDefaultResponse; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("/foo") +public interface DefaultApi { + + @GET + + @Produces({ "application/json" }) + FooGetDefaultResponse fooGet() throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 00000000000..122edf22556 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,169 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.User; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("/fake") +public interface FakeApi { + + /** + * Health check endpoint + */ + @GET + @Path("/health") + @Produces({ "application/json" }) + HealthCheckResult fakeHealthGet() throws ApiException, ProcessingException; + + /** + * test http signature authentication + */ + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + void fakeHttpSignatureTest(Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1) throws ApiException, ProcessingException; + + @POST + @Path("/outer/boolean") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException, ProcessingException; + + @POST + @Path("/outer/composite") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException, ProcessingException; + + @POST + @Path("/outer/number") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException, ProcessingException; + + @POST + @Path("/outer/string") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + String fakeOuterStringSerialize(String body) throws ApiException, ProcessingException; + + @POST + @Path("/property/enum-int") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-binary") + @Consumes({ "image/png" }) + void testBodyWithBinary(File body) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-file-schema") + @Consumes({ "application/json" }) + void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException, ProcessingException; + + @PUT + @Path("/body-with-query-params") + @Consumes({ "application/json" }) + void testBodyWithQueryParams(@QueryParam("query") String query, User user) throws ApiException, ProcessingException; + + /** + * To test \"client\" model + * To test \"client\" model + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client testClientModel(Client client) throws ApiException, ProcessingException; + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + */ + @POST + + @Consumes({ "application/x-www-form-urlencoded" }) + void testEndpointParameters(@FormParam("number") BigDecimal number, @FormParam("double") Double _double, @FormParam("pattern_without_delimiter") String patternWithoutDelimiter, @FormParam("byte") byte[] _byte, @FormParam("integer") Integer integer, @FormParam("int32") Integer int32, @FormParam("int64") Long int64, @FormParam("float") Float _float, @FormParam("string") String string, @FormParam("binary") File binary, @FormParam("date") LocalDate date, @FormParam("dateTime") OffsetDateTime dateTime, @FormParam("password") String password, @FormParam("callback") String paramCallback) throws ApiException, ProcessingException; + + /** + * To test enum parameters + * To test enum parameters + */ + @GET + + @Consumes({ "application/x-www-form-urlencoded" }) + void testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @QueryParam("enum_query_double") Double enumQueryDouble, @QueryParam("enum_query_model_array") List enumQueryModelArray, @FormParam("enum_form_string_array") List enumFormStringArray, @FormParam("enum_form_string") String enumFormString) throws ApiException, ProcessingException; + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + */ + @DELETE + + void testGroupParameters(@QueryParam("required_string_group") Integer requiredStringGroup, @HeaderParam("required_boolean_group") Boolean requiredBooleanGroup, @QueryParam("required_int64_group") Long requiredInt64Group, @QueryParam("string_group") Integer stringGroup, @HeaderParam("boolean_group") Boolean booleanGroup, @QueryParam("int64_group") Long int64Group) throws ApiException, ProcessingException; + + /** + * test inline additionalProperties + * + */ + @POST + @Path("/inline-additionalProperties") + @Consumes({ "application/json" }) + void testInlineAdditionalProperties(Map requestBody) throws ApiException, ProcessingException; + + /** + * test json serialization of form data + * + */ + @GET + @Path("/jsonFormData") + @Consumes({ "application/x-www-form-urlencoded" }) + void testJsonFormData(@FormParam("param") String param, @FormParam("param2") String param2) throws ApiException, ProcessingException; + + @PUT + @Path("/test-query-parameters") + void testQueryParameterCollectionFormat(@QueryParam("pipe") List pipe, @QueryParam("ioutil") List ioutil, @QueryParam("http") List http, @QueryParam("url") List url, @QueryParam("context") List context, @QueryParam("allowEmpty") String allowEmpty, @QueryParam("language") Map language) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 00000000000..aaeb4a55e40 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -0,0 +1,49 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import org.openapitools.client.model.Client; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("/fake_classname_test") +public interface FakeClassnameTags123Api { + + /** + * To test class name in snake case + * To test class name in snake case + */ + @PATCH + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + Client testClassname(Client client) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 00000000000..0248f2e6912 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,126 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import java.util.Set; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("") +public interface PetApi { + + /** + * Add a new pet to the store + * + */ + @POST + @Path("/pet") + @Consumes({ "application/json", "application/xml" }) + void addPet(Pet pet) throws ApiException, ProcessingException; + + /** + * Deletes a pet + * + */ + @DELETE + @Path("/pet/{petId}") + void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey) throws ApiException, ProcessingException; + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + */ + @GET + @Path("/pet/findByStatus") + @Produces({ "application/xml", "application/json" }) + List findPetsByStatus(@QueryParam("status") List status) throws ApiException, ProcessingException; + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @deprecated + */ + @Deprecated + @GET + @Path("/pet/findByTags") + @Produces({ "application/xml", "application/json" }) + Set findPetsByTags(@QueryParam("tags") Set tags) throws ApiException, ProcessingException; + + /** + * Find pet by ID + * Returns a single pet + */ + @GET + @Path("/pet/{petId}") + @Produces({ "application/xml", "application/json" }) + Pet getPetById(@PathParam("petId") Long petId) throws ApiException, ProcessingException; + + /** + * Update an existing pet + * + */ + @PUT + @Path("/pet") + @Consumes({ "application/json", "application/xml" }) + void updatePet(Pet pet) throws ApiException, ProcessingException; + + /** + * Updates a pet in the store with form data + * + */ + @POST + @Path("/pet/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + void updatePetWithForm(@PathParam("petId") Long petId, @FormParam("name") String name, @FormParam("status") String status) throws ApiException, ProcessingException; + + /** + * uploads an image + * + */ + @POST + @Path("/pet/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + ModelApiResponse uploadFile(@PathParam("petId") Long petId, @FormParam("additionalMetadata") String additionalMetadata, @FormParam("file") File _file) throws ApiException, ProcessingException; + + /** + * uploads an image (required) + * + */ + @POST + @Path("/fake/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") Long petId, @FormParam("requiredFile") File requiredFile, @FormParam("additionalMetadata") String additionalMetadata) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 00000000000..ff2dfbfbca6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/StoreApi.java @@ -0,0 +1,75 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import org.openapitools.client.model.Order; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("/store") +public interface StoreApi { + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + */ + @DELETE + @Path("/order/{order_id}") + void deleteOrder(@PathParam("order_id") String orderId) throws ApiException, ProcessingException; + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + */ + @GET + @Path("/inventory") + @Produces({ "application/json" }) + Map getInventory() throws ApiException, ProcessingException; + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + */ + @GET + @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) + Order getOrderById(@PathParam("order_id") Long orderId) throws ApiException, ProcessingException; + + /** + * Place an order for a pet + * + */ + @POST + @Path("/order") + @Consumes({ "application/json" }) + @Produces({ "application/xml", "application/json" }) + Order placeOrder(Order order) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 00000000000..48e64286d87 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,110 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; + +import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; +import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +@RegisterRestClient +@RegisterProvider(ApiExceptionMapper.class) +@Path("/user") +public interface UserApi { + + /** + * Create user + * This can only be done by the logged in user. + */ + @POST + + @Consumes({ "application/json" }) + void createUser(User user) throws ApiException, ProcessingException; + + /** + * Creates list of users with given input array + * + */ + @POST + @Path("/createWithArray") + @Consumes({ "application/json" }) + void createUsersWithArrayInput(List user) throws ApiException, ProcessingException; + + /** + * Creates list of users with given input array + * + */ + @POST + @Path("/createWithList") + @Consumes({ "application/json" }) + void createUsersWithListInput(List user) throws ApiException, ProcessingException; + + /** + * Delete user + * This can only be done by the logged in user. + */ + @DELETE + @Path("/{username}") + void deleteUser(@PathParam("username") String username) throws ApiException, ProcessingException; + + /** + * Get user by user name + * + */ + @GET + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + User getUserByName(@PathParam("username") String username) throws ApiException, ProcessingException; + + /** + * Logs user into the system + * + */ + @GET + @Path("/login") + @Produces({ "application/xml", "application/json" }) + String loginUser(@QueryParam("username") String username, @QueryParam("password") String password) throws ApiException, ProcessingException; + + /** + * Logs out current logged in user session + * + */ + @GET + @Path("/logout") + void logoutUser() throws ApiException, ProcessingException; + + /** + * Updated user + * This can only be done by the logged in user. + */ + @PUT + @Path("/{username}") + @Consumes({ "application/json" }) + void updateUser(@PathParam("username") String username, User user) throws ApiException, ProcessingException; +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..abc3d296fa3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,108 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + + + + +public class AdditionalPropertiesClass { + + private Map mapProperty = null; + + private Map> mapOfMapProperty = null; + + /** + * Get mapProperty + * @return mapProperty + **/ + public Map getMapProperty() { + return mapProperty; + } + + /** + * Set mapProperty + **/ + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + /** + * Set mapOfMapProperty + **/ + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java new file mode 100644 index 00000000000..cb7b8b0a681 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -0,0 +1,97 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.SingleRefType; + + + + +public class AllOfWithSingleRef { + + private String username; + + private SingleRefType singleRefType; + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + **/ + public void setUsername(String username) { + this.username = username; + } + + public AllOfWithSingleRef username(String username) { + this.username = username; + return this; + } + + /** + * Get singleRefType + * @return singleRefType + **/ + public SingleRefType getSingleRefType() { + return singleRefType; + } + + /** + * Set singleRefType + **/ + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 00000000000..36ecf9c54f6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Animal.java @@ -0,0 +1,101 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import org.openapitools.client.model.Dog; + + + + +public class Animal { + + private String className; + + private String color = "red"; + + /** + * Get className + * @return className + **/ + public String getClassName() { + return className; + } + + /** + * Set className + **/ + public void setClassName(String className) { + this.className = className; + } + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get color + * @return color + **/ + public String getColor() { + return color; + } + + /** + * Set color + **/ + public void setColor(String color) { + this.color = color; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..d451b999d86 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,81 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + + +public class ArrayOfArrayOfNumberOnly { + + private List> arrayArrayNumber = null; + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + /** + * Set arrayArrayNumber + **/ + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..3b64bf9e879 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,81 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + + +public class ArrayOfNumberOnly { + + private List arrayNumber = null; + + /** + * Get arrayNumber + * @return arrayNumber + **/ + public List getArrayNumber() { + return arrayNumber; + } + + /** + * Set arrayNumber + **/ + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + this.arrayNumber.add(arrayNumberItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 00000000000..ab1f6d17917 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -0,0 +1,137 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; + + + + +public class ArrayTest { + + private List arrayOfString = null; + + private List> arrayArrayOfInteger = null; + + private List> arrayArrayOfModel = null; + + /** + * Get arrayOfString + * @return arrayOfString + **/ + public List getArrayOfString() { + return arrayOfString; + } + + /** + * Set arrayOfString + **/ + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + /** + * Set arrayArrayOfInteger + **/ + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + /** + * Set arrayArrayOfModel + **/ + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 00000000000..f6d3fde93d4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Capitalization.java @@ -0,0 +1,191 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Capitalization { + + private String smallCamel; + + private String capitalCamel; + + private String smallSnake; + + private String capitalSnake; + + private String scAETHFlowPoints; + + /** + * Name of the pet + **/ + private String ATT_NAME; + + /** + * Get smallCamel + * @return smallCamel + **/ + public String getSmallCamel() { + return smallCamel; + } + + /** + * Set smallCamel + **/ + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + public String getCapitalCamel() { + return capitalCamel; + } + + /** + * Set capitalCamel + **/ + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + public String getSmallSnake() { + return smallSnake; + } + + /** + * Set smallSnake + **/ + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + public String getCapitalSnake() { + return capitalSnake; + } + + /** + * Set capitalSnake + **/ + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + /** + * Set scAETHFlowPoints + **/ + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + public String getATTNAME() { + return ATT_NAME; + } + + /** + * Set ATT_NAME + **/ + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 00000000000..be9c6954561 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,77 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; + + + + +public class Cat extends Animal { + + private Boolean declawed; + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + /** + * Set declawed + **/ + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/CatAllOf.java new file mode 100644 index 00000000000..2b54aad5ba3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class CatAllOf { + + private Boolean declawed; + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + /** + * Set declawed + **/ + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 00000000000..8da99011104 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Category { + + private Long id; + + private String name = "default-name"; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Category name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 00000000000..de44db959bc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ClassModel.java @@ -0,0 +1,76 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Model for testing model with \"_class\" property + **/ + +public class ClassModel { + + private String propertyClass; + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + **/ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 00000000000..0ad715df8de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Client.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Client { + + private String client; + + /** + * Get client + * @return client + **/ + public String getClient() { + return client; + } + + /** + * Set client + **/ + public void setClient(String client) { + this.client = client; + } + + public Client client(String client) { + this.client = client; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/DeprecatedObject.java new file mode 100644 index 00000000000..aaaed8e7f3e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class DeprecatedObject { + + private String name; + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public DeprecatedObject name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 00000000000..069dab8392d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,77 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; + + + + +public class Dog extends Animal { + + private String breed; + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + /** + * Set breed + **/ + public void setBreed(String breed) { + this.breed = breed; + } + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/DogAllOf.java new file mode 100644 index 00000000000..5dc63ce0380 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class DogAllOf { + + private String breed; + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + /** + * Set breed + **/ + public void setBreed(String breed) { + this.breed = breed; + } + + public DogAllOf breed(String breed) { + this.breed = breed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 00000000000..1a9c48c72cd --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -0,0 +1,145 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; + + + + +public class EnumArrays { + +public enum JustSymbolEnum { + + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$")); + + String value; + + JustSymbolEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private JustSymbolEnum justSymbol; + +public enum ArrayEnumEnum { + + FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); + + String value; + + ArrayEnumEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private List arrayEnum = null; + + /** + * Get justSymbol + * @return justSymbol + **/ + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + /** + * Set justSymbol + **/ + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + public List getArrayEnum() { + return arrayEnum; + } + + /** + * Set arrayEnum + **/ + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + this.arrayEnum.add(arrayEnumItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 00000000000..eed52272f70 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumClass.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String text) { + for (EnumClass b : EnumClass.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 00000000000..e234097abc2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,326 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; + + + + +public class EnumTest { + +public enum EnumStringEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + String value; + + EnumStringEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private EnumStringEnum enumString; + +public enum EnumStringRequiredEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + String value; + + EnumStringRequiredEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private EnumStringRequiredEnum enumStringRequired; + +public enum EnumIntegerEnum { + + NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1)); + + Integer value; + + EnumIntegerEnum (Integer v) { + value = v; + } + + public Integer value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private EnumIntegerEnum enumInteger; + +public enum EnumNumberEnum { + + NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + Double value; + + EnumNumberEnum (Double v) { + value = v; + } + + public Double value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private EnumNumberEnum enumNumber; + + private OuterEnum outerEnum; + + private OuterEnumInteger outerEnumInteger; + + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + /** + * Get enumString + * @return enumString + **/ + public EnumStringEnum getEnumString() { + return enumString; + } + + /** + * Set enumString + **/ + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + /** + * Set enumStringRequired + **/ + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + /** + * Set enumInteger + **/ + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + /** + * Set enumNumber + **/ + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + public OuterEnum getOuterEnum() { + return outerEnum; + } + + /** + * Set outerEnum + **/ + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + /** + * Set outerEnumInteger + **/ + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + /** + * Set outerEnumDefaultValue + **/ + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + /** + * Set outerEnumIntegerDefaultValue + **/ + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 00000000000..dd3716a2b12 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,104 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ModelFile; + + + + +public class FileSchemaTestClass { + + private ModelFile _file; + + private List files = null; + + /** + * Get _file + * @return _file + **/ + public ModelFile getFile() { + return _file; + } + + /** + * Set _file + **/ + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; + return this; + } + + /** + * Get files + * @return files + **/ + public List getFiles() { + return files; + } + + /** + * Set files + **/ + public void setFiles(List files) { + this.files = files; + } + + public FileSchemaTestClass files(List files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + this.files.add(filesItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Foo.java new file mode 100644 index 00000000000..fcafaf7682c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Foo.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Foo { + + private String bar = "bar"; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + /** + * Set bar + **/ + public void setBar(String bar) { + this.bar = bar; + } + + public Foo bar(String bar) { + this.bar = bar; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java new file mode 100644 index 00000000000..27971dae916 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Foo; + + + + +public class FooGetDefaultResponse { + + private Foo string; + + /** + * Get string + * @return string + **/ + public Foo getString() { + return string; + } + + /** + * Set string + **/ + public void setString(Foo string) { + this.string = string; + } + + public FooGetDefaultResponse string(Foo string) { + this.string = string; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 00000000000..6f6b62d497c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/FormatTest.java @@ -0,0 +1,439 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; + + + + +public class FormatTest { + + private Integer integer; + + private Integer int32; + + private Long int64; + + private BigDecimal number; + + private Float _float; + + private Double _double; + + private BigDecimal decimal; + + private String string; + + private byte[] _byte; + + private File binary; + + private LocalDate date; + + private OffsetDateTime dateTime; + + private UUID uuid; + + private String password; + + /** + * A string that is a 10 digit number. Can have leading zeros. + **/ + private String patternWithDigits; + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + **/ + private String patternWithDigitsAndDelimiter; + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + public Integer getInteger() { + return integer; + } + + /** + * Set integer + **/ + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + public Integer getInt32() { + return int32; + } + + /** + * Set int32 + **/ + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + public Long getInt64() { + return int64; + } + + /** + * Set int64 + **/ + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + public BigDecimal getNumber() { + return number; + } + + /** + * Set number + **/ + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + public Float getFloat() { + return _float; + } + + /** + * Set _float + **/ + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + public Double getDouble() { + return _double; + } + + /** + * Set _double + **/ + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get decimal + * @return decimal + **/ + public BigDecimal getDecimal() { + return decimal; + } + + /** + * Set decimal + **/ + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTest decimal(BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get string + * @return string + **/ + public String getString() { + return string; + } + + /** + * Set string + **/ + public void setString(String string) { + this.string = string; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + public byte[] getByte() { + return _byte; + } + + /** + * Set _byte + **/ + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get binary + * @return binary + **/ + public File getBinary() { + return binary; + } + + /** + * Set binary + **/ + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest binary(File binary) { + this.binary = binary; + return this; + } + + /** + * Get date + * @return date + **/ + public LocalDate getDate() { + return date; + } + + /** + * Set date + **/ + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Set dateTime + **/ + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + /** + * Set password + **/ + public void setPassword(String password) { + this.password = password; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + **/ + public String getPatternWithDigits() { + return patternWithDigits; + } + + /** + * Set patternWithDigits + **/ + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + public FormatTest patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + /** + * Set patternWithDigitsAndDelimiter + **/ + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..72566c02dde --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class HasOnlyReadOnly { + + private String bar; + + private String foo; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get foo + * @return foo + **/ + public String getFoo() { + return foo; + } + + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 00000000000..48cec9f2dab --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -0,0 +1,80 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; + + + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + **/ + +public class HealthCheckResult { + + private String nullableMessage; + + /** + * Get nullableMessage + * @return nullableMessage + **/ + public String getNullableMessage() { + return nullableMessage; + } + + /** + * Set nullableMessage + **/ + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 00000000000..ec54a8ae421 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/MapTest.java @@ -0,0 +1,185 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + + + + +public class MapTest { + + private Map> mapMapOfString = null; + +public enum InnerEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); + + String value; + + InnerEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private Map mapOfEnumString = null; + + private Map directMap = null; + + private Map indirectMap = null; + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + public Map> getMapMapOfString() { + return mapMapOfString; + } + + /** + * Set mapMapOfString + **/ + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + /** + * Set mapOfEnumString + **/ + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + public Map getDirectMap() { + return directMap; + } + + /** + * Set directMap + **/ + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + public Map getIndirectMap() { + return indirectMap; + } + + /** + * Set indirectMap + **/ + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + this.indirectMap.put(key, indirectMapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..de307d1e286 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,129 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; + + + + +public class MixedPropertiesAndAdditionalPropertiesClass { + + private UUID uuid; + + private OffsetDateTime dateTime; + + private Map map = null; + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Set dateTime + **/ + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get map + * @return map + **/ + public Map getMap() { + return map; + } + + /** + * Set map + **/ + public void setMap(Map map) { + this.map = map; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + this.map.put(key, mapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 00000000000..393f65f83e9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Model200Response.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Model for testing model name starting with number + **/ + +public class Model200Response { + + private Integer name; + + private String propertyClass; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + /** + * Set name + **/ + public void setName(Integer name) { + this.name = name; + } + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + **/ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 00000000000..881fc2677d2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -0,0 +1,119 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class ModelApiResponse { + + private Integer code; + + private String type; + + private String message; + + /** + * Get code + * @return code + **/ + public Integer getCode() { + return code; + } + + /** + * Set code + **/ + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * @return type + **/ + public String getType() { + return type; + } + + /** + * Set type + **/ + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * @return message + **/ + public String getMessage() { + return message; + } + + /** + * Set message + **/ + public void setMessage(String message) { + this.message = message; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 00000000000..3c1cf785ea5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,79 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Must be named `File` for test. + **/ + +public class ModelFile { + + /** + * Test capitalization + **/ + private String sourceURI; + + /** + * Test capitalization + * @return sourceURI + **/ + public String getSourceURI() { + return sourceURI; + } + + /** + * Set sourceURI + **/ + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 00000000000..0c2e7ffb39d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class ModelList { + + private String _123list; + + /** + * Get _123list + * @return _123list + **/ + public String get123list() { + return _123list; + } + + /** + * Set _123list + **/ + public void set123list(String _123list) { + this._123list = _123list; + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 00000000000..7d948f62e2c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -0,0 +1,76 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Model for testing reserved words + **/ + +public class ModelReturn { + + private Integer _return; + + /** + * Get _return + * @return _return + **/ + public Integer getReturn() { + return _return; + } + + /** + * Set _return + **/ + public void setReturn(Integer _return) { + this._return = _return; + } + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 00000000000..ba07eb91523 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Name.java @@ -0,0 +1,123 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Model for testing model name same as property name + **/ + +public class Name { + + private Integer name; + + private Integer snakeCase; + + private String property; + + private Integer _123number; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + /** + * Set name + **/ + public void setName(Integer name) { + this.name = name; + } + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + public Integer getSnakeCase() { + return snakeCase; + } + + + /** + * Get property + * @return property + **/ + public String getProperty() { + return property; + } + + /** + * Set property + **/ + public void setProperty(String property) { + this.property = property; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get _123number + * @return _123number + **/ + public Integer get123number() { + return _123number; + } + + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 00000000000..759832f0dd7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/NullableClass.java @@ -0,0 +1,367 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; + + + + +public class NullableClass extends HashMap { + + private Integer integerProp; + + private BigDecimal numberProp; + + private Boolean booleanProp; + + private String stringProp; + + private LocalDate dateProp; + + private OffsetDateTime datetimeProp; + + private List arrayNullableProp = null; + + private List arrayAndItemsNullableProp = null; + + private List arrayItemsNullable = null; + + private Map objectNullableProp = null; + + private Map objectAndItemsNullableProp = null; + + private Map objectItemsNullable = null; + + /** + * Get integerProp + * @return integerProp + **/ + public Integer getIntegerProp() { + return integerProp; + } + + /** + * Set integerProp + **/ + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + public NullableClass integerProp(Integer integerProp) { + this.integerProp = integerProp; + return this; + } + + /** + * Get numberProp + * @return numberProp + **/ + public BigDecimal getNumberProp() { + return numberProp; + } + + /** + * Set numberProp + **/ + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + return this; + } + + /** + * Get booleanProp + * @return booleanProp + **/ + public Boolean getBooleanProp() { + return booleanProp; + } + + /** + * Set booleanProp + **/ + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + return this; + } + + /** + * Get stringProp + * @return stringProp + **/ + public String getStringProp() { + return stringProp; + } + + /** + * Set stringProp + **/ + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + public NullableClass stringProp(String stringProp) { + this.stringProp = stringProp; + return this; + } + + /** + * Get dateProp + * @return dateProp + **/ + public LocalDate getDateProp() { + return dateProp; + } + + /** + * Set dateProp + **/ + public void setDateProp(LocalDate dateProp) { + this.dateProp = dateProp; + } + + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = dateProp; + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + **/ + public OffsetDateTime getDatetimeProp() { + return datetimeProp; + } + + /** + * Set datetimeProp + **/ + public void setDatetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public NullableClass datetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + **/ + public List getArrayNullableProp() { + return arrayNullableProp; + } + + /** + * Set arrayNullableProp + **/ + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + **/ + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + /** + * Set arrayAndItemsNullableProp + **/ + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + **/ + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + /** + * Set arrayItemsNullable + **/ + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + **/ + public Map getObjectNullableProp() { + return objectNullableProp; + } + + /** + * Set objectNullableProp + **/ + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + **/ + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + /** + * Set objectAndItemsNullableProp + **/ + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + **/ + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + /** + * Set objectItemsNullable + **/ + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 00000000000..5d493bccf26 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; + + + + +public class NumberOnly { + + private BigDecimal justNumber; + + /** + * Get justNumber + * @return justNumber + **/ + public BigDecimal getJustNumber() { + return justNumber; + } + + /** + * Set justNumber + **/ + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java new file mode 100644 index 00000000000..00c4300075b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,157 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; + + + + +public class ObjectWithDeprecatedFields { + + private String uuid; + + private BigDecimal id; + + private DeprecatedObject deprecatedRef; + + private List bars = null; + + /** + * Get uuid + * @return uuid + **/ + public String getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public ObjectWithDeprecatedFields uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get id + * @return id + * @deprecated + **/ + @Deprecated + public BigDecimal getId() { + return id; + } + + /** + * Set id + **/ + public void setId(BigDecimal id) { + this.id = id; + } + + public ObjectWithDeprecatedFields id(BigDecimal id) { + this.id = id; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + **/ + @Deprecated + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + /** + * Set deprecatedRef + **/ + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + **/ + @Deprecated + public List getBars() { + return bars; + } + + /** + * Set bars + **/ + public void setBars(List bars) { + this.bars = bars; + } + + public ObjectWithDeprecatedFields bars(List bars) { + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + this.bars.add(barsItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 00000000000..84ce8e3fa1f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Order.java @@ -0,0 +1,213 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; + + + + +public class Order { + + private Long id; + + private Long petId; + + private Integer quantity; + + private OffsetDateTime shipDate; + +public enum StatusEnum { + + PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); + + String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + /** + * Order Status + **/ + private StatusEnum status; + + private Boolean complete = false; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * @return petId + **/ + public Long getPetId() { + return petId; + } + + /** + * Set petId + **/ + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + public Integer getQuantity() { + return quantity; + } + + /** + * Set quantity + **/ + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + public OffsetDateTime getShipDate() { + return shipDate; + } + + /** + * Set shipDate + **/ + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + **/ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * @return complete + **/ + public Boolean getComplete() { + return complete; + } + + /** + * Set complete + **/ + public void setComplete(Boolean complete) { + this.complete = complete; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 00000000000..6ba3d1712d4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -0,0 +1,120 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; + + + + +public class OuterComposite { + + private BigDecimal myNumber; + + private String myString; + + private Boolean myBoolean; + + /** + * Get myNumber + * @return myNumber + **/ + public BigDecimal getMyNumber() { + return myNumber; + } + + /** + * Set myNumber + **/ + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myString + * @return myString + **/ + public String getMyString() { + return myString; + } + + /** + * Set myString + **/ + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + public Boolean getMyBoolean() { + return myBoolean; + } + + /** + * Set myBoolean + **/ + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 00000000000..9fe96db3f6e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 00000000000..f5b732f784f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String text) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 00000000000..0ca88b32ee6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(String text) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 00000000000..06f9fe6c371 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(String text) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java new file mode 100644 index 00000000000..b25e8e37ae7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnumInteger; + + + + +public class OuterObjectWithEnumProperty { + + private OuterEnumInteger value; + + /** + * Get value + * @return value + **/ + public OuterEnumInteger getValue() { + return value; + } + + /** + * Set value + **/ + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + this.value = value; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 00000000000..b86299acd2e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,230 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; + + + + +public class Pet { + + private Long id; + + private Category category; + + private String name; + + private Set photoUrls = new LinkedHashSet<>(); + + private List tags = null; + +public enum StatusEnum { + + AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); + + String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + /** + * pet status in the store + **/ + private StatusEnum status; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * @return category + **/ + public Category getCategory() { + return category; + } + + /** + * Set category + **/ + public void setCategory(Category category) { + this.category = category; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + public Set getPhotoUrls() { + return photoUrls; + } + + /** + * Set photoUrls + **/ + @JsonDeserialize(as = LinkedHashSet.class) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + public List getTags() { + return tags; + } + + /** + * Set tags + **/ + public void setTags(List tags) { + this.tags = tags; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + **/ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..15344cbf0dc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -0,0 +1,85 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class ReadOnlyFirst { + + private String bar; + + private String baz; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get baz + * @return baz + **/ + public String getBaz() { + return baz; + } + + /** + * Set baz + **/ + public void setBaz(String baz) { + this.baz = baz; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SingleRefType.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SingleRefType.java new file mode 100644 index 00000000000..d46fc6c116f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SingleRefType.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String text) { + for (SingleRefType b : SingleRefType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 00000000000..af5166268f7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class SpecialModelName { + + private Long $specialPropertyName; + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + /** + * Set $specialPropertyName + **/ + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 00000000000..1dee37e3936 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Tag { + + private Long id; + + private String name; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 00000000000..c088a4d15d5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/main/java/org/openapitools/client/model/User.java @@ -0,0 +1,237 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class User { + + private Long id; + + private String username; + + private String firstName; + + private String lastName; + + private String email; + + private String password; + + private String phone; + + /** + * User Status + **/ + private Integer userStatus; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + **/ + public void setUsername(String username) { + this.username = username; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + public String getFirstName() { + return firstName; + } + + /** + * Set firstName + **/ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + public String getLastName() { + return lastName; + } + + /** + * Set lastName + **/ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * @return email + **/ + public String getEmail() { + return email; + } + + /** + * Set email + **/ + public void setEmail(String email) { + this.email = email; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + /** + * Set password + **/ + public void setPassword(String password) { + this.password = password; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * @return phone + **/ + public String getPhone() { + return phone; + } + + /** + * Set phone + **/ + public void setPhone(String phone) { + this.phone = phone; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * @return userStatus + **/ + public Integer getUserStatus() { + return userStatus; + } + + /** + * Set userStatus + **/ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..ce1d8264fb5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,64 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private static AnotherFakeApi client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(AnotherFakeApi.class); + } + + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void call123testSpecialTagsTest() throws Exception { + //Client response = client.call123testSpecialTags(client); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..26e73e54574 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,60 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.FooGetDefaultResponse; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for DefaultApi + */ +public class DefaultApiTest { + + private static DefaultApi client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(DefaultApi.class); + } + + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fooGetTest() throws Exception { + //FooGetDefaultResponse response = client.fooGet(); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 00000000000..a953ad7bd89 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,259 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.User; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for FakeApi + */ +public class FakeApiTest { + + private static FakeApi client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(FakeApi.class); + } + + + /** + * Health check endpoint + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHealthGetTest() throws Exception { + //HealthCheckResult response = client.fakeHealthGet(); + //assertNotNull(response); + } + + /** + * test http signature authentication + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeHttpSignatureTestTest() throws Exception { + //void response = client.fakeHttpSignatureTest(pet, query1, header1); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() throws Exception { + //Boolean response = client.fakeOuterBooleanSerialize(body); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() throws Exception { + //OuterComposite response = client.fakeOuterCompositeSerialize(outerComposite); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() throws Exception { + //BigDecimal response = client.fakeOuterNumberSerialize(body); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() throws Exception { + //String response = client.fakeOuterStringSerialize(body); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakePropertyEnumIntegerSerializeTest() throws Exception { + //OuterObjectWithEnumProperty response = client.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithBinaryTest() throws Exception { + //void response = client.testBodyWithBinary(body); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() throws Exception { + //void response = client.testBodyWithFileSchema(fileSchemaTestClass); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws Exception { + //void response = client.testBodyWithQueryParams(query, user); + //assertNotNull(response); + } + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() throws Exception { + //Client response = client.testClientModel(client); + //assertNotNull(response); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEndpointParametersTest() throws Exception { + //void response = client.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + //assertNotNull(response); + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() throws Exception { + //void response = client.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + //assertNotNull(response); + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testGroupParametersTest() throws Exception { + //void response = client.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + //assertNotNull(response); + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() throws Exception { + //void response = client.testInlineAdditionalProperties(requestBody); + //assertNotNull(response); + } + + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() throws Exception { + //void response = client.testJsonFormData(param, param2); + //assertNotNull(response); + } + + /** + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() throws Exception { + //void response = client.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 00000000000..bc5ecc08403 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,64 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for FakeClassnameTags123Api + */ +public class FakeClassnameTags123ApiTest { + + private static FakeClassnameTags123Api client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(FakeClassnameTags123Api.class); + } + + + /** + * To test class name in snake case + * + * To test class name in snake case + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClassnameTest() throws Exception { + //Client response = client.testClassname(client); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 00000000000..66959d421f7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,179 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import java.util.Set; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for PetApi + */ +public class PetApiTest { + + private static PetApi client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(PetApi.class); + } + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void addPetTest() throws Exception { + //void response = client.addPet(pet); + //assertNotNull(response); + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deletePetTest() throws Exception { + //void response = client.deletePet(petId, apiKey); + //assertNotNull(response); + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByStatusTest() throws Exception { + //List response = client.findPetsByStatus(status); + //assertNotNull(response); + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByTagsTest() throws Exception { + //Set response = client.findPetsByTags(tags); + //assertNotNull(response); + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPetByIdTest() throws Exception { + //Pet response = client.getPetById(petId); + //assertNotNull(response); + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetTest() throws Exception { + //void response = client.updatePet(pet); + //assertNotNull(response); + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetWithFormTest() throws Exception { + //void response = client.updatePetWithForm(petId, name, status); + //assertNotNull(response); + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileTest() throws Exception { + //ModelApiResponse response = client.uploadFile(petId, additionalMetadata, _file); + //assertNotNull(response); + } + + /** + * uploads an image (required) + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileWithRequiredFileTest() throws Exception { + //ModelApiResponse response = client.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 00000000000..4331d26aa94 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,106 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Order; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for StoreApi + */ +public class StoreApiTest { + + private static StoreApi client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(StoreApi.class); + } + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteOrderTest() throws Exception { + //void response = client.deleteOrder(orderId); + //assertNotNull(response); + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getInventoryTest() throws Exception { + //Map response = client.getInventory(); + //assertNotNull(response); + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getOrderByIdTest() throws Exception { + //Order response = client.getOrderById(orderId); + //assertNotNull(response); + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void placeOrderTest() throws Exception { + //Order response = client.placeOrder(order); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 00000000000..dfbfc41d41b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,163 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import org.eclipse.microprofile.rest.client.RestClientBuilder; + +import java.net.URL; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * OpenAPI Petstore Test + * + * API tests for UserApi + */ +public class UserApiTest { + + private static UserApi client; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() throws MalformedURLException { + client = RestClientBuilder.newBuilder() + .baseUrl(new URL(baseUrl)) + .register(ApiException.class) + .build(UserApi.class); + } + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUserTest() throws Exception { + //void response = client.createUser(user); + //assertNotNull(response); + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() throws Exception { + //void response = client.createUsersWithArrayInput(user); + //assertNotNull(response); + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithListInputTest() throws Exception { + //void response = client.createUsersWithListInput(user); + //assertNotNull(response); + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteUserTest() throws Exception { + //void response = client.deleteUser(username); + //assertNotNull(response); + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getUserByNameTest() throws Exception { + //User response = client.getUserByName(username); + //assertNotNull(response); + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() throws Exception { + //String response = client.loginUser(username, password); + //assertNotNull(response); + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() throws Exception { + //void response = client.logoutUser(); + //assertNotNull(response); + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() throws Exception { + //void response = client.updateUser(username, user); + //assertNotNull(response); + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..008d620d506 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AdditionalPropertiesClass + */ +public class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + public void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + public void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + public void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java new file mode 100644 index 00000000000..ad55c6f2c7d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -0,0 +1,56 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.SingleRefType; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AllOfWithSingleRef + */ +public class AllOfWithSingleRefTest { + private final AllOfWithSingleRef model = new AllOfWithSingleRef(); + + /** + * Model tests for AllOfWithSingleRef + */ + @Test + public void testAllOfWithSingleRef() { + // TODO: test AllOfWithSingleRef + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'singleRefType' + */ + @Test + public void singleRefTypeTest() { + // TODO: test singleRefType + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 00000000000..c38a031c2ee --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,60 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import org.openapitools.client.model.Dog; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Animal + */ +public class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + public void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..5a886da823a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +public class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + public void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + public void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..6b0d615c0ee --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayOfNumberOnly + */ +public class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + public void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + public void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 00000000000..be3f20c9a37 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,66 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayTest + */ +public class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + public void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + public void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + public void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + public void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 00000000000..18e9b9dbf0c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,87 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Capitalization + */ +public class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + public void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + public void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + public void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + public void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + public void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + public void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + public void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CatAllOfTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CatAllOfTest.java new file mode 100644 index 00000000000..3772925dd61 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CatAllOfTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CatAllOf + */ +public class CatAllOfTest { + private final CatAllOf model = new CatAllOf(); + + /** + * Model tests for CatAllOf + */ + @Test + public void testCatAllOf() { + // TODO: test CatAllOf + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 00000000000..d78fcb63591 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Cat + */ +public class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + public void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 00000000000..12d4b6a6441 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Category + */ +public class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + public void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 00000000000..035b80969f6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ClassModel + */ +public class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + public void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 00000000000..9b4899ae227 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Client + */ +public class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + public void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + public void clientTest() { + // TODO: test client + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java new file mode 100644 index 00000000000..54347091cc7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeprecatedObject + */ +public class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + public void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DogAllOfTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DogAllOfTest.java new file mode 100644 index 00000000000..16066cd03f1 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DogAllOfTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DogAllOf + */ +public class DogAllOfTest { + private final DogAllOf model = new DogAllOf(); + + /** + * Model tests for DogAllOf + */ + @Test + public void testDogAllOf() { + // TODO: test DogAllOf + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 00000000000..6819c78158a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Dog + */ +public class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + public void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 00000000000..4d249658722 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EnumArrays + */ +public class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + public void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + public void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + public void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 00000000000..11bf230be71 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EnumClass + */ +public class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + public void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 00000000000..ec0d37ce367 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,111 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EnumTest + */ +public class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + public void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + public void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + public void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + public void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + public void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + public void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + public void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + public void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + public void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 00000000000..846646eb944 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ModelFile; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FileSchemaTestClass + */ +public class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + public void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property '_file' + */ + @Test + public void _fileTest() { + // TODO: test _file + } + + /** + * Test the property 'files' + */ + @Test + public void filesTest() { + // TODO: test files + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java new file mode 100644 index 00000000000..14639567d81 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Foo; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FooGetDefaultResponse + */ +public class FooGetDefaultResponseTest { + private final FooGetDefaultResponse model = new FooGetDefaultResponse(); + + /** + * Model tests for FooGetDefaultResponse + */ + @Test + public void testFooGetDefaultResponse() { + // TODO: test FooGetDefaultResponse + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 00000000000..6ad35f67e28 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Foo + */ +public class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + public void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 00000000000..773e76967ef --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,172 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FormatTest + */ +public class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + public void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + public void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + public void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + public void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + public void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + public void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + public void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + public void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 00000000000..b956d12d747 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasOnlyReadOnly + */ +public class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + public void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + public void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 00000000000..3267defa3a6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -0,0 +1,51 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HealthCheckResult + */ +public class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + public void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + public void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 00000000000..ac308e40089 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for MapTest + */ +public class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + public void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + public void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + public void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + public void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + public void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..72a7a2a961c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,68 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +public class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + public void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + public void mapTest() { + // TODO: test map + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 00000000000..79bd883d4c4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Model200Response + */ +public class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + public void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 00000000000..79b915c9675 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,63 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelApiResponse + */ +public class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + public void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 00000000000..c10fa3927e3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 00000000000..7c09d2e78e8 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 00000000000..8c99cb5220f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelReturn + */ +public class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + public void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + public void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 00000000000..8795299bfae --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,71 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Name + */ +public class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + public void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + public void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + public void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + public void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 00000000000..95997f952e7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -0,0 +1,146 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NullableClass + */ +public class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + public void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + public void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + public void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + public void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + public void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + public void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + public void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + public void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + public void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + public void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + public void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + public void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + public void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 00000000000..f1af4caf2ec --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NumberOnly + */ +public class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + public void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + public void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 00000000000..14f312e38a6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,75 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ObjectWithDeprecatedFields + */ +public class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + public void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + public void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + public void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 00000000000..e99bf8d598d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,88 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Order + */ +public class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + public void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + public void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + public void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + public void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + public void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 00000000000..28b832d5db9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,64 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterComposite + */ +public class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + public void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + public void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + public void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + public void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 00000000000..75313d6581d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnumDefaultValue + */ +public class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + public void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 00000000000..df4527f0d49 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +public class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + public void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 00000000000..87c29d2fd72 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnumInteger + */ +public class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + public void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 00000000000..226fc34f402 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnum + */ +public class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + public void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 00000000000..24984008abf --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnumInteger; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterObjectWithEnumProperty + */ +public class OuterObjectWithEnumPropertyTest { + private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); + + /** + * Model tests for OuterObjectWithEnumProperty + */ + @Test + public void testOuterObjectWithEnumProperty() { + // TODO: test OuterObjectWithEnumProperty + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 00000000000..6de3524dcc4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,94 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Pet + */ +public class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + public void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 00000000000..332a1b116c7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ReadOnlyFirst + */ +public class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + public void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + public void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java new file mode 100644 index 00000000000..82f51f683de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SingleRefType + */ +public class SingleRefTypeTest { + /** + * Model tests for SingleRefType + */ + @Test + public void testSingleRefType() { + // TODO: test SingleRefType + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 00000000000..e1d4d10b94f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialModelName + */ +public class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + public void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + public void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 00000000000..ff32e6c114f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Tag + */ +public class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + public void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 00000000000..32404a5e38e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/mp/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,103 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + public void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + public void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + public void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + public void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/.openapi-generator-ignore b/samples/client/petstore/java-helidon-client/se/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES new file mode 100644 index 00000000000..6f20904b624 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES @@ -0,0 +1,181 @@ +.openapi-generator-ignore +README.md +docs/AdditionalPropertiesClass.md +docs/AllOfWithSingleRef.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/CatAllOf.md +docs/Category.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/DogAllOf.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelFile.md +docs/ModelList.md +docs/ModelReturn.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterObjectWithEnumProperty.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SingleRefType.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +pom.xml +src/main/java/org/openapitools/client/ApiClient.java +src/main/java/org/openapitools/client/ApiResponse.java +src/main/java/org/openapitools/client/ApiResponseBase.java +src/main/java/org/openapitools/client/Pair.java +src/main/java/org/openapitools/client/RFC3339DateFormat.java +src/main/java/org/openapitools/client/api/AnotherFakeApi.java +src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java +src/main/java/org/openapitools/client/api/DefaultApi.java +src/main/java/org/openapitools/client/api/DefaultApiImpl.java +src/main/java/org/openapitools/client/api/FakeApi.java +src/main/java/org/openapitools/client/api/FakeApiImpl.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java +src/main/java/org/openapitools/client/api/PetApi.java +src/main/java/org/openapitools/client/api/PetApiImpl.java +src/main/java/org/openapitools/client/api/ResponseType.java +src/main/java/org/openapitools/client/api/StoreApi.java +src/main/java/org/openapitools/client/api/StoreApiImpl.java +src/main/java/org/openapitools/client/api/UserApi.java +src/main/java/org/openapitools/client/api/UserApiImpl.java +src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +src/main/java/org/openapitools/client/model/Animal.java +src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/client/model/ArrayTest.java +src/main/java/org/openapitools/client/model/Capitalization.java +src/main/java/org/openapitools/client/model/Cat.java +src/main/java/org/openapitools/client/model/CatAllOf.java +src/main/java/org/openapitools/client/model/Category.java +src/main/java/org/openapitools/client/model/ClassModel.java +src/main/java/org/openapitools/client/model/Client.java +src/main/java/org/openapitools/client/model/DeprecatedObject.java +src/main/java/org/openapitools/client/model/Dog.java +src/main/java/org/openapitools/client/model/DogAllOf.java +src/main/java/org/openapitools/client/model/EnumArrays.java +src/main/java/org/openapitools/client/model/EnumClass.java +src/main/java/org/openapitools/client/model/EnumTest.java +src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +src/main/java/org/openapitools/client/model/Foo.java +src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/client/model/FormatTest.java +src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/client/model/HealthCheckResult.java +src/main/java/org/openapitools/client/model/MapTest.java +src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/client/model/Model200Response.java +src/main/java/org/openapitools/client/model/ModelApiResponse.java +src/main/java/org/openapitools/client/model/ModelFile.java +src/main/java/org/openapitools/client/model/ModelList.java +src/main/java/org/openapitools/client/model/ModelReturn.java +src/main/java/org/openapitools/client/model/Name.java +src/main/java/org/openapitools/client/model/NullableClass.java +src/main/java/org/openapitools/client/model/NumberOnly.java +src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +src/main/java/org/openapitools/client/model/Order.java +src/main/java/org/openapitools/client/model/OuterComposite.java +src/main/java/org/openapitools/client/model/OuterEnum.java +src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/client/model/OuterEnumInteger.java +src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +src/main/java/org/openapitools/client/model/SingleRefType.java +src/main/java/org/openapitools/client/model/SpecialModelName.java +src/main/java/org/openapitools/client/model/Tag.java +src/main/java/org/openapitools/client/model/User.java +src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +src/test/java/org/openapitools/client/api/DefaultApiTest.java +src/test/java/org/openapitools/client/api/FakeApiTest.java +src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +src/test/java/org/openapitools/client/api/PetApiTest.java +src/test/java/org/openapitools/client/api/StoreApiTest.java +src/test/java/org/openapitools/client/api/UserApiTest.java +src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +src/test/java/org/openapitools/client/model/AnimalTest.java +src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/client/model/ArrayTestTest.java +src/test/java/org/openapitools/client/model/CapitalizationTest.java +src/test/java/org/openapitools/client/model/CatAllOfTest.java +src/test/java/org/openapitools/client/model/CatTest.java +src/test/java/org/openapitools/client/model/CategoryTest.java +src/test/java/org/openapitools/client/model/ClassModelTest.java +src/test/java/org/openapitools/client/model/ClientTest.java +src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +src/test/java/org/openapitools/client/model/DogAllOfTest.java +src/test/java/org/openapitools/client/model/DogTest.java +src/test/java/org/openapitools/client/model/EnumArraysTest.java +src/test/java/org/openapitools/client/model/EnumClassTest.java +src/test/java/org/openapitools/client/model/EnumTestTest.java +src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +src/test/java/org/openapitools/client/model/FooTest.java +src/test/java/org/openapitools/client/model/FormatTestTest.java +src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +src/test/java/org/openapitools/client/model/MapTestTest.java +src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +src/test/java/org/openapitools/client/model/Model200ResponseTest.java +src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +src/test/java/org/openapitools/client/model/ModelFileTest.java +src/test/java/org/openapitools/client/model/ModelListTest.java +src/test/java/org/openapitools/client/model/ModelReturnTest.java +src/test/java/org/openapitools/client/model/NameTest.java +src/test/java/org/openapitools/client/model/NullableClassTest.java +src/test/java/org/openapitools/client/model/NumberOnlyTest.java +src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +src/test/java/org/openapitools/client/model/OrderTest.java +src/test/java/org/openapitools/client/model/OuterCompositeTest.java +src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +src/test/java/org/openapitools/client/model/OuterEnumTest.java +src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +src/test/java/org/openapitools/client/model/PetTest.java +src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +src/test/java/org/openapitools/client/model/TagTest.java +src/test/java/org/openapitools/client/model/UserTest.java diff --git a/samples/client/petstore/java-helidon-client/se/.openapi-generator/VERSION b/samples/client/petstore/java-helidon-client/se/.openapi-generator/VERSION new file mode 100644 index 00000000000..7b7e20b5703 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java-helidon-client/se/README.md b/samples/client/petstore/java-helidon-client/se/README.md new file mode 100644 index 00000000000..83180298fc2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/README.md @@ -0,0 +1,24 @@ +# OpenAPI Petstore + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +## Overview +This project was generated using the Helidon OpenAPI Generator. + +The generated classes use the programming model from the Helidon WebClient implementation, primarily the `WebClient` interface and its +`WebClient.Builder` class. Refer to the Helidon WebClient documentation for complete information about them. + +## Using the Generated Classes and Interfaces +The generated `ApiClient` class wraps a `WebClient` instance. Similarly, the `ApiClient.Builder` class wraps the `WebClient.Builder` class. + +The generated `xxxApi` interfaces and `xxxApiImpl` classes make it very simple for your code to send requests (with input parameters) to the remote service which the OpenAPI document describes and to process the response (with output values) from the remote service. + +To use the generated API, your code performs the following steps. + +1. Create an instance of the `ApiClient` using its `Builder`. +2. Create an instance of a `xxxApi` it wants to access, typically by invoking `xxxApiImpl.create(ApiClient)` and passing the `ApiClient` instance just created. +3. Invoke any of the `public` methods on the `xxxApi` instance, passing the input parameters and saving the returned `Single` object. +4. Invoke methods on the returned `Single` to process the response and any output from it. + +Browse the methods and JavaDoc on the generated classes for more information. diff --git a/samples/client/petstore/java-helidon-client/se/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java-helidon-client/se/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..fe69a56eebf --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/AdditionalPropertiesClass.md @@ -0,0 +1,14 @@ + + +# AdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapProperty** | **Map<String, String>** | | [optional] | +|**mapOfMapProperty** | **Map<String, Map<String, String>>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/AllOfWithSingleRef.md b/samples/client/petstore/java-helidon-client/se/docs/AllOfWithSingleRef.md new file mode 100644 index 00000000000..0a9e61bc682 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/AllOfWithSingleRef.md @@ -0,0 +1,14 @@ + + +# AllOfWithSingleRef + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**username** | **String** | | [optional] | +|**singleRefType** | [**SingleRefType**](SingleRefType.md) | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/Animal.md b/samples/client/petstore/java-helidon-client/se/docs/Animal.md new file mode 100644 index 00000000000..d9b32f14c88 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/Animal.md @@ -0,0 +1,14 @@ + + +# Animal + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**className** | **String** | | | +|**color** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/AnotherFakeApi.md b/samples/client/petstore/java-helidon-client/se/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..73c966d2d54 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/AnotherFakeApi.md @@ -0,0 +1,75 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags | + + + +## call123testSpecialTags + +> Client call123testSpecialTags(client) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java-helidon-client/se/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java-helidon-client/se/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..0188db3eb13 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayArrayNumber** | **List<List<BigDecimal>>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java-helidon-client/se/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..a5753530aad --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/ArrayOfNumberOnly.md @@ -0,0 +1,13 @@ + + +# ArrayOfNumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayNumber** | **List<BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/ArrayTest.md b/samples/client/petstore/java-helidon-client/se/docs/ArrayTest.md new file mode 100644 index 00000000000..36077c9df30 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/ArrayTest.md @@ -0,0 +1,15 @@ + + +# ArrayTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**arrayOfString** | **List<String>** | | [optional] | +|**arrayArrayOfInteger** | **List<List<Long>>** | | [optional] | +|**arrayArrayOfModel** | **List<List<ReadOnlyFirst>>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/Capitalization.md b/samples/client/petstore/java-helidon-client/se/docs/Capitalization.md new file mode 100644 index 00000000000..82a812711de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/Capitalization.md @@ -0,0 +1,18 @@ + + +# Capitalization + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**smallCamel** | **String** | | [optional] | +|**capitalCamel** | **String** | | [optional] | +|**smallSnake** | **String** | | [optional] | +|**capitalSnake** | **String** | | [optional] | +|**scAETHFlowPoints** | **String** | | [optional] | +|**ATT_NAME** | **String** | Name of the pet | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/Cat.md b/samples/client/petstore/java-helidon-client/se/docs/Cat.md new file mode 100644 index 00000000000..390dd519c8c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/Cat.md @@ -0,0 +1,13 @@ + + +# Cat + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**declawed** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/CatAllOf.md b/samples/client/petstore/java-helidon-client/se/docs/CatAllOf.md new file mode 100644 index 00000000000..926bc0abd78 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/CatAllOf.md @@ -0,0 +1,13 @@ + + +# CatAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**declawed** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/Category.md b/samples/client/petstore/java-helidon-client/se/docs/Category.md new file mode 100644 index 00000000000..ab6d1ec334d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/Category.md @@ -0,0 +1,14 @@ + + +# Category + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/ClassModel.md b/samples/client/petstore/java-helidon-client/se/docs/ClassModel.md new file mode 100644 index 00000000000..af46dea1f6c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/ClassModel.md @@ -0,0 +1,14 @@ + + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/Client.md b/samples/client/petstore/java-helidon-client/se/docs/Client.md new file mode 100644 index 00000000000..ef07b4ab8b9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/Client.md @@ -0,0 +1,13 @@ + + +# Client + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**client** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/DefaultApi.md b/samples/client/petstore/java-helidon-client/se/docs/DefaultApi.md new file mode 100644 index 00000000000..2c56e1f90e5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/DefaultApi.md @@ -0,0 +1,69 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | | + + + +## fooGet + +> FooGetDefaultResponse fooGet() + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + FooGetDefaultResponse result = apiInstance.fooGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fooGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + diff --git a/samples/client/petstore/java-helidon-client/se/docs/DeprecatedObject.md b/samples/client/petstore/java-helidon-client/se/docs/DeprecatedObject.md new file mode 100644 index 00000000000..48de1d62442 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/DeprecatedObject.md @@ -0,0 +1,13 @@ + + +# DeprecatedObject + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/Dog.md b/samples/client/petstore/java-helidon-client/se/docs/Dog.md new file mode 100644 index 00000000000..972c981c0d0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/Dog.md @@ -0,0 +1,13 @@ + + +# Dog + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**breed** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/DogAllOf.md b/samples/client/petstore/java-helidon-client/se/docs/DogAllOf.md new file mode 100644 index 00000000000..d4e4ea0d548 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/DogAllOf.md @@ -0,0 +1,13 @@ + + +# DogAllOf + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**breed** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/EnumArrays.md b/samples/client/petstore/java-helidon-client/se/docs/EnumArrays.md new file mode 100644 index 00000000000..b2222d5beb2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/EnumArrays.md @@ -0,0 +1,32 @@ + + +# EnumArrays + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] | +|**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] | + + + +## Enum: JustSymbolEnum + +| Name | Value | +|---- | -----| +| GREATER_THAN_OR_EQUAL_TO | ">=" | +| DOLLAR | "$" | + + + +## Enum: List<ArrayEnumEnum> + +| Name | Value | +|---- | -----| +| FISH | "fish" | +| CRAB | "crab" | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/EnumClass.md b/samples/client/petstore/java-helidon-client/se/docs/EnumClass.md new file mode 100644 index 00000000000..b314590a759 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/EnumTest.md b/samples/client/petstore/java-helidon-client/se/docs/EnumTest.md new file mode 100644 index 00000000000..380a2aef0bc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/EnumTest.md @@ -0,0 +1,58 @@ + + +# EnumTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] | +|**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | | +|**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] | +|**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] | +|**outerEnum** | **OuterEnum** | | [optional] | +|**outerEnumInteger** | **OuterEnumInteger** | | [optional] | +|**outerEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional] | +|**outerEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional] | + + + +## Enum: EnumStringEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumStringRequiredEnum + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | +| EMPTY | "" | + + + +## Enum: EnumIntegerEnum + +| Name | Value | +|---- | -----| +| NUMBER_1 | 1 | +| NUMBER_MINUS_1 | -1 | + + + +## Enum: EnumNumberEnum + +| Name | Value | +|---- | -----| +| NUMBER_1_DOT_1 | 1.1 | +| NUMBER_MINUS_1_DOT_2 | -1.2 | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md b/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md new file mode 100644 index 00000000000..1b6b9507990 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/FakeApi.md @@ -0,0 +1,1214 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint | +| [**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication | +| [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | | +| [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | | +| [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | | +| [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | | +| [**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | | +| [**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | | +| [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | | +| [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | | +| [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model | +| [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 | +| [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters | +| [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) | +| [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties | +| [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | +| [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | + + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + try { + HealthCheckResult result = apiInstance.fakeHealthGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHealthGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeHttpSignatureTest + +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + FakeApi apiInstance = new FakeApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + String query1 = "query1_example"; // String | query parameter + String header1 = "header1_example"; // String | header parameter + try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHttpSignatureTest"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | +| **query1** | **String**| query parameter | [optional] | +| **header1** | **String**| header parameter | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[http_signature_test](../README.md#http_signature_test) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeOuterBooleanSerialize + +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **Boolean**| Input boolean as post body | [optional] | + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body + try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + + +## fakeOuterNumberSerialize + +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(78); // BigDecimal | Input number as post body + try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **BigDecimal**| Input number as post body | [optional] | + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + + +## fakeOuterStringSerialize + +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **String**| Input string as post body | [optional] | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + + +## fakePropertyEnumIntegerSerialize + +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterObjectWithEnumProperty outerObjectWithEnumProperty = new OuterObjectWithEnumProperty(); // OuterObjectWithEnumProperty | Input enum (int) as post body + try { + OuterObjectWithEnumProperty result = apiInstance.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakePropertyEnumIntegerSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output enum (int) | - | + + +## testBodyWithBinary + +> testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + File body = new File("/path/to/file"); // File | image to upload + try { + apiInstance.testBodyWithBinary(body); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithBinary"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **File**| image to upload | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: image/png +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithFileSchema + +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + apiInstance.testBodyWithFileSchema(fileSchemaTestClass); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithQueryParams + +> testBodyWithQueryParams(query, user) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User user = new User(); // User | + try { + apiInstance.testBodyWithQueryParams(query, user); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **query** | **String**| | | +| **user** | [**User**](User.md)| | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClientModel(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testEndpointParameters + +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(78); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + LocalDate date = LocalDate.now(); // LocalDate | None + OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **number** | **BigDecimal**| None | | +| **_double** | **Double**| None | | +| **patternWithoutDelimiter** | **String**| None | | +| **_byte** | **byte[]**| None | | +| **integer** | **Integer**| None | [optional] | +| **int32** | **Integer**| None | [optional] | +| **int64** | **Long**| None | [optional] | +| **_float** | **Float**| None | [optional] | +| **string** | **String**| None | [optional] | +| **binary** | **File**| None | [optional] | +| **date** | **LocalDate**| None | [optional] | +| **dateTime** | **OffsetDateTime**| None | [optional] | +| **password** | **String**| None | [optional] | +| **paramCallback** | **String**| None | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## testEnumParameters + +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "_abc"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "_abc"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 1; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 1.1D; // Double | Query parameter enum test (double) + List enumQueryModelArray = Arrays.asList(-efg); // List | + List enumFormStringArray = Arrays.asList("$"); // List | Form parameter enum test (string array) + String enumFormString = "_abc"; // String | Form parameter enum test (string) + try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] | +| **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] | +| **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] | +| **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] | +| **enumQueryModelArray** | [**List<EnumClass>**](EnumClass.md)| | [optional] | +| **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] | +| **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + + +## testGroupParameters + +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requiredStringGroup** | **Integer**| Required String in group parameters | | +| **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | | +| **requiredInt64Group** | **Long**| Required Integer in group parameters | | +| **stringGroup** | **Integer**| String in group parameters | [optional] | +| **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] | +| **int64Group** | **Long**| Integer in group parameters | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + + +## testInlineAdditionalProperties + +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map requestBody = new HashMap(); // Map | request body + try { + apiInstance.testInlineAdditionalProperties(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | [**Map<String, String>**](String.md)| request body | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testJsonFormData + +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + apiInstance.testJsonFormData(param, param2); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **param** | **String**| field1 | | +| **param2** | **String**| field2 | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + String allowEmpty = "allowEmpty_example"; // String | + Map language = new HashMap(); // Map | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pipe** | [**List<String>**](String.md)| | | +| **ioutil** | [**List<String>**](String.md)| | | +| **http** | [**List<String>**](String.md)| | | +| **url** | [**List<String>**](String.md)| | | +| **context** | [**List<String>**](String.md)| | | +| **allowEmpty** | **String**| | | +| **language** | [**Map<String, String>**](String.md)| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java-helidon-client/se/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java-helidon-client/se/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..e4ff70ed909 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/FakeClassnameTags123Api.md @@ -0,0 +1,82 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case | + + + +## testClassname + +> Client testClassname(client) + +To test class name in snake case + +To test class name in snake case + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeClassnameTags123Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client client = new Client(); // Client | client model + try { + Client result = apiInstance.testClassname(client); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [**Client**](Client.md)| client model | | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java-helidon-client/se/docs/FileSchemaTestClass.md b/samples/client/petstore/java-helidon-client/se/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..85d1a063669 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/FileSchemaTestClass.md @@ -0,0 +1,14 @@ + + +# FileSchemaTestClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_file** | [**ModelFile**](ModelFile.md) | | [optional] | +|**files** | [**List<ModelFile>**](ModelFile.md) | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/Foo.md b/samples/client/petstore/java-helidon-client/se/docs/Foo.md new file mode 100644 index 00000000000..6b3f0556528 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/Foo.md @@ -0,0 +1,13 @@ + + +# Foo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/FooGetDefaultResponse.md b/samples/client/petstore/java-helidon-client/se/docs/FooGetDefaultResponse.md new file mode 100644 index 00000000000..ff3d7a3a56c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/FooGetDefaultResponse.md @@ -0,0 +1,13 @@ + + +# FooGetDefaultResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**string** | [**Foo**](Foo.md) | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/FormatTest.md b/samples/client/petstore/java-helidon-client/se/docs/FormatTest.md new file mode 100644 index 00000000000..01b8c777ae0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/FormatTest.md @@ -0,0 +1,28 @@ + + +# FormatTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integer** | **Integer** | | [optional] | +|**int32** | **Integer** | | [optional] | +|**int64** | **Long** | | [optional] | +|**number** | **BigDecimal** | | | +|**_float** | **Float** | | [optional] | +|**_double** | **Double** | | [optional] | +|**decimal** | **BigDecimal** | | [optional] | +|**string** | **String** | | [optional] | +|**_byte** | **byte[]** | | | +|**binary** | **File** | | [optional] | +|**date** | **LocalDate** | | | +|**dateTime** | **OffsetDateTime** | | [optional] | +|**uuid** | **UUID** | | [optional] | +|**password** | **String** | | | +|**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] | +|**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/HasOnlyReadOnly.md b/samples/client/petstore/java-helidon-client/se/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..29da5205dbb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/HasOnlyReadOnly.md @@ -0,0 +1,14 @@ + + +# HasOnlyReadOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**foo** | **String** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/HealthCheckResult.md b/samples/client/petstore/java-helidon-client/se/docs/HealthCheckResult.md new file mode 100644 index 00000000000..4885e6f1cad --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/HealthCheckResult.md @@ -0,0 +1,14 @@ + + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**nullableMessage** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/MapTest.md b/samples/client/petstore/java-helidon-client/se/docs/MapTest.md new file mode 100644 index 00000000000..54380188e1d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/MapTest.md @@ -0,0 +1,25 @@ + + +# MapTest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**mapMapOfString** | **Map<String, Map<String, String>>** | | [optional] | +|**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] | +|**directMap** | **Map<String, Boolean>** | | [optional] | +|**indirectMap** | **Map<String, Boolean>** | | [optional] | + + + +## Enum: Map<String, InnerEnum> + +| Name | Value | +|---- | -----| +| UPPER | "UPPER" | +| LOWER | "lower" | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java-helidon-client/se/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..a5ddf0faa6a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,15 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **UUID** | | [optional] | +|**dateTime** | **OffsetDateTime** | | [optional] | +|**map** | [**Map<String, Animal>**](Animal.md) | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/Model200Response.md b/samples/client/petstore/java-helidon-client/se/docs/Model200Response.md new file mode 100644 index 00000000000..109411580c6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/Model200Response.md @@ -0,0 +1,15 @@ + + +# Model200Response + +Model for testing model name starting with number + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | [optional] | +|**propertyClass** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/ModelApiResponse.md b/samples/client/petstore/java-helidon-client/se/docs/ModelApiResponse.md new file mode 100644 index 00000000000..e374c2dd2de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/ModelApiResponse.md @@ -0,0 +1,15 @@ + + +# ModelApiResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**code** | **Integer** | | [optional] | +|**type** | **String** | | [optional] | +|**message** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/ModelFile.md b/samples/client/petstore/java-helidon-client/se/docs/ModelFile.md new file mode 100644 index 00000000000..adcde984f52 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sourceURI** | **String** | Test capitalization | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/ModelList.md b/samples/client/petstore/java-helidon-client/se/docs/ModelList.md new file mode 100644 index 00000000000..f93ab7dde8d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_123list** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/ModelReturn.md b/samples/client/petstore/java-helidon-client/se/docs/ModelReturn.md new file mode 100644 index 00000000000..0bd356861eb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/ModelReturn.md @@ -0,0 +1,14 @@ + + +# ModelReturn + +Model for testing reserved words + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**_return** | **Integer** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/Name.md b/samples/client/petstore/java-helidon-client/se/docs/Name.md new file mode 100644 index 00000000000..c901d943530 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/Name.md @@ -0,0 +1,17 @@ + + +# Name + +Model for testing model name same as property name + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**name** | **Integer** | | | +|**snakeCase** | **Integer** | | [optional] [readonly] | +|**property** | **String** | | [optional] | +|**_123number** | **Integer** | | [optional] [readonly] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/NullableClass.md b/samples/client/petstore/java-helidon-client/se/docs/NullableClass.md new file mode 100644 index 00000000000..fa98c5c6d98 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/NullableClass.md @@ -0,0 +1,24 @@ + + +# NullableClass + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**integerProp** | **Integer** | | [optional] | +|**numberProp** | **BigDecimal** | | [optional] | +|**booleanProp** | **Boolean** | | [optional] | +|**stringProp** | **String** | | [optional] | +|**dateProp** | **LocalDate** | | [optional] | +|**datetimeProp** | **OffsetDateTime** | | [optional] | +|**arrayNullableProp** | **List<Object>** | | [optional] | +|**arrayAndItemsNullableProp** | **List<Object>** | | [optional] | +|**arrayItemsNullable** | **List<Object>** | | [optional] | +|**objectNullableProp** | **Map<String, Object>** | | [optional] | +|**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] | +|**objectItemsNullable** | **Map<String, Object>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/NumberOnly.md b/samples/client/petstore/java-helidon-client/se/docs/NumberOnly.md new file mode 100644 index 00000000000..b8ed1a4cfae --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/NumberOnly.md @@ -0,0 +1,13 @@ + + +# NumberOnly + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**justNumber** | **BigDecimal** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java-helidon-client/se/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 00000000000..f1cf571f4c0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,16 @@ + + +# ObjectWithDeprecatedFields + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**uuid** | **String** | | [optional] | +|**id** | **BigDecimal** | | [optional] | +|**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] | +|**bars** | **List<String>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/Order.md b/samples/client/petstore/java-helidon-client/se/docs/Order.md new file mode 100644 index 00000000000..27af32855c5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/Order.md @@ -0,0 +1,28 @@ + + +# Order + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**petId** | **Long** | | [optional] | +|**quantity** | **Integer** | | [optional] | +|**shipDate** | **OffsetDateTime** | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] | +|**complete** | **Boolean** | | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| PLACED | "placed" | +| APPROVED | "approved" | +| DELIVERED | "delivered" | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/OuterComposite.md b/samples/client/petstore/java-helidon-client/se/docs/OuterComposite.md new file mode 100644 index 00000000000..98b56e0763f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/OuterComposite.md @@ -0,0 +1,15 @@ + + +# OuterComposite + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**myNumber** | **BigDecimal** | | [optional] | +|**myString** | **String** | | [optional] | +|**myBoolean** | **Boolean** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/OuterEnum.md b/samples/client/petstore/java-helidon-client/se/docs/OuterEnum.md new file mode 100644 index 00000000000..1f9b723eb8e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java-helidon-client/se/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..cbc7f4ba54d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/OuterEnumDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumDefaultValue + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/OuterEnumInteger.md b/samples/client/petstore/java-helidon-client/se/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..f71dea30ad0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/OuterEnumInteger.md @@ -0,0 +1,15 @@ + + +# OuterEnumInteger + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java-helidon-client/se/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..99e6389f427 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumIntegerDefaultValue + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/java-helidon-client/se/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 00000000000..0fafaaa2715 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/OuterObjectWithEnumProperty.md @@ -0,0 +1,13 @@ + + +# OuterObjectWithEnumProperty + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**value** | **OuterEnumInteger** | | | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/Pet.md b/samples/client/petstore/java-helidon-client/se/docs/Pet.md new file mode 100644 index 00000000000..54af77a9f5a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/Pet.md @@ -0,0 +1,28 @@ + + +# Pet + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**category** | [**Category**](Category.md) | | [optional] | +|**name** | **String** | | | +|**photoUrls** | **Set<String>** | | | +|**tags** | [**List<Tag>**](Tag.md) | | [optional] | +|**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] | + + + +## Enum: StatusEnum + +| Name | Value | +|---- | -----| +| AVAILABLE | "available" | +| PENDING | "pending" | +| SOLD | "sold" | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/PetApi.md b/samples/client/petstore/java-helidon-client/se/docs/PetApi.md new file mode 100644 index 00000000000..e2515d9bb9b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/PetApi.md @@ -0,0 +1,678 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store | +| [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet | +| [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status | +| [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags | +| [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID | +| [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet | +| [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data | +| [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image | +| [**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) | + + + +## addPet + +> addPet(pet) + +Add a new pet to the store + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.addPet(pet); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + apiInstance.deletePet(petId, apiKey); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| Pet id to delete | | +| **apiKey** | **String**| | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid pet value | - | + + +## findPetsByStatus + +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + + +## findPetsByTags + +> Set<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Set tags = Arrays.asList(); // Set | Tags to filter by + try { + Set result = apiInstance.findPetsByTags(tags); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | [**Set<String>**](String.md)| Tags to filter by | | + +### Return type + +[**Set<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to return | | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + + +## updatePet + +> updatePet(pet) + +Update an existing pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.updatePet(pet); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet + try { + apiInstance.updatePetWithForm(petId, name, status); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet that needs to be updated | | +| **name** | **String**| Updated name of the pet | [optional] | +| **status** | **String**| Updated status of the pet | [optional] | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Successful operation | - | +| **405** | Invalid input | - | + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, _file) + +uploads an image + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File _file = new File("/path/to/file"); // File | file to upload + try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, _file); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | +| **_file** | **File**| file to upload | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | **Long**| ID of pet to update | | +| **requiredFile** | **File**| file to upload | | +| **additionalMetadata** | **String**| Additional data to pass to server | [optional] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java-helidon-client/se/docs/ReadOnlyFirst.md b/samples/client/petstore/java-helidon-client/se/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..ad6af7ee155 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/ReadOnlyFirst.md @@ -0,0 +1,14 @@ + + +# ReadOnlyFirst + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bar** | **String** | | [optional] [readonly] | +|**baz** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/SingleRefType.md b/samples/client/petstore/java-helidon-client/se/docs/SingleRefType.md new file mode 100644 index 00000000000..cc269bb871f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/SingleRefType.md @@ -0,0 +1,13 @@ + + +# SingleRefType + +## Enum + + +* `ADMIN` (value: `"admin"`) + +* `USER` (value: `"user"`) + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/SpecialModelName.md b/samples/client/petstore/java-helidon-client/se/docs/SpecialModelName.md new file mode 100644 index 00000000000..4b6a06e3622 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/SpecialModelName.md @@ -0,0 +1,13 @@ + + +# SpecialModelName + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**$specialPropertyName** | **Long** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/StoreApi.md b/samples/client/petstore/java-helidon-client/se/docs/StoreApi.md new file mode 100644 index 00000000000..e3b7d7b910c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/StoreApi.md @@ -0,0 +1,282 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID | +| [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status | +| [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID | +| [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet | + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + apiInstance.deleteOrder(orderId); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **String**| ID of the order that needs to be deleted | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## getInventory + +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + Map result = apiInstance.getInventory(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | **Long**| ID of pet that needs to be fetched | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order order = new Order(); // Order | order placed for purchasing the pet + try { + Order result = apiInstance.placeOrder(order); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **order** | [**Order**](Order.md)| order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + diff --git a/samples/client/petstore/java-helidon-client/se/docs/Tag.md b/samples/client/petstore/java-helidon-client/se/docs/Tag.md new file mode 100644 index 00000000000..5088b2dd1c3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/Tag.md @@ -0,0 +1,14 @@ + + +# Tag + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**name** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/User.md b/samples/client/petstore/java-helidon-client/se/docs/User.md new file mode 100644 index 00000000000..08813e4b10b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/User.md @@ -0,0 +1,20 @@ + + +# User + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**id** | **Long** | | [optional] | +|**username** | **String** | | [optional] | +|**firstName** | **String** | | [optional] | +|**lastName** | **String** | | [optional] | +|**email** | **String** | | [optional] | +|**password** | **String** | | [optional] | +|**phone** | **String** | | [optional] | +|**userStatus** | **Integer** | User Status | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/se/docs/UserApi.md b/samples/client/petstore/java-helidon-client/se/docs/UserApi.md new file mode 100644 index 00000000000..305fd6e66df --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/docs/UserApi.md @@ -0,0 +1,543 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**createUser**](UserApi.md#createUser) | **POST** /user | Create user | +| [**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array | +| [**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array | +| [**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user | +| [**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name | +| [**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system | +| [**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session | +| [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user | + + + +## createUser + +> createUser(user) + +Create user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + User user = new User(); // User | Created user object + try { + apiInstance.createUser(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**User**](User.md)| Created user object | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithArrayInput(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## createUsersWithListInput + +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List user = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithListInput(user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [**List<User>**](User.md)| List of user object | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + apiInstance.deleteUser(username); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be deleted | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + User result = apiInstance.getUserByName(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The name that needs to be fetched. Use user1 for testing. | | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## loginUser + +> String loginUser(username, password) + +Logs user into the system + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| The user name for login | | +| **password** | **String**| The password for login in clear text | | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +| **400** | Invalid username/password supplied | - | + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + apiInstance.logoutUser(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## updateUser + +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User user = new User(); // User | Updated user object + try { + apiInstance.updateUser(username, user); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | **String**| name that need to be deleted | | +| **user** | [**User**](User.md)| Updated user object | | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + diff --git a/samples/client/petstore/java-helidon-client/se/pom.xml b/samples/client/petstore/java-helidon-client/se/pom.xml new file mode 100644 index 00000000000..6047a12ad44 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + org.openapitools + + io.helidon.applications + helidon-se + 3.0.1 + + + petstore-helidon-client-se + petstore-helidon-client-se + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + 1.0.0 + jar + + + + io.helidon.webclient + helidon-webclient + + + io.helidon.config + helidon-config + + + jakarta.json + jakarta.json-api + + + io.helidon.media + helidon-media-jackson + + + org.glassfish.jersey.media + jersey-media-json-jackson + + + org.openapitools + jackson-databind-nullable + 0.2.2 + + + org.junit.jupiter + junit-jupiter-api + test + + + org.hamcrest + hamcrest-all + test + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-libs + + + + + + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 00000000000..831df8cb587 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,241 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.jackson.nullable.JsonNullableModule; + +import io.helidon.config.Config; +import io.helidon.media.jackson.JacksonSupport; +import io.helidon.webclient.WebClient; + +import java.net.URI; +import java.net.URLEncoder; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.StringJoiner; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import static java.nio.charset.StandardCharsets.UTF_8; + +/** + * Configuration and utility class for API clients. + *

+ * Use the {@link ApiClient.Builder} class to prepare and ultimately create the {@code ApiClient} instance. + *

+ */ +public class ApiClient { + + private final WebClient webClient; + + /** + * @return a {@code Builder} for an {@code ApiClient} + */ + public static ApiClient.Builder builder() { + return new Builder(); + } + + /** + * URL encode a string in the UTF-8 encoding. + * + * @param s String to encode. + * @return URL-encoded representation of the input string. + */ + public static String urlEncode(String s) { + return URLEncoder.encode(s, UTF_8); + } + + /** + * Convert a URL query name/value parameter to a list of encoded {@link Pair} + * objects. + * + *

The value can be null, in which case an empty list is returned.

+ * + * @param name The query name parameter. + * @param value The query value, which may not be a collection but may be + * null. + * @return A singleton list of the {@link Pair} objects representing the input + * parameters, which is encoded for use in a URL. If the value is null, an + * empty list is returned. + */ + public static List parameterToPairs(String name, Object value) { + if (name == null || name.isEmpty() || value == null) { + return Collections.emptyList(); + } + return Collections.singletonList(new Pair(urlEncode(name), urlEncode(valueToString(value)))); + } + + /** + * Convert a URL query name/collection parameter to a list of encoded + * {@link Pair} objects. + * + * @param collectionFormat The swagger collectionFormat string (csv, tsv, etc). + * @param name The query name parameter. + * @param values A collection of values for the given query name, which may be + * null. + * @return A list of {@link Pair} objects representing the input parameters, + * which is encoded for use in a URL. If the values collection is null, an + * empty list is returned. + */ + public static List parameterToPairs( + String collectionFormat, String name, Collection values) { + if (name == null || name.isEmpty() || values == null || values.isEmpty()) { + return Collections.emptyList(); + } + + // get the collection format (default: csv) + String format = collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat; + + // create the params based on the collection format + if ("multi".equals(format)) { + return values.stream() + .map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value)))) + .collect(Collectors.toList()); + } + + String delimiter; + switch(format) { + case "csv": + delimiter = urlEncode(","); + break; + case "ssv": + delimiter = urlEncode(" "); + break; + case "tsv": + delimiter = urlEncode("\t"); + break; + case "pipes": + delimiter = urlEncode("|"); + break; + default: + throw new IllegalArgumentException("Illegal collection format: " + collectionFormat); + } + + StringJoiner joiner = new StringJoiner(delimiter); + for (Object value : values) { + joiner.add(urlEncode(valueToString(value))); + } + + return Collections.singletonList(new Pair(urlEncode(name), joiner.toString())); + } + + private ApiClient(Builder builder) { + webClient = builder.webClientBuilder().build(); + } + + /** + * Get the {@link WebClient} prepared by the builder of this {@code ApiClient}. + * + * @return the WebClient + */ + public WebClient webClient() { + return webClient; + } + + private static String valueToString(Object value) { + if (value == null) { + return ""; + } + if (value instanceof OffsetDateTime) { + return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + return value.toString(); + } + + /** + * Builder for creating a new {@code ApiClient} instance. + * + *

+ * The builder accepts a {@link WebClient.Builder} via the {@code webClientBuilder} method but will provide a default one + * using available configuration (the {@code client} node) and the base URI set in the OpenAPI document. + *

+ */ + public static class Builder { + + private WebClient.Builder webClientBuilder; + private Config clientConfig; + private ObjectMapper objectMapper; + + public ApiClient build() { + return new ApiClient(this); + } + + /** + * Sets the {@code WebClient.Builder} which the {@code ApiClient.Builder} uses. Any previous setting is discarded. + * + * @param webClientBuilder the {@code WebClient.Builder} to be used going forward + * @return the updated builder + */ + public Builder webClientBuilder(WebClient.Builder webClientBuilder) { + this.webClientBuilder = webClientBuilder; + return this; + } + + /** + * Sets the client {@code Config} which the {@code ApiClient.Builder} uses in preparing a default {@code WebClient.Builder}. + * The builder ignores this setting if you provide your own {@code WebClient.Builder} by invoking the + * {@code webClientBuilder} method. + * + * @param clientConfig the {@code Config} node containing client settings + * @return the updated builder + */ + public Builder clientConfig(Config clientConfig) { + this.clientConfig = clientConfig; + return this; + } + + /** + * @return the previously-stored web client builder or, if none, a default one using the provided or defaulted + * client configuration + */ + public WebClient.Builder webClientBuilder() { + if (webClientBuilder == null) { + webClientBuilder = defaultWebClientBuilder(); + } + return webClientBuilder; + } + + /** + * Stores the Jackson {@code ObjectMapper} the builder uses in preparing the {@code WebClient}. + * + * @param objectMapper the Jackson object mapper to use in all API invocations via the built {@code ApiClient} + * @return the updated builder + */ + public Builder objectMapper(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + return this; + } + + private WebClient.Builder defaultWebClientBuilder() { + WebClient.Builder defaultWebClientBuilder = WebClient.builder() + .baseUri("http://petstore.swagger.io:80/v2") + .config(clientConfig()); + defaultWebClientBuilder.addMediaSupport(objectMapper == null + ? JacksonSupport.create() + : JacksonSupport.create(objectMapper)); + return defaultWebClientBuilder; + } + + private Config clientConfig() { + if (clientConfig == null) { + clientConfig = Config.create().get("client"); + } + return clientConfig; + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 00000000000..f1e304babec --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,43 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import java.util.concurrent.ExecutionException; + +import io.helidon.common.GenericType; +import io.helidon.common.reactive.Single; +import io.helidon.webclient.WebClientResponse; + +/** + * Generic-typed response. + * + * Return type for generated API methods. + * + * @param type of the return value from the generated API method + */ +public interface ApiResponse { + + static ApiResponse create(GenericType responseType, Single webClientResponse) { + return new ApiResponseBase<>(responseType, webClientResponse); + } + + /** + * @returns reactive access to the {@link WebClientResponse} describing the response from the server + */ + Single webClientResponse(); + + /** + * @return reactive access to the value returned in the response from the server + */ + Single result() throws ExecutionException, InterruptedException; +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiResponseBase.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiResponseBase.java new file mode 100644 index 00000000000..7653613d4ec --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/ApiResponseBase.java @@ -0,0 +1,45 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import java.util.concurrent.ExecutionException; + +import io.helidon.common.GenericType; +import io.helidon.common.reactive.Single; +import io.helidon.webclient.WebClientResponse; + +/** + * Implementation of a generic-typed response. + * + * @param type of the return value from the generated API method + */ +class ApiResponseBase implements ApiResponse { + + private final Single webClientResponse; + private final GenericType responseType; + + protected ApiResponseBase(GenericType responseType, Single webClientResponse) { + this.webClientResponse = webClientResponse; + this.responseType = responseType; + } + + @Override + public Single webClientResponse() { + return webClientResponse; + } + + @Override + public Single result() throws ExecutionException, InterruptedException { + return webClientResponse.get().content().as(responseType); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 00000000000..50dd6b1cd2e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,56 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 00000000000..dd96c18c0d3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.text.DecimalFormat; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } + + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return super.clone(); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 00000000000..f1f0fe1f3d5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -0,0 +1,35 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.ApiResponse; +import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public interface AnotherFakeApi { + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param client client model (required) + * @return {@code ApiResponse} + */ + ApiResponse call123testSpecialTags(Client client); + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java new file mode 100644 index 00000000000..39001e3d1c2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java @@ -0,0 +1,97 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.util.Objects; +import org.openapitools.client.ApiResponse; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.helidon.common.GenericType; +import io.helidon.common.http.MediaType; +import io.helidon.common.reactive.Single; +import io.helidon.config.Config; +import io.helidon.media.common.MediaSupport; + +import io.helidon.media.jackson.JacksonSupport; +import io.helidon.webclient.WebClientRequestBuilder; +import io.helidon.webclient.WebClientResponse; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public class AnotherFakeApiImpl implements AnotherFakeApi { + + private final ApiClient apiClient; + + protected static final GenericType RESPONSE_TYPE_call123testSpecialTags = ResponseType.create(Client.class); + + /** + * Creates a new instance of AnotherFakeApiImpl initialized with the specified {@link ApiClient}. + * + */ + public static AnotherFakeApiImpl create(ApiClient apiClient) { + return new AnotherFakeApiImpl(apiClient); + } + + protected AnotherFakeApiImpl(ApiClient apiClient) { + this.apiClient = apiClient; + } + + @Override + public ApiResponse call123testSpecialTags(Client client) { + Objects.requireNonNull(client, "Required parameter 'client' not specified"); + WebClientRequestBuilder webClientRequestBuilder = call123testSpecialTagsRequestBuilder(client); + return call123testSpecialTagsSubmit(webClientRequestBuilder, client); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the call123testSpecialTags operation. + * Optional customization point for subclasses. + * + * @param client client model (required) + * @return WebClientRequestBuilder for call123testSpecialTags + */ + protected WebClientRequestBuilder call123testSpecialTagsRequestBuilder(Client client) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("PATCH"); + + webClientRequestBuilder.path("/another-fake/dummy"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the call123testSpecialTags operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param client client model (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse call123testSpecialTagsSubmit(WebClientRequestBuilder webClientRequestBuilder, Client client) { + Single webClientResponse = webClientRequestBuilder.submit(client); + return ApiResponse.create(RESPONSE_TYPE_call123testSpecialTags, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 00000000000..75f45b2d889 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,27 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.ApiResponse; +import org.openapitools.client.model.FooGetDefaultResponse; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public interface DefaultApi { + + ApiResponse fooGet(); + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/DefaultApiImpl.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/DefaultApiImpl.java new file mode 100644 index 00000000000..734cd4f3107 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/DefaultApiImpl.java @@ -0,0 +1,91 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.util.Objects; +import org.openapitools.client.ApiResponse; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.helidon.common.GenericType; +import io.helidon.common.http.MediaType; +import io.helidon.common.reactive.Single; +import io.helidon.config.Config; +import io.helidon.media.common.MediaSupport; + +import io.helidon.media.jackson.JacksonSupport; +import io.helidon.webclient.WebClientRequestBuilder; +import io.helidon.webclient.WebClientResponse; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.FooGetDefaultResponse; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public class DefaultApiImpl implements DefaultApi { + + private final ApiClient apiClient; + + protected static final GenericType RESPONSE_TYPE_fooGet = ResponseType.create(FooGetDefaultResponse.class); + + /** + * Creates a new instance of DefaultApiImpl initialized with the specified {@link ApiClient}. + * + */ + public static DefaultApiImpl create(ApiClient apiClient) { + return new DefaultApiImpl(apiClient); + } + + protected DefaultApiImpl(ApiClient apiClient) { + this.apiClient = apiClient; + } + + @Override + public ApiResponse fooGet() { + WebClientRequestBuilder webClientRequestBuilder = fooGetRequestBuilder(); + return fooGetSubmit(webClientRequestBuilder); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the fooGet operation. + * Optional customization point for subclasses. + * + * @return WebClientRequestBuilder for fooGet + */ + protected WebClientRequestBuilder fooGetRequestBuilder() { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + webClientRequestBuilder.path("/foo"); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the fooGet operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse fooGetSubmit(WebClientRequestBuilder webClientRequestBuilder) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_fooGet, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 00000000000..01701727d04 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,146 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.ApiResponse; +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.util.List; +import java.time.LocalDate; +import java.util.Map; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.User; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public interface FakeApi { + + /** + * Health check endpoint + * @return {@code ApiResponse} + */ + ApiResponse fakeHealthGet(); + + /** + * test http signature authentication + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @return {@code ApiResponse} + */ + ApiResponse fakeHttpSignatureTest(Pet pet, String query1, String header1); + + ApiResponse fakeOuterBooleanSerialize(Boolean body); + + ApiResponse fakeOuterCompositeSerialize(OuterComposite outerComposite); + + ApiResponse fakeOuterNumberSerialize(BigDecimal body); + + ApiResponse fakeOuterStringSerialize(String body); + + ApiResponse fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty); + + ApiResponse testBodyWithBinary(File body); + + ApiResponse testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass); + + ApiResponse testBodyWithQueryParams(String query, User user); + + /** + * To test \"client\" model + * To test \"client\" model + * @param client client model (required) + * @return {@code ApiResponse} + */ + ApiResponse testClientModel(Client client); + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return {@code ApiResponse} + */ + ApiResponse testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback); + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumQueryModelArray (optional + * @param enumFormStringArray Form parameter enum test (string array) (optional + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return {@code ApiResponse} + */ + ApiResponse testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString); + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return {@code ApiResponse} + */ + ApiResponse testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group); + + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @return {@code ApiResponse} + */ + ApiResponse testInlineAdditionalProperties(Map requestBody); + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return {@code ApiResponse} + */ + ApiResponse testJsonFormData(String param, String param2); + + ApiResponse testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language); + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java new file mode 100644 index 00000000000..1b323ac2f88 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -0,0 +1,887 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.util.Objects; +import org.openapitools.client.ApiResponse; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.helidon.common.GenericType; +import io.helidon.common.http.MediaType; +import io.helidon.common.reactive.Single; +import io.helidon.config.Config; +import io.helidon.media.common.MediaSupport; + +import io.helidon.media.jackson.JacksonSupport; +import io.helidon.webclient.WebClientRequestBuilder; +import io.helidon.webclient.WebClientResponse; + +import org.openapitools.client.ApiClient; + +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.util.List; +import java.time.LocalDate; +import java.util.Map; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.User; +import java.util.ArrayList; +import org.openapitools.client.Pair; +import java.util.StringJoiner; +import io.helidon.webclient.WebClientRequestHeaders; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public class FakeApiImpl implements FakeApi { + + private final ApiClient apiClient; + + protected static final GenericType RESPONSE_TYPE_fakeHealthGet = ResponseType.create(HealthCheckResult.class); + protected static final GenericType RESPONSE_TYPE_fakeHttpSignatureTest = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_fakeOuterBooleanSerialize = ResponseType.create(Boolean.class); + protected static final GenericType RESPONSE_TYPE_fakeOuterCompositeSerialize = ResponseType.create(OuterComposite.class); + protected static final GenericType RESPONSE_TYPE_fakeOuterNumberSerialize = ResponseType.create(BigDecimal.class); + protected static final GenericType RESPONSE_TYPE_fakeOuterStringSerialize = ResponseType.create(String.class); + protected static final GenericType RESPONSE_TYPE_fakePropertyEnumIntegerSerialize = ResponseType.create(OuterObjectWithEnumProperty.class); + protected static final GenericType RESPONSE_TYPE_testBodyWithBinary = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testBodyWithFileSchema = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testBodyWithQueryParams = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testClientModel = ResponseType.create(Client.class); + protected static final GenericType RESPONSE_TYPE_testEndpointParameters = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testEnumParameters = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testGroupParameters = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testInlineAdditionalProperties = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testJsonFormData = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testQueryParameterCollectionFormat = ResponseType.create(Void.class); + + /** + * Creates a new instance of FakeApiImpl initialized with the specified {@link ApiClient}. + * + */ + public static FakeApiImpl create(ApiClient apiClient) { + return new FakeApiImpl(apiClient); + } + + protected FakeApiImpl(ApiClient apiClient) { + this.apiClient = apiClient; + } + + @Override + public ApiResponse fakeHealthGet() { + WebClientRequestBuilder webClientRequestBuilder = fakeHealthGetRequestBuilder(); + return fakeHealthGetSubmit(webClientRequestBuilder); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the fakeHealthGet operation. + * Optional customization point for subclasses. + * + * @return WebClientRequestBuilder for fakeHealthGet + */ + protected WebClientRequestBuilder fakeHealthGetRequestBuilder() { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + webClientRequestBuilder.path("/fake/health"); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the fakeHealthGet operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse fakeHealthGetSubmit(WebClientRequestBuilder webClientRequestBuilder) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_fakeHealthGet, webClientResponse); + } + + @Override + public ApiResponse fakeHttpSignatureTest(Pet pet, String query1, String header1) { + Objects.requireNonNull(pet, "Required parameter 'pet' not specified"); + WebClientRequestBuilder webClientRequestBuilder = fakeHttpSignatureTestRequestBuilder(pet, query1, header1); + return fakeHttpSignatureTestSubmit(webClientRequestBuilder, pet, query1, header1); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the fakeHttpSignatureTest operation. + * Optional customization point for subclasses. + * + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @return WebClientRequestBuilder for fakeHttpSignatureTest + */ + protected WebClientRequestBuilder fakeHttpSignatureTestRequestBuilder(Pet pet, String query1, String header1) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + List queryParams = new ArrayList<>(); + queryParams.addAll(ApiClient.parameterToPairs("query_1", query1)); + queryParams.forEach(p -> webClientRequestBuilder.queryParam(p.getName(), p.getValue())); + + WebClientRequestHeaders headers = webClientRequestBuilder.headers(); + if (header1 != null) { + headers.put("header_1", header1); + } + + webClientRequestBuilder.path("/fake/http-signature-test"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the fakeHttpSignatureTest operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse fakeHttpSignatureTestSubmit(WebClientRequestBuilder webClientRequestBuilder, Pet pet, String query1, String header1) { + Single webClientResponse = webClientRequestBuilder.submit(pet); + return ApiResponse.create(RESPONSE_TYPE_fakeHttpSignatureTest, webClientResponse); + } + + @Override + public ApiResponse fakeOuterBooleanSerialize(Boolean body) { + WebClientRequestBuilder webClientRequestBuilder = fakeOuterBooleanSerializeRequestBuilder(body); + return fakeOuterBooleanSerializeSubmit(webClientRequestBuilder, body); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the fakeOuterBooleanSerialize operation. + * Optional customization point for subclasses. + * + * @param body Input boolean as post body (optional) + * @return WebClientRequestBuilder for fakeOuterBooleanSerialize + */ + protected WebClientRequestBuilder fakeOuterBooleanSerializeRequestBuilder(Boolean body) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/fake/outer/boolean"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the fakeOuterBooleanSerialize operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param body Input boolean as post body (optional) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse fakeOuterBooleanSerializeSubmit(WebClientRequestBuilder webClientRequestBuilder, Boolean body) { + Single webClientResponse = webClientRequestBuilder.submit(body); + return ApiResponse.create(RESPONSE_TYPE_fakeOuterBooleanSerialize, webClientResponse); + } + + @Override + public ApiResponse fakeOuterCompositeSerialize(OuterComposite outerComposite) { + WebClientRequestBuilder webClientRequestBuilder = fakeOuterCompositeSerializeRequestBuilder(outerComposite); + return fakeOuterCompositeSerializeSubmit(webClientRequestBuilder, outerComposite); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the fakeOuterCompositeSerialize operation. + * Optional customization point for subclasses. + * + * @param outerComposite Input composite as post body (optional) + * @return WebClientRequestBuilder for fakeOuterCompositeSerialize + */ + protected WebClientRequestBuilder fakeOuterCompositeSerializeRequestBuilder(OuterComposite outerComposite) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/fake/outer/composite"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the fakeOuterCompositeSerialize operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param outerComposite Input composite as post body (optional) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse fakeOuterCompositeSerializeSubmit(WebClientRequestBuilder webClientRequestBuilder, OuterComposite outerComposite) { + Single webClientResponse = webClientRequestBuilder.submit(outerComposite); + return ApiResponse.create(RESPONSE_TYPE_fakeOuterCompositeSerialize, webClientResponse); + } + + @Override + public ApiResponse fakeOuterNumberSerialize(BigDecimal body) { + WebClientRequestBuilder webClientRequestBuilder = fakeOuterNumberSerializeRequestBuilder(body); + return fakeOuterNumberSerializeSubmit(webClientRequestBuilder, body); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the fakeOuterNumberSerialize operation. + * Optional customization point for subclasses. + * + * @param body Input number as post body (optional) + * @return WebClientRequestBuilder for fakeOuterNumberSerialize + */ + protected WebClientRequestBuilder fakeOuterNumberSerializeRequestBuilder(BigDecimal body) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/fake/outer/number"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the fakeOuterNumberSerialize operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param body Input number as post body (optional) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse fakeOuterNumberSerializeSubmit(WebClientRequestBuilder webClientRequestBuilder, BigDecimal body) { + Single webClientResponse = webClientRequestBuilder.submit(body); + return ApiResponse.create(RESPONSE_TYPE_fakeOuterNumberSerialize, webClientResponse); + } + + @Override + public ApiResponse fakeOuterStringSerialize(String body) { + WebClientRequestBuilder webClientRequestBuilder = fakeOuterStringSerializeRequestBuilder(body); + return fakeOuterStringSerializeSubmit(webClientRequestBuilder, body); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the fakeOuterStringSerialize operation. + * Optional customization point for subclasses. + * + * @param body Input string as post body (optional) + * @return WebClientRequestBuilder for fakeOuterStringSerialize + */ + protected WebClientRequestBuilder fakeOuterStringSerializeRequestBuilder(String body) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/fake/outer/string"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the fakeOuterStringSerialize operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param body Input string as post body (optional) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse fakeOuterStringSerializeSubmit(WebClientRequestBuilder webClientRequestBuilder, String body) { + Single webClientResponse = webClientRequestBuilder.submit(body); + return ApiResponse.create(RESPONSE_TYPE_fakeOuterStringSerialize, webClientResponse); + } + + @Override + public ApiResponse fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + Objects.requireNonNull(outerObjectWithEnumProperty, "Required parameter 'outerObjectWithEnumProperty' not specified"); + WebClientRequestBuilder webClientRequestBuilder = fakePropertyEnumIntegerSerializeRequestBuilder(outerObjectWithEnumProperty); + return fakePropertyEnumIntegerSerializeSubmit(webClientRequestBuilder, outerObjectWithEnumProperty); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the fakePropertyEnumIntegerSerialize operation. + * Optional customization point for subclasses. + * + * @param outerObjectWithEnumProperty Input enum (int) as post body (required) + * @return WebClientRequestBuilder for fakePropertyEnumIntegerSerialize + */ + protected WebClientRequestBuilder fakePropertyEnumIntegerSerializeRequestBuilder(OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/fake/property/enum-int"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the fakePropertyEnumIntegerSerialize operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param outerObjectWithEnumProperty Input enum (int) as post body (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse fakePropertyEnumIntegerSerializeSubmit(WebClientRequestBuilder webClientRequestBuilder, OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + Single webClientResponse = webClientRequestBuilder.submit(outerObjectWithEnumProperty); + return ApiResponse.create(RESPONSE_TYPE_fakePropertyEnumIntegerSerialize, webClientResponse); + } + + @Override + public ApiResponse testBodyWithBinary(File body) { + Objects.requireNonNull(body, "Required parameter 'body' not specified"); + WebClientRequestBuilder webClientRequestBuilder = testBodyWithBinaryRequestBuilder(body); + return testBodyWithBinarySubmit(webClientRequestBuilder, body); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testBodyWithBinary operation. + * Optional customization point for subclasses. + * + * @param body image to upload (required) + * @return WebClientRequestBuilder for testBodyWithBinary + */ + protected WebClientRequestBuilder testBodyWithBinaryRequestBuilder(File body) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("PUT"); + + webClientRequestBuilder.path("/fake/body-with-binary"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testBodyWithBinary operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param body image to upload (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testBodyWithBinarySubmit(WebClientRequestBuilder webClientRequestBuilder, File body) { + Single webClientResponse = webClientRequestBuilder.submit(body); + return ApiResponse.create(RESPONSE_TYPE_testBodyWithBinary, webClientResponse); + } + + @Override + public ApiResponse testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) { + Objects.requireNonNull(fileSchemaTestClass, "Required parameter 'fileSchemaTestClass' not specified"); + WebClientRequestBuilder webClientRequestBuilder = testBodyWithFileSchemaRequestBuilder(fileSchemaTestClass); + return testBodyWithFileSchemaSubmit(webClientRequestBuilder, fileSchemaTestClass); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testBodyWithFileSchema operation. + * Optional customization point for subclasses. + * + * @param fileSchemaTestClass (required) + * @return WebClientRequestBuilder for testBodyWithFileSchema + */ + protected WebClientRequestBuilder testBodyWithFileSchemaRequestBuilder(FileSchemaTestClass fileSchemaTestClass) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("PUT"); + + webClientRequestBuilder.path("/fake/body-with-file-schema"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testBodyWithFileSchema operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param fileSchemaTestClass (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testBodyWithFileSchemaSubmit(WebClientRequestBuilder webClientRequestBuilder, FileSchemaTestClass fileSchemaTestClass) { + Single webClientResponse = webClientRequestBuilder.submit(fileSchemaTestClass); + return ApiResponse.create(RESPONSE_TYPE_testBodyWithFileSchema, webClientResponse); + } + + @Override + public ApiResponse testBodyWithQueryParams(String query, User user) { + Objects.requireNonNull(query, "Required parameter 'query' not specified"); + Objects.requireNonNull(user, "Required parameter 'user' not specified"); + WebClientRequestBuilder webClientRequestBuilder = testBodyWithQueryParamsRequestBuilder(query, user); + return testBodyWithQueryParamsSubmit(webClientRequestBuilder, query, user); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testBodyWithQueryParams operation. + * Optional customization point for subclasses. + * + * @param query (required) + * @param user (required) + * @return WebClientRequestBuilder for testBodyWithQueryParams + */ + protected WebClientRequestBuilder testBodyWithQueryParamsRequestBuilder(String query, User user) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("PUT"); + + List queryParams = new ArrayList<>(); + queryParams.addAll(ApiClient.parameterToPairs("query", query)); + queryParams.forEach(p -> webClientRequestBuilder.queryParam(p.getName(), p.getValue())); + + webClientRequestBuilder.path("/fake/body-with-query-params"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testBodyWithQueryParams operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param query (required) + * @param user (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testBodyWithQueryParamsSubmit(WebClientRequestBuilder webClientRequestBuilder, String query, User user) { + Single webClientResponse = webClientRequestBuilder.submit(user); + return ApiResponse.create(RESPONSE_TYPE_testBodyWithQueryParams, webClientResponse); + } + + @Override + public ApiResponse testClientModel(Client client) { + Objects.requireNonNull(client, "Required parameter 'client' not specified"); + WebClientRequestBuilder webClientRequestBuilder = testClientModelRequestBuilder(client); + return testClientModelSubmit(webClientRequestBuilder, client); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testClientModel operation. + * Optional customization point for subclasses. + * + * @param client client model (required) + * @return WebClientRequestBuilder for testClientModel + */ + protected WebClientRequestBuilder testClientModelRequestBuilder(Client client) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("PATCH"); + + webClientRequestBuilder.path("/fake"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testClientModel operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param client client model (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testClientModelSubmit(WebClientRequestBuilder webClientRequestBuilder, Client client) { + Single webClientResponse = webClientRequestBuilder.submit(client); + return ApiResponse.create(RESPONSE_TYPE_testClientModel, webClientResponse); + } + + @Override + public ApiResponse testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) { + Objects.requireNonNull(number, "Required parameter 'number' not specified"); + Objects.requireNonNull(_double, "Required parameter '_double' not specified"); + Objects.requireNonNull(patternWithoutDelimiter, "Required parameter 'patternWithoutDelimiter' not specified"); + Objects.requireNonNull(_byte, "Required parameter '_byte' not specified"); + WebClientRequestBuilder webClientRequestBuilder = testEndpointParametersRequestBuilder(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + return testEndpointParametersSubmit(webClientRequestBuilder, number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testEndpointParameters operation. + * Optional customization point for subclasses. + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return WebClientRequestBuilder for testEndpointParameters + */ + protected WebClientRequestBuilder testEndpointParametersRequestBuilder(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/fake"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testEndpointParameters operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testEndpointParametersSubmit(WebClientRequestBuilder webClientRequestBuilder, BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) { + String formParams = new StringJoiner("&") + .add("integer=" + integer) + .add("int32=" + int32) + .add("int64=" + int64) + .add("number=" + number) + .add("float=" + _float) + .add("double=" + _double) + .add("string=" + string) + .add("pattern_without_delimiter=" + patternWithoutDelimiter) + .add("byte=" + _byte) + .add("binary=" + binary) + .add("date=" + date) + .add("dateTime=" + dateTime) + .add("password=" + password) + .add("callback=" + paramCallback) + .toString(); + Single webClientResponse = webClientRequestBuilder.submit(formParams); + return ApiResponse.create(RESPONSE_TYPE_testEndpointParameters, webClientResponse); + } + + @Override + public ApiResponse testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) { + WebClientRequestBuilder webClientRequestBuilder = testEnumParametersRequestBuilder(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + return testEnumParametersSubmit(webClientRequestBuilder, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testEnumParameters operation. + * Optional customization point for subclasses. + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumQueryModelArray (optional + * @param enumFormStringArray Form parameter enum test (string array) (optional + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return WebClientRequestBuilder for testEnumParameters + */ + protected WebClientRequestBuilder testEnumParametersRequestBuilder(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + List queryParams = new ArrayList<>(); + queryParams.addAll(ApiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray)); + queryParams.addAll(ApiClient.parameterToPairs("enum_query_string", enumQueryString)); + queryParams.addAll(ApiClient.parameterToPairs("enum_query_integer", enumQueryInteger)); + queryParams.addAll(ApiClient.parameterToPairs("enum_query_double", enumQueryDouble)); + queryParams.addAll(ApiClient.parameterToPairs("multi", "enum_query_model_array", enumQueryModelArray)); + queryParams.forEach(p -> webClientRequestBuilder.queryParam(p.getName(), p.getValue())); + + WebClientRequestHeaders headers = webClientRequestBuilder.headers(); + if (enumHeaderStringArray != null) { + headers.put("enum_header_string_array", enumHeaderStringArray.toString()); + } + if (enumHeaderString != null) { + headers.put("enum_header_string", enumHeaderString); + } + + webClientRequestBuilder.path("/fake"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testEnumParameters operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param enumHeaderStringArray Header parameter enum test (string array) (optional + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumQueryModelArray (optional + * @param enumFormStringArray Form parameter enum test (string array) (optional + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testEnumParametersSubmit(WebClientRequestBuilder webClientRequestBuilder, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) { + String formParams = new StringJoiner("&") + .add("enum_form_string_array=" + enumFormStringArray) + .add("enum_form_string=" + enumFormString) + .toString(); + Single webClientResponse = webClientRequestBuilder.submit(formParams); + return ApiResponse.create(RESPONSE_TYPE_testEnumParameters, webClientResponse); + } + + @Override + public ApiResponse testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { + Objects.requireNonNull(requiredStringGroup, "Required parameter 'requiredStringGroup' not specified"); + Objects.requireNonNull(requiredBooleanGroup, "Required parameter 'requiredBooleanGroup' not specified"); + Objects.requireNonNull(requiredInt64Group, "Required parameter 'requiredInt64Group' not specified"); + WebClientRequestBuilder webClientRequestBuilder = testGroupParametersRequestBuilder(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + return testGroupParametersSubmit(webClientRequestBuilder, requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testGroupParameters operation. + * Optional customization point for subclasses. + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return WebClientRequestBuilder for testGroupParameters + */ + protected WebClientRequestBuilder testGroupParametersRequestBuilder(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("DELETE"); + + List queryParams = new ArrayList<>(); + queryParams.addAll(ApiClient.parameterToPairs("required_string_group", requiredStringGroup)); + queryParams.addAll(ApiClient.parameterToPairs("required_int64_group", requiredInt64Group)); + queryParams.addAll(ApiClient.parameterToPairs("string_group", stringGroup)); + queryParams.addAll(ApiClient.parameterToPairs("int64_group", int64Group)); + queryParams.forEach(p -> webClientRequestBuilder.queryParam(p.getName(), p.getValue())); + + WebClientRequestHeaders headers = webClientRequestBuilder.headers(); + if (requiredBooleanGroup != null) { + headers.put("required_boolean_group", requiredBooleanGroup.toString()); + } + if (booleanGroup != null) { + headers.put("boolean_group", booleanGroup.toString()); + } + + webClientRequestBuilder.path("/fake"); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testGroupParameters operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testGroupParametersSubmit(WebClientRequestBuilder webClientRequestBuilder, Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_testGroupParameters, webClientResponse); + } + + @Override + public ApiResponse testInlineAdditionalProperties(Map requestBody) { + Objects.requireNonNull(requestBody, "Required parameter 'requestBody' not specified"); + WebClientRequestBuilder webClientRequestBuilder = testInlineAdditionalPropertiesRequestBuilder(requestBody); + return testInlineAdditionalPropertiesSubmit(webClientRequestBuilder, requestBody); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testInlineAdditionalProperties operation. + * Optional customization point for subclasses. + * + * @param requestBody request body (required) + * @return WebClientRequestBuilder for testInlineAdditionalProperties + */ + protected WebClientRequestBuilder testInlineAdditionalPropertiesRequestBuilder(Map requestBody) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/fake/inline-additionalProperties"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testInlineAdditionalProperties operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param requestBody request body (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testInlineAdditionalPropertiesSubmit(WebClientRequestBuilder webClientRequestBuilder, Map requestBody) { + Single webClientResponse = webClientRequestBuilder.submit(requestBody); + return ApiResponse.create(RESPONSE_TYPE_testInlineAdditionalProperties, webClientResponse); + } + + @Override + public ApiResponse testJsonFormData(String param, String param2) { + Objects.requireNonNull(param, "Required parameter 'param' not specified"); + Objects.requireNonNull(param2, "Required parameter 'param2' not specified"); + WebClientRequestBuilder webClientRequestBuilder = testJsonFormDataRequestBuilder(param, param2); + return testJsonFormDataSubmit(webClientRequestBuilder, param, param2); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testJsonFormData operation. + * Optional customization point for subclasses. + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return WebClientRequestBuilder for testJsonFormData + */ + protected WebClientRequestBuilder testJsonFormDataRequestBuilder(String param, String param2) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + webClientRequestBuilder.path("/fake/jsonFormData"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testJsonFormData operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param param field1 (required) + * @param param2 field2 (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testJsonFormDataSubmit(WebClientRequestBuilder webClientRequestBuilder, String param, String param2) { + String formParams = new StringJoiner("&") + .add("param=" + param) + .add("param2=" + param2) + .toString(); + Single webClientResponse = webClientRequestBuilder.submit(formParams); + return ApiResponse.create(RESPONSE_TYPE_testJsonFormData, webClientResponse); + } + + @Override + public ApiResponse testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) { + Objects.requireNonNull(pipe, "Required parameter 'pipe' not specified"); + Objects.requireNonNull(ioutil, "Required parameter 'ioutil' not specified"); + Objects.requireNonNull(http, "Required parameter 'http' not specified"); + Objects.requireNonNull(url, "Required parameter 'url' not specified"); + Objects.requireNonNull(context, "Required parameter 'context' not specified"); + Objects.requireNonNull(allowEmpty, "Required parameter 'allowEmpty' not specified"); + WebClientRequestBuilder webClientRequestBuilder = testQueryParameterCollectionFormatRequestBuilder(pipe, ioutil, http, url, context, allowEmpty, language); + return testQueryParameterCollectionFormatSubmit(webClientRequestBuilder, pipe, ioutil, http, url, context, allowEmpty, language); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testQueryParameterCollectionFormat operation. + * Optional customization point for subclasses. + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param allowEmpty (required) + * @param language (optional + * @return WebClientRequestBuilder for testQueryParameterCollectionFormat + */ + protected WebClientRequestBuilder testQueryParameterCollectionFormatRequestBuilder(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("PUT"); + + List queryParams = new ArrayList<>(); + queryParams.addAll(ApiClient.parameterToPairs("pipes", "pipe", pipe)); + queryParams.addAll(ApiClient.parameterToPairs("csv", "ioutil", ioutil)); + queryParams.addAll(ApiClient.parameterToPairs("ssv", "http", http)); + queryParams.addAll(ApiClient.parameterToPairs("csv", "url", url)); + queryParams.addAll(ApiClient.parameterToPairs("multi", "context", context)); + queryParams.addAll(ApiClient.parameterToPairs("language", language)); + queryParams.addAll(ApiClient.parameterToPairs("allowEmpty", allowEmpty)); + queryParams.forEach(p -> webClientRequestBuilder.queryParam(p.getName(), p.getValue())); + + webClientRequestBuilder.path("/fake/test-query-parameters"); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testQueryParameterCollectionFormat operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param allowEmpty (required) + * @param language (optional + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testQueryParameterCollectionFormatSubmit(WebClientRequestBuilder webClientRequestBuilder, List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_testQueryParameterCollectionFormat, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 00000000000..83e7415b6f4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -0,0 +1,35 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.ApiResponse; +import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public interface FakeClassnameTags123Api { + + /** + * To test class name in snake case + * To test class name in snake case + * @param client client model (required) + * @return {@code ApiResponse} + */ + ApiResponse testClassname(Client client); + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java new file mode 100644 index 00000000000..7af86ce4c52 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java @@ -0,0 +1,97 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.util.Objects; +import org.openapitools.client.ApiResponse; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.helidon.common.GenericType; +import io.helidon.common.http.MediaType; +import io.helidon.common.reactive.Single; +import io.helidon.config.Config; +import io.helidon.media.common.MediaSupport; + +import io.helidon.media.jackson.JacksonSupport; +import io.helidon.webclient.WebClientRequestBuilder; +import io.helidon.webclient.WebClientResponse; + +import org.openapitools.client.ApiClient; + +import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public class FakeClassnameTags123ApiImpl implements FakeClassnameTags123Api { + + private final ApiClient apiClient; + + protected static final GenericType RESPONSE_TYPE_testClassname = ResponseType.create(Client.class); + + /** + * Creates a new instance of FakeClassnameTags123ApiImpl initialized with the specified {@link ApiClient}. + * + */ + public static FakeClassnameTags123ApiImpl create(ApiClient apiClient) { + return new FakeClassnameTags123ApiImpl(apiClient); + } + + protected FakeClassnameTags123ApiImpl(ApiClient apiClient) { + this.apiClient = apiClient; + } + + @Override + public ApiResponse testClassname(Client client) { + Objects.requireNonNull(client, "Required parameter 'client' not specified"); + WebClientRequestBuilder webClientRequestBuilder = testClassnameRequestBuilder(client); + return testClassnameSubmit(webClientRequestBuilder, client); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testClassname operation. + * Optional customization point for subclasses. + * + * @param client client model (required) + * @return WebClientRequestBuilder for testClassname + */ + protected WebClientRequestBuilder testClassnameRequestBuilder(Client client) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("PATCH"); + + webClientRequestBuilder.path("/fake_classname_test"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testClassname operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param client client model (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testClassnameSubmit(WebClientRequestBuilder webClientRequestBuilder, Client client) { + Single webClientResponse = webClientRequestBuilder.submit(client); + return ApiResponse.create(RESPONSE_TYPE_testClassname, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 00000000000..a333b194268 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,111 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.ApiResponse; +import java.io.File; +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import java.util.Set; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public interface PetApi { + + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return {@code ApiResponse} + */ + ApiResponse addPet(Pet pet); + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return {@code ApiResponse} + */ + ApiResponse deletePet(Long petId, String apiKey); + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return {@code ApiResponse>} + */ + ApiResponse> findPetsByStatus(List status); + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return {@code ApiResponse>} + * @deprecated + */ + @Deprecated + ApiResponse> findPetsByTags(Set tags); + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return {@code ApiResponse} + */ + ApiResponse getPetById(Long petId); + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return {@code ApiResponse} + */ + ApiResponse updatePet(Pet pet); + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return {@code ApiResponse} + */ + ApiResponse updatePetWithForm(Long petId, String name, String status); + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @return {@code ApiResponse} + */ + ApiResponse uploadFile(Long petId, String additionalMetadata, File _file); + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return {@code ApiResponse} + */ + ApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata); + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/PetApiImpl.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/PetApiImpl.java new file mode 100644 index 00000000000..00cefb142b8 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/PetApiImpl.java @@ -0,0 +1,463 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.util.Objects; +import org.openapitools.client.ApiResponse; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.helidon.common.GenericType; +import io.helidon.common.http.MediaType; +import io.helidon.common.reactive.Single; +import io.helidon.config.Config; +import io.helidon.media.common.MediaSupport; + +import io.helidon.media.jackson.JacksonSupport; +import io.helidon.webclient.WebClientRequestBuilder; +import io.helidon.webclient.WebClientResponse; + +import org.openapitools.client.ApiClient; + +import java.io.File; +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import java.util.Set; +import java.util.ArrayList; +import org.openapitools.client.Pair; +import java.util.StringJoiner; +import io.helidon.webclient.WebClientRequestHeaders; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public class PetApiImpl implements PetApi { + + private final ApiClient apiClient; + + protected static final GenericType RESPONSE_TYPE_addPet = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_deletePet = ResponseType.create(Void.class); + protected static final GenericType> RESPONSE_TYPE_findPetsByStatus = ResponseType.create(List.class, Pet.class); + protected static final GenericType> RESPONSE_TYPE_findPetsByTags = ResponseType.create(List.class, Pet.class); + protected static final GenericType RESPONSE_TYPE_getPetById = ResponseType.create(Pet.class); + protected static final GenericType RESPONSE_TYPE_updatePet = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_updatePetWithForm = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_uploadFile = ResponseType.create(ModelApiResponse.class); + protected static final GenericType RESPONSE_TYPE_uploadFileWithRequiredFile = ResponseType.create(ModelApiResponse.class); + + /** + * Creates a new instance of PetApiImpl initialized with the specified {@link ApiClient}. + * + */ + public static PetApiImpl create(ApiClient apiClient) { + return new PetApiImpl(apiClient); + } + + protected PetApiImpl(ApiClient apiClient) { + this.apiClient = apiClient; + } + + @Override + public ApiResponse addPet(Pet pet) { + Objects.requireNonNull(pet, "Required parameter 'pet' not specified"); + WebClientRequestBuilder webClientRequestBuilder = addPetRequestBuilder(pet); + return addPetSubmit(webClientRequestBuilder, pet); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the addPet operation. + * Optional customization point for subclasses. + * + * @param pet Pet object that needs to be added to the store (required) + * @return WebClientRequestBuilder for addPet + */ + protected WebClientRequestBuilder addPetRequestBuilder(Pet pet) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/pet"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the addPet operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param pet Pet object that needs to be added to the store (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse addPetSubmit(WebClientRequestBuilder webClientRequestBuilder, Pet pet) { + Single webClientResponse = webClientRequestBuilder.submit(pet); + return ApiResponse.create(RESPONSE_TYPE_addPet, webClientResponse); + } + + @Override + public ApiResponse deletePet(Long petId, String apiKey) { + Objects.requireNonNull(petId, "Required parameter 'petId' not specified"); + WebClientRequestBuilder webClientRequestBuilder = deletePetRequestBuilder(petId, apiKey); + return deletePetSubmit(webClientRequestBuilder, petId, apiKey); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the deletePet operation. + * Optional customization point for subclasses. + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return WebClientRequestBuilder for deletePet + */ + protected WebClientRequestBuilder deletePetRequestBuilder(Long petId, String apiKey) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("DELETE"); + + WebClientRequestHeaders headers = webClientRequestBuilder.headers(); + if (apiKey != null) { + headers.put("api_key", apiKey); + } + + String path = "/pet/{petId}" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + webClientRequestBuilder.path(path); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the deletePet operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse deletePetSubmit(WebClientRequestBuilder webClientRequestBuilder, Long petId, String apiKey) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_deletePet, webClientResponse); + } + + @Override + public ApiResponse> findPetsByStatus(List status) { + Objects.requireNonNull(status, "Required parameter 'status' not specified"); + WebClientRequestBuilder webClientRequestBuilder = findPetsByStatusRequestBuilder(status); + return findPetsByStatusSubmit(webClientRequestBuilder, status); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the findPetsByStatus operation. + * Optional customization point for subclasses. + * + * @param status Status values that need to be considered for filter (required) + * @return WebClientRequestBuilder for findPetsByStatus + */ + protected WebClientRequestBuilder findPetsByStatusRequestBuilder(List status) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + List queryParams = new ArrayList<>(); + queryParams.addAll(ApiClient.parameterToPairs("csv", "status", status)); + queryParams.forEach(p -> webClientRequestBuilder.queryParam(p.getName(), p.getValue())); + + webClientRequestBuilder.path("/pet/findByStatus"); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the findPetsByStatus operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param status Status values that need to be considered for filter (required) + * @return {@code ApiResponse>} for the submitted request + */ + protected ApiResponse> findPetsByStatusSubmit(WebClientRequestBuilder webClientRequestBuilder, List status) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_findPetsByStatus, webClientResponse); + } + + @Deprecated + @Override + public ApiResponse> findPetsByTags(Set tags) { + Objects.requireNonNull(tags, "Required parameter 'tags' not specified"); + WebClientRequestBuilder webClientRequestBuilder = findPetsByTagsRequestBuilder(tags); + return findPetsByTagsSubmit(webClientRequestBuilder, tags); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the findPetsByTags operation. + * Optional customization point for subclasses. + * + * @param tags Tags to filter by (required) + * @return WebClientRequestBuilder for findPetsByTags + */ + protected WebClientRequestBuilder findPetsByTagsRequestBuilder(Set tags) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + List queryParams = new ArrayList<>(); + queryParams.addAll(ApiClient.parameterToPairs("csv", "tags", tags)); + queryParams.forEach(p -> webClientRequestBuilder.queryParam(p.getName(), p.getValue())); + + webClientRequestBuilder.path("/pet/findByTags"); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the findPetsByTags operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param tags Tags to filter by (required) + * @return {@code ApiResponse>} for the submitted request + */ + protected ApiResponse> findPetsByTagsSubmit(WebClientRequestBuilder webClientRequestBuilder, Set tags) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_findPetsByTags, webClientResponse); + } + + @Override + public ApiResponse getPetById(Long petId) { + Objects.requireNonNull(petId, "Required parameter 'petId' not specified"); + WebClientRequestBuilder webClientRequestBuilder = getPetByIdRequestBuilder(petId); + return getPetByIdSubmit(webClientRequestBuilder, petId); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the getPetById operation. + * Optional customization point for subclasses. + * + * @param petId ID of pet to return (required) + * @return WebClientRequestBuilder for getPetById + */ + protected WebClientRequestBuilder getPetByIdRequestBuilder(Long petId) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + String path = "/pet/{petId}" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + webClientRequestBuilder.path(path); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the getPetById operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param petId ID of pet to return (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse getPetByIdSubmit(WebClientRequestBuilder webClientRequestBuilder, Long petId) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_getPetById, webClientResponse); + } + + @Override + public ApiResponse updatePet(Pet pet) { + Objects.requireNonNull(pet, "Required parameter 'pet' not specified"); + WebClientRequestBuilder webClientRequestBuilder = updatePetRequestBuilder(pet); + return updatePetSubmit(webClientRequestBuilder, pet); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the updatePet operation. + * Optional customization point for subclasses. + * + * @param pet Pet object that needs to be added to the store (required) + * @return WebClientRequestBuilder for updatePet + */ + protected WebClientRequestBuilder updatePetRequestBuilder(Pet pet) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("PUT"); + + webClientRequestBuilder.path("/pet"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the updatePet operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param pet Pet object that needs to be added to the store (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse updatePetSubmit(WebClientRequestBuilder webClientRequestBuilder, Pet pet) { + Single webClientResponse = webClientRequestBuilder.submit(pet); + return ApiResponse.create(RESPONSE_TYPE_updatePet, webClientResponse); + } + + @Override + public ApiResponse updatePetWithForm(Long petId, String name, String status) { + Objects.requireNonNull(petId, "Required parameter 'petId' not specified"); + WebClientRequestBuilder webClientRequestBuilder = updatePetWithFormRequestBuilder(petId, name, status); + return updatePetWithFormSubmit(webClientRequestBuilder, petId, name, status); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the updatePetWithForm operation. + * Optional customization point for subclasses. + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return WebClientRequestBuilder for updatePetWithForm + */ + protected WebClientRequestBuilder updatePetWithFormRequestBuilder(Long petId, String name, String status) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + String path = "/pet/{petId}" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + webClientRequestBuilder.path(path); + webClientRequestBuilder.contentType(MediaType.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the updatePetWithForm operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse updatePetWithFormSubmit(WebClientRequestBuilder webClientRequestBuilder, Long petId, String name, String status) { + String formParams = new StringJoiner("&") + .add("name=" + name) + .add("status=" + status) + .toString(); + Single webClientResponse = webClientRequestBuilder.submit(formParams); + return ApiResponse.create(RESPONSE_TYPE_updatePetWithForm, webClientResponse); + } + + @Override + public ApiResponse uploadFile(Long petId, String additionalMetadata, File _file) { + Objects.requireNonNull(petId, "Required parameter 'petId' not specified"); + WebClientRequestBuilder webClientRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, _file); + return uploadFileSubmit(webClientRequestBuilder, petId, additionalMetadata, _file); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the uploadFile operation. + * Optional customization point for subclasses. + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @return WebClientRequestBuilder for uploadFile + */ + protected WebClientRequestBuilder uploadFileRequestBuilder(Long petId, String additionalMetadata, File _file) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + String path = "/pet/{petId}/uploadImage" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + webClientRequestBuilder.path(path); + webClientRequestBuilder.contentType(MediaType.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the uploadFile operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse uploadFileSubmit(WebClientRequestBuilder webClientRequestBuilder, Long petId, String additionalMetadata, File _file) { + String formParams = new StringJoiner("&") + .add("additionalMetadata=" + additionalMetadata) + .add("file=" + _file) + .toString(); + Single webClientResponse = webClientRequestBuilder.submit(formParams); + return ApiResponse.create(RESPONSE_TYPE_uploadFile, webClientResponse); + } + + @Override + public ApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) { + Objects.requireNonNull(petId, "Required parameter 'petId' not specified"); + Objects.requireNonNull(requiredFile, "Required parameter 'requiredFile' not specified"); + WebClientRequestBuilder webClientRequestBuilder = uploadFileWithRequiredFileRequestBuilder(petId, requiredFile, additionalMetadata); + return uploadFileWithRequiredFileSubmit(webClientRequestBuilder, petId, requiredFile, additionalMetadata); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the uploadFileWithRequiredFile operation. + * Optional customization point for subclasses. + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return WebClientRequestBuilder for uploadFileWithRequiredFile + */ + protected WebClientRequestBuilder uploadFileWithRequiredFileRequestBuilder(Long petId, File requiredFile, String additionalMetadata) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + String path = "/fake/{petId}/uploadImageWithRequiredFile" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + webClientRequestBuilder.path(path); + webClientRequestBuilder.contentType(MediaType.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the uploadFileWithRequiredFile operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse uploadFileWithRequiredFileSubmit(WebClientRequestBuilder webClientRequestBuilder, Long petId, File requiredFile, String additionalMetadata) { + String formParams = new StringJoiner("&") + .add("additionalMetadata=" + additionalMetadata) + .add("requiredFile=" + requiredFile) + .toString(); + Single webClientResponse = webClientRequestBuilder.submit(formParams); + return ApiResponse.create(RESPONSE_TYPE_uploadFileWithRequiredFile, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/ResponseType.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/ResponseType.java new file mode 100644 index 00000000000..74f7f4d9a8e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/ResponseType.java @@ -0,0 +1,43 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; + +import io.helidon.common.GenericType; + +class ResponseType { + + static GenericType create(Type rawType, Type... typeParams) { + return typeParams.length == 0 + ? GenericType.create(rawType) + : GenericType.create(new ParameterizedType() { + + @Override + public Type[] getActualTypeArguments() { + return typeParams; + } + + @Override + public Type getRawType() { + return rawType; + } + + @Override + public Type getOwnerType() { + return null; + } + }); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 00000000000..b7ad3ea6e83 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/StoreApi.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.ApiResponse; +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.Order; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public interface StoreApi { + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return {@code ApiResponse} + */ + ApiResponse deleteOrder(String orderId); + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return {@code ApiResponse>} + */ + ApiResponse> getInventory(); + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return {@code ApiResponse} + */ + ApiResponse getOrderById(Long orderId); + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return {@code ApiResponse} + */ + ApiResponse placeOrder(Order order); + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/StoreApiImpl.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/StoreApiImpl.java new file mode 100644 index 00000000000..2b039dd7ba3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/StoreApiImpl.java @@ -0,0 +1,212 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.util.Objects; +import org.openapitools.client.ApiResponse; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.helidon.common.GenericType; +import io.helidon.common.http.MediaType; +import io.helidon.common.reactive.Single; +import io.helidon.config.Config; +import io.helidon.media.common.MediaSupport; + +import io.helidon.media.jackson.JacksonSupport; +import io.helidon.webclient.WebClientRequestBuilder; +import io.helidon.webclient.WebClientResponse; + +import org.openapitools.client.ApiClient; + +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.Order; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public class StoreApiImpl implements StoreApi { + + private final ApiClient apiClient; + + protected static final GenericType RESPONSE_TYPE_deleteOrder = ResponseType.create(Void.class); + protected static final GenericType> RESPONSE_TYPE_getInventory = ResponseType.create(Map.class, String.class, Integer.class); + protected static final GenericType RESPONSE_TYPE_getOrderById = ResponseType.create(Order.class); + protected static final GenericType RESPONSE_TYPE_placeOrder = ResponseType.create(Order.class); + + /** + * Creates a new instance of StoreApiImpl initialized with the specified {@link ApiClient}. + * + */ + public static StoreApiImpl create(ApiClient apiClient) { + return new StoreApiImpl(apiClient); + } + + protected StoreApiImpl(ApiClient apiClient) { + this.apiClient = apiClient; + } + + @Override + public ApiResponse deleteOrder(String orderId) { + Objects.requireNonNull(orderId, "Required parameter 'orderId' not specified"); + WebClientRequestBuilder webClientRequestBuilder = deleteOrderRequestBuilder(orderId); + return deleteOrderSubmit(webClientRequestBuilder, orderId); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the deleteOrder operation. + * Optional customization point for subclasses. + * + * @param orderId ID of the order that needs to be deleted (required) + * @return WebClientRequestBuilder for deleteOrder + */ + protected WebClientRequestBuilder deleteOrderRequestBuilder(String orderId) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("DELETE"); + + String path = "/store/order/{order_id}" + .replace("{order_id}", ApiClient.urlEncode(orderId)); + webClientRequestBuilder.path(path); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the deleteOrder operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param orderId ID of the order that needs to be deleted (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse deleteOrderSubmit(WebClientRequestBuilder webClientRequestBuilder, String orderId) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_deleteOrder, webClientResponse); + } + + @Override + public ApiResponse> getInventory() { + WebClientRequestBuilder webClientRequestBuilder = getInventoryRequestBuilder(); + return getInventorySubmit(webClientRequestBuilder); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the getInventory operation. + * Optional customization point for subclasses. + * + * @return WebClientRequestBuilder for getInventory + */ + protected WebClientRequestBuilder getInventoryRequestBuilder() { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + webClientRequestBuilder.path("/store/inventory"); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the getInventory operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @return {@code ApiResponse>} for the submitted request + */ + protected ApiResponse> getInventorySubmit(WebClientRequestBuilder webClientRequestBuilder) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_getInventory, webClientResponse); + } + + @Override + public ApiResponse getOrderById(Long orderId) { + Objects.requireNonNull(orderId, "Required parameter 'orderId' not specified"); + WebClientRequestBuilder webClientRequestBuilder = getOrderByIdRequestBuilder(orderId); + return getOrderByIdSubmit(webClientRequestBuilder, orderId); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the getOrderById operation. + * Optional customization point for subclasses. + * + * @param orderId ID of pet that needs to be fetched (required) + * @return WebClientRequestBuilder for getOrderById + */ + protected WebClientRequestBuilder getOrderByIdRequestBuilder(Long orderId) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + String path = "/store/order/{order_id}" + .replace("{order_id}", ApiClient.urlEncode(orderId.toString())); + webClientRequestBuilder.path(path); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the getOrderById operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param orderId ID of pet that needs to be fetched (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse getOrderByIdSubmit(WebClientRequestBuilder webClientRequestBuilder, Long orderId) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_getOrderById, webClientResponse); + } + + @Override + public ApiResponse placeOrder(Order order) { + Objects.requireNonNull(order, "Required parameter 'order' not specified"); + WebClientRequestBuilder webClientRequestBuilder = placeOrderRequestBuilder(order); + return placeOrderSubmit(webClientRequestBuilder, order); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the placeOrder operation. + * Optional customization point for subclasses. + * + * @param order order placed for purchasing the pet (required) + * @return WebClientRequestBuilder for placeOrder + */ + protected WebClientRequestBuilder placeOrderRequestBuilder(Order order) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/store/order"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the placeOrder operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param order order placed for purchasing the pet (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse placeOrderSubmit(WebClientRequestBuilder webClientRequestBuilder, Order order) { + Single webClientResponse = webClientRequestBuilder.submit(order); + return ApiResponse.create(RESPONSE_TYPE_placeOrder, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 00000000000..b8f4c06564f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,93 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.openapitools.client.ApiResponse; +import java.util.List; +import java.util.Map; +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public interface UserApi { + + /** + * Create user + * This can only be done by the logged in user. + * @param user Created user object (required) + * @return {@code ApiResponse} + */ + ApiResponse createUser(User user); + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @return {@code ApiResponse} + */ + ApiResponse createUsersWithArrayInput(List user); + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @return {@code ApiResponse} + */ + ApiResponse createUsersWithListInput(List user); + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return {@code ApiResponse} + */ + ApiResponse deleteUser(String username); + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return {@code ApiResponse} + */ + ApiResponse getUserByName(String username); + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return {@code ApiResponse} + */ + ApiResponse loginUser(String username, String password); + + /** + * Logs out current logged in user session + * + * @return {@code ApiResponse} + */ + ApiResponse logoutUser(); + + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return {@code ApiResponse} + */ + ApiResponse updateUser(String username, User user); + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/UserApiImpl.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/UserApiImpl.java new file mode 100644 index 00000000000..0b51b0eb02f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/api/UserApiImpl.java @@ -0,0 +1,383 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import java.util.Objects; +import org.openapitools.client.ApiResponse; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.helidon.common.GenericType; +import io.helidon.common.http.MediaType; +import io.helidon.common.reactive.Single; +import io.helidon.config.Config; +import io.helidon.media.common.MediaSupport; + +import io.helidon.media.jackson.JacksonSupport; +import io.helidon.webclient.WebClientRequestBuilder; +import io.helidon.webclient.WebClientResponse; + +import org.openapitools.client.ApiClient; + +import java.util.List; +import java.util.Map; +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; +import java.util.ArrayList; +import org.openapitools.client.Pair; + +/** + * OpenAPI Petstore + * + *

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + */ +public class UserApiImpl implements UserApi { + + private final ApiClient apiClient; + + protected static final GenericType RESPONSE_TYPE_createUser = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_createUsersWithArrayInput = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_createUsersWithListInput = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_deleteUser = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_getUserByName = ResponseType.create(User.class); + protected static final GenericType RESPONSE_TYPE_loginUser = ResponseType.create(String.class); + protected static final GenericType RESPONSE_TYPE_logoutUser = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_updateUser = ResponseType.create(Void.class); + + /** + * Creates a new instance of UserApiImpl initialized with the specified {@link ApiClient}. + * + */ + public static UserApiImpl create(ApiClient apiClient) { + return new UserApiImpl(apiClient); + } + + protected UserApiImpl(ApiClient apiClient) { + this.apiClient = apiClient; + } + + @Override + public ApiResponse createUser(User user) { + Objects.requireNonNull(user, "Required parameter 'user' not specified"); + WebClientRequestBuilder webClientRequestBuilder = createUserRequestBuilder(user); + return createUserSubmit(webClientRequestBuilder, user); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the createUser operation. + * Optional customization point for subclasses. + * + * @param user Created user object (required) + * @return WebClientRequestBuilder for createUser + */ + protected WebClientRequestBuilder createUserRequestBuilder(User user) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/user"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the createUser operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param user Created user object (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse createUserSubmit(WebClientRequestBuilder webClientRequestBuilder, User user) { + Single webClientResponse = webClientRequestBuilder.submit(user); + return ApiResponse.create(RESPONSE_TYPE_createUser, webClientResponse); + } + + @Override + public ApiResponse createUsersWithArrayInput(List user) { + Objects.requireNonNull(user, "Required parameter 'user' not specified"); + WebClientRequestBuilder webClientRequestBuilder = createUsersWithArrayInputRequestBuilder(user); + return createUsersWithArrayInputSubmit(webClientRequestBuilder, user); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the createUsersWithArrayInput operation. + * Optional customization point for subclasses. + * + * @param user List of user object (required) + * @return WebClientRequestBuilder for createUsersWithArrayInput + */ + protected WebClientRequestBuilder createUsersWithArrayInputRequestBuilder(List user) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/user/createWithArray"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the createUsersWithArrayInput operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param user List of user object (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse createUsersWithArrayInputSubmit(WebClientRequestBuilder webClientRequestBuilder, List user) { + Single webClientResponse = webClientRequestBuilder.submit(user); + return ApiResponse.create(RESPONSE_TYPE_createUsersWithArrayInput, webClientResponse); + } + + @Override + public ApiResponse createUsersWithListInput(List user) { + Objects.requireNonNull(user, "Required parameter 'user' not specified"); + WebClientRequestBuilder webClientRequestBuilder = createUsersWithListInputRequestBuilder(user); + return createUsersWithListInputSubmit(webClientRequestBuilder, user); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the createUsersWithListInput operation. + * Optional customization point for subclasses. + * + * @param user List of user object (required) + * @return WebClientRequestBuilder for createUsersWithListInput + */ + protected WebClientRequestBuilder createUsersWithListInputRequestBuilder(List user) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("POST"); + + webClientRequestBuilder.path("/user/createWithList"); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the createUsersWithListInput operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param user List of user object (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse createUsersWithListInputSubmit(WebClientRequestBuilder webClientRequestBuilder, List user) { + Single webClientResponse = webClientRequestBuilder.submit(user); + return ApiResponse.create(RESPONSE_TYPE_createUsersWithListInput, webClientResponse); + } + + @Override + public ApiResponse deleteUser(String username) { + Objects.requireNonNull(username, "Required parameter 'username' not specified"); + WebClientRequestBuilder webClientRequestBuilder = deleteUserRequestBuilder(username); + return deleteUserSubmit(webClientRequestBuilder, username); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the deleteUser operation. + * Optional customization point for subclasses. + * + * @param username The name that needs to be deleted (required) + * @return WebClientRequestBuilder for deleteUser + */ + protected WebClientRequestBuilder deleteUserRequestBuilder(String username) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("DELETE"); + + String path = "/user/{username}" + .replace("{username}", ApiClient.urlEncode(username)); + webClientRequestBuilder.path(path); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the deleteUser operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param username The name that needs to be deleted (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse deleteUserSubmit(WebClientRequestBuilder webClientRequestBuilder, String username) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_deleteUser, webClientResponse); + } + + @Override + public ApiResponse getUserByName(String username) { + Objects.requireNonNull(username, "Required parameter 'username' not specified"); + WebClientRequestBuilder webClientRequestBuilder = getUserByNameRequestBuilder(username); + return getUserByNameSubmit(webClientRequestBuilder, username); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the getUserByName operation. + * Optional customization point for subclasses. + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return WebClientRequestBuilder for getUserByName + */ + protected WebClientRequestBuilder getUserByNameRequestBuilder(String username) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + String path = "/user/{username}" + .replace("{username}", ApiClient.urlEncode(username)); + webClientRequestBuilder.path(path); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the getUserByName operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse getUserByNameSubmit(WebClientRequestBuilder webClientRequestBuilder, String username) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_getUserByName, webClientResponse); + } + + @Override + public ApiResponse loginUser(String username, String password) { + Objects.requireNonNull(username, "Required parameter 'username' not specified"); + Objects.requireNonNull(password, "Required parameter 'password' not specified"); + WebClientRequestBuilder webClientRequestBuilder = loginUserRequestBuilder(username, password); + return loginUserSubmit(webClientRequestBuilder, username, password); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the loginUser operation. + * Optional customization point for subclasses. + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return WebClientRequestBuilder for loginUser + */ + protected WebClientRequestBuilder loginUserRequestBuilder(String username, String password) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + List queryParams = new ArrayList<>(); + queryParams.addAll(ApiClient.parameterToPairs("username", username)); + queryParams.addAll(ApiClient.parameterToPairs("password", password)); + queryParams.forEach(p -> webClientRequestBuilder.queryParam(p.getName(), p.getValue())); + + webClientRequestBuilder.path("/user/login"); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the loginUser operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse loginUserSubmit(WebClientRequestBuilder webClientRequestBuilder, String username, String password) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_loginUser, webClientResponse); + } + + @Override + public ApiResponse logoutUser() { + WebClientRequestBuilder webClientRequestBuilder = logoutUserRequestBuilder(); + return logoutUserSubmit(webClientRequestBuilder); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the logoutUser operation. + * Optional customization point for subclasses. + * + * @return WebClientRequestBuilder for logoutUser + */ + protected WebClientRequestBuilder logoutUserRequestBuilder() { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("GET"); + + webClientRequestBuilder.path("/user/logout"); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the logoutUser operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse logoutUserSubmit(WebClientRequestBuilder webClientRequestBuilder) { + Single webClientResponse = webClientRequestBuilder.submit(); + return ApiResponse.create(RESPONSE_TYPE_logoutUser, webClientResponse); + } + + @Override + public ApiResponse updateUser(String username, User user) { + Objects.requireNonNull(username, "Required parameter 'username' not specified"); + Objects.requireNonNull(user, "Required parameter 'user' not specified"); + WebClientRequestBuilder webClientRequestBuilder = updateUserRequestBuilder(username, user); + return updateUserSubmit(webClientRequestBuilder, username, user); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the updateUser operation. + * Optional customization point for subclasses. + * + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return WebClientRequestBuilder for updateUser + */ + protected WebClientRequestBuilder updateUserRequestBuilder(String username, User user) { + WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() + .method("PUT"); + + String path = "/user/{username}" + .replace("{username}", ApiClient.urlEncode(username)); + webClientRequestBuilder.path(path); + webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the updateUser operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse updateUserSubmit(WebClientRequestBuilder webClientRequestBuilder, String username, User user) { + Single webClientResponse = webClientRequestBuilder.submit(user); + return ApiResponse.create(RESPONSE_TYPE_updateUser, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..abc3d296fa3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,108 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + + + + +public class AdditionalPropertiesClass { + + private Map mapProperty = null; + + private Map> mapOfMapProperty = null; + + /** + * Get mapProperty + * @return mapProperty + **/ + public Map getMapProperty() { + return mapProperty; + } + + /** + * Set mapProperty + **/ + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + /** + * Set mapOfMapProperty + **/ + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java new file mode 100644 index 00000000000..cb7b8b0a681 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -0,0 +1,97 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.SingleRefType; + + + + +public class AllOfWithSingleRef { + + private String username; + + private SingleRefType singleRefType; + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + **/ + public void setUsername(String username) { + this.username = username; + } + + public AllOfWithSingleRef username(String username) { + this.username = username; + return this; + } + + /** + * Get singleRefType + * @return singleRefType + **/ + public SingleRefType getSingleRefType() { + return singleRefType; + } + + /** + * Set singleRefType + **/ + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 00000000000..36ecf9c54f6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Animal.java @@ -0,0 +1,101 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import org.openapitools.client.model.Dog; + + + + +public class Animal { + + private String className; + + private String color = "red"; + + /** + * Get className + * @return className + **/ + public String getClassName() { + return className; + } + + /** + * Set className + **/ + public void setClassName(String className) { + this.className = className; + } + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get color + * @return color + **/ + public String getColor() { + return color; + } + + /** + * Set color + **/ + public void setColor(String color) { + this.color = color; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..d451b999d86 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,81 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + + +public class ArrayOfArrayOfNumberOnly { + + private List> arrayArrayNumber = null; + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + /** + * Set arrayArrayNumber + **/ + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..3b64bf9e879 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,81 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + + +public class ArrayOfNumberOnly { + + private List arrayNumber = null; + + /** + * Get arrayNumber + * @return arrayNumber + **/ + public List getArrayNumber() { + return arrayNumber; + } + + /** + * Set arrayNumber + **/ + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + this.arrayNumber.add(arrayNumberItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 00000000000..ab1f6d17917 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -0,0 +1,137 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; + + + + +public class ArrayTest { + + private List arrayOfString = null; + + private List> arrayArrayOfInteger = null; + + private List> arrayArrayOfModel = null; + + /** + * Get arrayOfString + * @return arrayOfString + **/ + public List getArrayOfString() { + return arrayOfString; + } + + /** + * Set arrayOfString + **/ + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + /** + * Set arrayArrayOfInteger + **/ + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + /** + * Set arrayArrayOfModel + **/ + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 00000000000..f6d3fde93d4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Capitalization.java @@ -0,0 +1,191 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Capitalization { + + private String smallCamel; + + private String capitalCamel; + + private String smallSnake; + + private String capitalSnake; + + private String scAETHFlowPoints; + + /** + * Name of the pet + **/ + private String ATT_NAME; + + /** + * Get smallCamel + * @return smallCamel + **/ + public String getSmallCamel() { + return smallCamel; + } + + /** + * Set smallCamel + **/ + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + public String getCapitalCamel() { + return capitalCamel; + } + + /** + * Set capitalCamel + **/ + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + public String getSmallSnake() { + return smallSnake; + } + + /** + * Set smallSnake + **/ + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + public String getCapitalSnake() { + return capitalSnake; + } + + /** + * Set capitalSnake + **/ + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + /** + * Set scAETHFlowPoints + **/ + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + public String getATTNAME() { + return ATT_NAME; + } + + /** + * Set ATT_NAME + **/ + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 00000000000..be9c6954561 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,77 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; + + + + +public class Cat extends Animal { + + private Boolean declawed; + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + /** + * Set declawed + **/ + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/CatAllOf.java new file mode 100644 index 00000000000..2b54aad5ba3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class CatAllOf { + + private Boolean declawed; + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + /** + * Set declawed + **/ + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 00000000000..8da99011104 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Category { + + private Long id; + + private String name = "default-name"; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Category name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 00000000000..de44db959bc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ClassModel.java @@ -0,0 +1,76 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Model for testing model with \"_class\" property + **/ + +public class ClassModel { + + private String propertyClass; + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + **/ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 00000000000..0ad715df8de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Client.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Client { + + private String client; + + /** + * Get client + * @return client + **/ + public String getClient() { + return client; + } + + /** + * Set client + **/ + public void setClient(String client) { + this.client = client; + } + + public Client client(String client) { + this.client = client; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/DeprecatedObject.java new file mode 100644 index 00000000000..aaaed8e7f3e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class DeprecatedObject { + + private String name; + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public DeprecatedObject name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 00000000000..069dab8392d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,77 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; + + + + +public class Dog extends Animal { + + private String breed; + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + /** + * Set breed + **/ + public void setBreed(String breed) { + this.breed = breed; + } + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/DogAllOf.java new file mode 100644 index 00000000000..5dc63ce0380 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class DogAllOf { + + private String breed; + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + /** + * Set breed + **/ + public void setBreed(String breed) { + this.breed = breed; + } + + public DogAllOf breed(String breed) { + this.breed = breed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 00000000000..1a9c48c72cd --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -0,0 +1,145 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; + + + + +public class EnumArrays { + +public enum JustSymbolEnum { + + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$")); + + String value; + + JustSymbolEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private JustSymbolEnum justSymbol; + +public enum ArrayEnumEnum { + + FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); + + String value; + + ArrayEnumEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private List arrayEnum = null; + + /** + * Get justSymbol + * @return justSymbol + **/ + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + /** + * Set justSymbol + **/ + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + public List getArrayEnum() { + return arrayEnum; + } + + /** + * Set arrayEnum + **/ + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + this.arrayEnum.add(arrayEnumItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 00000000000..eed52272f70 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumClass.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String text) { + for (EnumClass b : EnumClass.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 00000000000..e234097abc2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,326 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; + + + + +public class EnumTest { + +public enum EnumStringEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + String value; + + EnumStringEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private EnumStringEnum enumString; + +public enum EnumStringRequiredEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + String value; + + EnumStringRequiredEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private EnumStringRequiredEnum enumStringRequired; + +public enum EnumIntegerEnum { + + NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1)); + + Integer value; + + EnumIntegerEnum (Integer v) { + value = v; + } + + public Integer value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private EnumIntegerEnum enumInteger; + +public enum EnumNumberEnum { + + NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + Double value; + + EnumNumberEnum (Double v) { + value = v; + } + + public Double value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private EnumNumberEnum enumNumber; + + private OuterEnum outerEnum; + + private OuterEnumInteger outerEnumInteger; + + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + /** + * Get enumString + * @return enumString + **/ + public EnumStringEnum getEnumString() { + return enumString; + } + + /** + * Set enumString + **/ + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + /** + * Set enumStringRequired + **/ + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + /** + * Set enumInteger + **/ + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + /** + * Set enumNumber + **/ + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + public OuterEnum getOuterEnum() { + return outerEnum; + } + + /** + * Set outerEnum + **/ + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + /** + * Set outerEnumInteger + **/ + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + /** + * Set outerEnumDefaultValue + **/ + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + /** + * Set outerEnumIntegerDefaultValue + **/ + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 00000000000..dd3716a2b12 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,104 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ModelFile; + + + + +public class FileSchemaTestClass { + + private ModelFile _file; + + private List files = null; + + /** + * Get _file + * @return _file + **/ + public ModelFile getFile() { + return _file; + } + + /** + * Set _file + **/ + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; + return this; + } + + /** + * Get files + * @return files + **/ + public List getFiles() { + return files; + } + + /** + * Set files + **/ + public void setFiles(List files) { + this.files = files; + } + + public FileSchemaTestClass files(List files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + this.files.add(filesItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Foo.java new file mode 100644 index 00000000000..fcafaf7682c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Foo.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Foo { + + private String bar = "bar"; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + /** + * Set bar + **/ + public void setBar(String bar) { + this.bar = bar; + } + + public Foo bar(String bar) { + this.bar = bar; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java new file mode 100644 index 00000000000..27971dae916 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Foo; + + + + +public class FooGetDefaultResponse { + + private Foo string; + + /** + * Get string + * @return string + **/ + public Foo getString() { + return string; + } + + /** + * Set string + **/ + public void setString(Foo string) { + this.string = string; + } + + public FooGetDefaultResponse string(Foo string) { + this.string = string; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 00000000000..6f6b62d497c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/FormatTest.java @@ -0,0 +1,439 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; + + + + +public class FormatTest { + + private Integer integer; + + private Integer int32; + + private Long int64; + + private BigDecimal number; + + private Float _float; + + private Double _double; + + private BigDecimal decimal; + + private String string; + + private byte[] _byte; + + private File binary; + + private LocalDate date; + + private OffsetDateTime dateTime; + + private UUID uuid; + + private String password; + + /** + * A string that is a 10 digit number. Can have leading zeros. + **/ + private String patternWithDigits; + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + **/ + private String patternWithDigitsAndDelimiter; + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + public Integer getInteger() { + return integer; + } + + /** + * Set integer + **/ + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + public Integer getInt32() { + return int32; + } + + /** + * Set int32 + **/ + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + public Long getInt64() { + return int64; + } + + /** + * Set int64 + **/ + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + public BigDecimal getNumber() { + return number; + } + + /** + * Set number + **/ + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + public Float getFloat() { + return _float; + } + + /** + * Set _float + **/ + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + public Double getDouble() { + return _double; + } + + /** + * Set _double + **/ + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get decimal + * @return decimal + **/ + public BigDecimal getDecimal() { + return decimal; + } + + /** + * Set decimal + **/ + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTest decimal(BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get string + * @return string + **/ + public String getString() { + return string; + } + + /** + * Set string + **/ + public void setString(String string) { + this.string = string; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + public byte[] getByte() { + return _byte; + } + + /** + * Set _byte + **/ + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get binary + * @return binary + **/ + public File getBinary() { + return binary; + } + + /** + * Set binary + **/ + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest binary(File binary) { + this.binary = binary; + return this; + } + + /** + * Get date + * @return date + **/ + public LocalDate getDate() { + return date; + } + + /** + * Set date + **/ + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Set dateTime + **/ + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + /** + * Set password + **/ + public void setPassword(String password) { + this.password = password; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + **/ + public String getPatternWithDigits() { + return patternWithDigits; + } + + /** + * Set patternWithDigits + **/ + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + public FormatTest patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + /** + * Set patternWithDigitsAndDelimiter + **/ + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..72566c02dde --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class HasOnlyReadOnly { + + private String bar; + + private String foo; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get foo + * @return foo + **/ + public String getFoo() { + return foo; + } + + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 00000000000..48cec9f2dab --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -0,0 +1,80 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; + + + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + **/ + +public class HealthCheckResult { + + private String nullableMessage; + + /** + * Get nullableMessage + * @return nullableMessage + **/ + public String getNullableMessage() { + return nullableMessage; + } + + /** + * Set nullableMessage + **/ + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 00000000000..ec54a8ae421 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/MapTest.java @@ -0,0 +1,185 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + + + + +public class MapTest { + + private Map> mapMapOfString = null; + +public enum InnerEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); + + String value; + + InnerEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private Map mapOfEnumString = null; + + private Map directMap = null; + + private Map indirectMap = null; + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + public Map> getMapMapOfString() { + return mapMapOfString; + } + + /** + * Set mapMapOfString + **/ + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + /** + * Set mapOfEnumString + **/ + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + public Map getDirectMap() { + return directMap; + } + + /** + * Set directMap + **/ + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + public Map getIndirectMap() { + return indirectMap; + } + + /** + * Set indirectMap + **/ + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + this.indirectMap.put(key, indirectMapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..de307d1e286 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,129 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; + + + + +public class MixedPropertiesAndAdditionalPropertiesClass { + + private UUID uuid; + + private OffsetDateTime dateTime; + + private Map map = null; + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Set dateTime + **/ + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get map + * @return map + **/ + public Map getMap() { + return map; + } + + /** + * Set map + **/ + public void setMap(Map map) { + this.map = map; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + this.map.put(key, mapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 00000000000..393f65f83e9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Model200Response.java @@ -0,0 +1,99 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Model for testing model name starting with number + **/ + +public class Model200Response { + + private Integer name; + + private String propertyClass; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + /** + * Set name + **/ + public void setName(Integer name) { + this.name = name; + } + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + **/ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 00000000000..881fc2677d2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -0,0 +1,119 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class ModelApiResponse { + + private Integer code; + + private String type; + + private String message; + + /** + * Get code + * @return code + **/ + public Integer getCode() { + return code; + } + + /** + * Set code + **/ + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * @return type + **/ + public String getType() { + return type; + } + + /** + * Set type + **/ + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * @return message + **/ + public String getMessage() { + return message; + } + + /** + * Set message + **/ + public void setMessage(String message) { + this.message = message; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 00000000000..3c1cf785ea5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,79 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Must be named `File` for test. + **/ + +public class ModelFile { + + /** + * Test capitalization + **/ + private String sourceURI; + + /** + * Test capitalization + * @return sourceURI + **/ + public String getSourceURI() { + return sourceURI; + } + + /** + * Set sourceURI + **/ + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 00000000000..0c2e7ffb39d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class ModelList { + + private String _123list; + + /** + * Get _123list + * @return _123list + **/ + public String get123list() { + return _123list; + } + + /** + * Set _123list + **/ + public void set123list(String _123list) { + this._123list = _123list; + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 00000000000..7d948f62e2c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -0,0 +1,76 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Model for testing reserved words + **/ + +public class ModelReturn { + + private Integer _return; + + /** + * Get _return + * @return _return + **/ + public Integer getReturn() { + return _return; + } + + /** + * Set _return + **/ + public void setReturn(Integer _return) { + this._return = _return; + } + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 00000000000..ba07eb91523 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Name.java @@ -0,0 +1,123 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + +/** + * Model for testing model name same as property name + **/ + +public class Name { + + private Integer name; + + private Integer snakeCase; + + private String property; + + private Integer _123number; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + /** + * Set name + **/ + public void setName(Integer name) { + this.name = name; + } + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + public Integer getSnakeCase() { + return snakeCase; + } + + + /** + * Get property + * @return property + **/ + public String getProperty() { + return property; + } + + /** + * Set property + **/ + public void setProperty(String property) { + this.property = property; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get _123number + * @return _123number + **/ + public Integer get123number() { + return _123number; + } + + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 00000000000..759832f0dd7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/NullableClass.java @@ -0,0 +1,367 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; + + + + +public class NullableClass extends HashMap { + + private Integer integerProp; + + private BigDecimal numberProp; + + private Boolean booleanProp; + + private String stringProp; + + private LocalDate dateProp; + + private OffsetDateTime datetimeProp; + + private List arrayNullableProp = null; + + private List arrayAndItemsNullableProp = null; + + private List arrayItemsNullable = null; + + private Map objectNullableProp = null; + + private Map objectAndItemsNullableProp = null; + + private Map objectItemsNullable = null; + + /** + * Get integerProp + * @return integerProp + **/ + public Integer getIntegerProp() { + return integerProp; + } + + /** + * Set integerProp + **/ + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + public NullableClass integerProp(Integer integerProp) { + this.integerProp = integerProp; + return this; + } + + /** + * Get numberProp + * @return numberProp + **/ + public BigDecimal getNumberProp() { + return numberProp; + } + + /** + * Set numberProp + **/ + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + return this; + } + + /** + * Get booleanProp + * @return booleanProp + **/ + public Boolean getBooleanProp() { + return booleanProp; + } + + /** + * Set booleanProp + **/ + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + return this; + } + + /** + * Get stringProp + * @return stringProp + **/ + public String getStringProp() { + return stringProp; + } + + /** + * Set stringProp + **/ + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + public NullableClass stringProp(String stringProp) { + this.stringProp = stringProp; + return this; + } + + /** + * Get dateProp + * @return dateProp + **/ + public LocalDate getDateProp() { + return dateProp; + } + + /** + * Set dateProp + **/ + public void setDateProp(LocalDate dateProp) { + this.dateProp = dateProp; + } + + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = dateProp; + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + **/ + public OffsetDateTime getDatetimeProp() { + return datetimeProp; + } + + /** + * Set datetimeProp + **/ + public void setDatetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public NullableClass datetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + **/ + public List getArrayNullableProp() { + return arrayNullableProp; + } + + /** + * Set arrayNullableProp + **/ + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + **/ + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + /** + * Set arrayAndItemsNullableProp + **/ + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + **/ + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + /** + * Set arrayItemsNullable + **/ + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + **/ + public Map getObjectNullableProp() { + return objectNullableProp; + } + + /** + * Set objectNullableProp + **/ + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + **/ + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + /** + * Set objectAndItemsNullableProp + **/ + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + **/ + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + /** + * Set objectItemsNullable + **/ + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 00000000000..5d493bccf26 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; + + + + +public class NumberOnly { + + private BigDecimal justNumber; + + /** + * Get justNumber + * @return justNumber + **/ + public BigDecimal getJustNumber() { + return justNumber; + } + + /** + * Set justNumber + **/ + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java new file mode 100644 index 00000000000..00c4300075b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,157 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; + + + + +public class ObjectWithDeprecatedFields { + + private String uuid; + + private BigDecimal id; + + private DeprecatedObject deprecatedRef; + + private List bars = null; + + /** + * Get uuid + * @return uuid + **/ + public String getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public ObjectWithDeprecatedFields uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get id + * @return id + * @deprecated + **/ + @Deprecated + public BigDecimal getId() { + return id; + } + + /** + * Set id + **/ + public void setId(BigDecimal id) { + this.id = id; + } + + public ObjectWithDeprecatedFields id(BigDecimal id) { + this.id = id; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + **/ + @Deprecated + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + /** + * Set deprecatedRef + **/ + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + **/ + @Deprecated + public List getBars() { + return bars; + } + + /** + * Set bars + **/ + public void setBars(List bars) { + this.bars = bars; + } + + public ObjectWithDeprecatedFields bars(List bars) { + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + this.bars.add(barsItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 00000000000..84ce8e3fa1f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Order.java @@ -0,0 +1,213 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; + + + + +public class Order { + + private Long id; + + private Long petId; + + private Integer quantity; + + private OffsetDateTime shipDate; + +public enum StatusEnum { + + PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); + + String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + /** + * Order Status + **/ + private StatusEnum status; + + private Boolean complete = false; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * @return petId + **/ + public Long getPetId() { + return petId; + } + + /** + * Set petId + **/ + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + public Integer getQuantity() { + return quantity; + } + + /** + * Set quantity + **/ + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + public OffsetDateTime getShipDate() { + return shipDate; + } + + /** + * Set shipDate + **/ + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + **/ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * @return complete + **/ + public Boolean getComplete() { + return complete; + } + + /** + * Set complete + **/ + public void setComplete(Boolean complete) { + this.complete = complete; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 00000000000..6ba3d1712d4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -0,0 +1,120 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; + + + + +public class OuterComposite { + + private BigDecimal myNumber; + + private String myString; + + private Boolean myBoolean; + + /** + * Get myNumber + * @return myNumber + **/ + public BigDecimal getMyNumber() { + return myNumber; + } + + /** + * Set myNumber + **/ + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myString + * @return myString + **/ + public String getMyString() { + return myString; + } + + /** + * Set myString + **/ + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + public Boolean getMyBoolean() { + return myBoolean; + } + + /** + * Set myBoolean + **/ + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 00000000000..9fe96db3f6e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 00000000000..f5b732f784f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String text) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 00000000000..0ca88b32ee6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(String text) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 00000000000..06f9fe6c371 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(String text) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java new file mode 100644 index 00000000000..b25e8e37ae7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnumInteger; + + + + +public class OuterObjectWithEnumProperty { + + private OuterEnumInteger value; + + /** + * Get value + * @return value + **/ + public OuterEnumInteger getValue() { + return value; + } + + /** + * Set value + **/ + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + this.value = value; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 00000000000..b86299acd2e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,230 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; + + + + +public class Pet { + + private Long id; + + private Category category; + + private String name; + + private Set photoUrls = new LinkedHashSet<>(); + + private List tags = null; + +public enum StatusEnum { + + AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); + + String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + /** + * pet status in the store + **/ + private StatusEnum status; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * @return category + **/ + public Category getCategory() { + return category; + } + + /** + * Set category + **/ + public void setCategory(Category category) { + this.category = category; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + public Set getPhotoUrls() { + return photoUrls; + } + + /** + * Set photoUrls + **/ + @JsonDeserialize(as = LinkedHashSet.class) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + public List getTags() { + return tags; + } + + /** + * Set tags + **/ + public void setTags(List tags) { + this.tags = tags; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + **/ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..15344cbf0dc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -0,0 +1,85 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class ReadOnlyFirst { + + private String bar; + + private String baz; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get baz + * @return baz + **/ + public String getBaz() { + return baz; + } + + /** + * Set baz + **/ + public void setBaz(String baz) { + this.baz = baz; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SingleRefType.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SingleRefType.java new file mode 100644 index 00000000000..d46fc6c116f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SingleRefType.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String text) { + for (SingleRefType b : SingleRefType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 00000000000..af5166268f7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class SpecialModelName { + + private Long $specialPropertyName; + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + /** + * Set $specialPropertyName + **/ + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 00000000000..1dee37e3936 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,96 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class Tag { + + private Long id; + + private String name; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 00000000000..c088a4d15d5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/main/java/org/openapitools/client/model/User.java @@ -0,0 +1,237 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + + + + +public class User { + + private Long id; + + private String username; + + private String firstName; + + private String lastName; + + private String email; + + private String password; + + private String phone; + + /** + * User Status + **/ + private Integer userStatus; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + **/ + public void setUsername(String username) { + this.username = username; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + public String getFirstName() { + return firstName; + } + + /** + * Set firstName + **/ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + public String getLastName() { + return lastName; + } + + /** + * Set lastName + **/ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * @return email + **/ + public String getEmail() { + return email; + } + + /** + * Set email + **/ + public void setEmail(String email) { + this.email = email; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + /** + * Set password + **/ + public void setPassword(String password) { + this.password = password; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * @return phone + **/ + public String getPhone() { + return phone; + } + + /** + * Set phone + **/ + public void setPhone(String phone) { + this.phone = phone; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * @return userStatus + **/ + public Integer getUserStatus() { + return userStatus; + } + + /** + * Set userStatus + **/ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 00000000000..61bad52eda6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; + +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.helidon.common.reactive.Single; +import io.helidon.webclient.WebClientResponse; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +/** + * + * OpenAPI Petstore Test + * + * + * API tests for AnotherFakeApi + */ +public class AnotherFakeApiTest { + + private static ApiClient apiClient; + private static AnotherFakeApi api; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() { + apiClient = ApiClient.builder().build(); + api = AnotherFakeApiImpl.create(apiClient); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + */ + @Test + public void call123testSpecialTagsTest() { + // TODO - assign values to the input arguments. + Client client = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.call123testSpecialTags(client); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 00000000000..89d04ef8532 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,69 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.FooGetDefaultResponse; + +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.helidon.common.reactive.Single; +import io.helidon.webclient.WebClientResponse; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +/** + * + * OpenAPI Petstore Test + * + * + * API tests for DefaultApi + */ +public class DefaultApiTest { + + private static ApiClient apiClient; + private static DefaultApi api; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() { + apiClient = ApiClient.builder().build(); + api = DefaultApiImpl.create(apiClient); + } + + /** + * + */ + @Test + public void fooGetTest() { + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.fooGet(); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 00000000000..c4dfd1fcf85 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,440 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import java.util.List; +import java.time.LocalDate; +import java.util.Map; +import java.time.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.User; + +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.helidon.common.reactive.Single; +import io.helidon.webclient.WebClientResponse; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +/** + * + * OpenAPI Petstore Test + * + * + * API tests for FakeApi + */ +public class FakeApiTest { + + private static ApiClient apiClient; + private static FakeApi api; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() { + apiClient = ApiClient.builder().build(); + api = FakeApiImpl.create(apiClient); + } + + /** + * Health check endpoint + */ + @Test + public void fakeHealthGetTest() { + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.fakeHealthGet(); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * test http signature authentication + */ + @Test + public void fakeHttpSignatureTestTest() { + // TODO - assign values to the input arguments. + Pet pet = null; + // TODO - assign values to the input arguments. + String query1 = null; + // TODO - assign values to the input arguments. + String header1 = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.fakeHttpSignatureTest(pet, query1, header1); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * + * Test serialization of outer boolean types + */ + @Test + public void fakeOuterBooleanSerializeTest() { + // TODO - assign values to the input arguments. + Boolean body = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.fakeOuterBooleanSerialize(body); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * + * Test serialization of object with outer number type + */ + @Test + public void fakeOuterCompositeSerializeTest() { + // TODO - assign values to the input arguments. + OuterComposite outerComposite = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.fakeOuterCompositeSerialize(outerComposite); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * + * Test serialization of outer number types + */ + @Test + public void fakeOuterNumberSerializeTest() { + // TODO - assign values to the input arguments. + BigDecimal body = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.fakeOuterNumberSerialize(body); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * + * Test serialization of outer string types + */ + @Test + public void fakeOuterStringSerializeTest() { + // TODO - assign values to the input arguments. + String body = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.fakeOuterStringSerialize(body); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * + * Test serialization of enum (int) properties with examples + */ + @Test + public void fakePropertyEnumIntegerSerializeTest() { + // TODO - assign values to the input arguments. + OuterObjectWithEnumProperty outerObjectWithEnumProperty = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * + * For this test, the body has to be a binary file. + */ + @Test + public void testBodyWithBinaryTest() { + // TODO - assign values to the input arguments. + File body = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testBodyWithBinary(body); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * + * For this test, the body for this request must reference a schema named `File`. + */ + @Test + public void testBodyWithFileSchemaTest() { + // TODO - assign values to the input arguments. + FileSchemaTestClass fileSchemaTestClass = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testBodyWithFileSchema(fileSchemaTestClass); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * + */ + @Test + public void testBodyWithQueryParamsTest() { + // TODO - assign values to the input arguments. + String query = null; + // TODO - assign values to the input arguments. + User user = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testBodyWithQueryParams(query, user); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * To test \"client\" model + * To test \"client\" model + */ + @Test + public void testClientModelTest() { + // TODO - assign values to the input arguments. + Client client = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testClientModel(client); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + */ + @Test + public void testEndpointParametersTest() { + // TODO - assign values to the input arguments. + BigDecimal number = null; + // TODO - assign values to the input arguments. + Double _double = null; + // TODO - assign values to the input arguments. + String patternWithoutDelimiter = null; + // TODO - assign values to the input arguments. + byte[] _byte = null; + // TODO - assign values to the input arguments. + Integer integer = null; + // TODO - assign values to the input arguments. + Integer int32 = null; + // TODO - assign values to the input arguments. + Long int64 = null; + // TODO - assign values to the input arguments. + Float _float = null; + // TODO - assign values to the input arguments. + String string = null; + // TODO - assign values to the input arguments. + File binary = null; + // TODO - assign values to the input arguments. + LocalDate date = null; + // TODO - assign values to the input arguments. + OffsetDateTime dateTime = null; + // TODO - assign values to the input arguments. + String password = null; + // TODO - assign values to the input arguments. + String paramCallback = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * To test enum parameters + * To test enum parameters + */ + @Test + public void testEnumParametersTest() { + // TODO - assign values to the input arguments. + List enumHeaderStringArray = null; + // TODO - assign values to the input arguments. + String enumHeaderString = null; + // TODO - assign values to the input arguments. + List enumQueryStringArray = null; + // TODO - assign values to the input arguments. + String enumQueryString = null; + // TODO - assign values to the input arguments. + Integer enumQueryInteger = null; + // TODO - assign values to the input arguments. + Double enumQueryDouble = null; + // TODO - assign values to the input arguments. + List enumQueryModelArray = null; + // TODO - assign values to the input arguments. + List enumFormStringArray = null; + // TODO - assign values to the input arguments. + String enumFormString = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + */ + @Test + public void testGroupParametersTest() { + // TODO - assign values to the input arguments. + Integer requiredStringGroup = null; + // TODO - assign values to the input arguments. + Boolean requiredBooleanGroup = null; + // TODO - assign values to the input arguments. + Long requiredInt64Group = null; + // TODO - assign values to the input arguments. + Integer stringGroup = null; + // TODO - assign values to the input arguments. + Boolean booleanGroup = null; + // TODO - assign values to the input arguments. + Long int64Group = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + // TODO - assign values to the input arguments. + Map requestBody = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testInlineAdditionalProperties(requestBody); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + */ + @Test + public void testJsonFormDataTest() { + // TODO - assign values to the input arguments. + String param = null; + // TODO - assign values to the input arguments. + String param2 = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testJsonFormData(param, param2); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * + * To test the collection format in query parameters + */ + @Test + public void testQueryParameterCollectionFormatTest() { + // TODO - assign values to the input arguments. + List pipe = null; + // TODO - assign values to the input arguments. + List ioutil = null; + // TODO - assign values to the input arguments. + List http = null; + // TODO - assign values to the input arguments. + List url = null; + // TODO - assign values to the input arguments. + List context = null; + // TODO - assign values to the input arguments. + String allowEmpty = null; + // TODO - assign values to the input arguments. + Map language = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 00000000000..b478b145844 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,74 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; + +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.helidon.common.reactive.Single; +import io.helidon.webclient.WebClientResponse; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +/** + * + * OpenAPI Petstore Test + * + * + * API tests for FakeClassnameTags123Api + */ +public class FakeClassnameTags123ApiTest { + + private static ApiClient apiClient; + private static FakeClassnameTags123Api api; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() { + apiClient = ApiClient.builder().build(); + api = FakeClassnameTags123ApiImpl.create(apiClient); + } + + /** + * To test class name in snake case + * To test class name in snake case + */ + @Test + public void testClassnameTest() { + // TODO - assign values to the input arguments. + Client client = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testClassname(client); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 00000000000..070ea88e4b2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,235 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.io.File; +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import java.util.Set; + +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.helidon.common.reactive.Single; +import io.helidon.webclient.WebClientResponse; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +/** + * + * OpenAPI Petstore Test + * + * + * API tests for PetApi + */ +public class PetApiTest { + + private static ApiClient apiClient; + private static PetApi api; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() { + apiClient = ApiClient.builder().build(); + api = PetApiImpl.create(apiClient); + } + + /** + * Add a new pet to the store + * + */ + @Test + public void addPetTest() { + // TODO - assign values to the input arguments. + Pet pet = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.addPet(pet); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Deletes a pet + * + */ + @Test + public void deletePetTest() { + // TODO - assign values to the input arguments. + Long petId = null; + // TODO - assign values to the input arguments. + String apiKey = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.deletePet(petId, apiKey); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + */ + @Test + public void findPetsByStatusTest() { + // TODO - assign values to the input arguments. + List status = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse> response = api.findPetsByStatus(status); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + */ + @Test + public void findPetsByTagsTest() { + // TODO - assign values to the input arguments. + Set tags = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse> response = api.findPetsByTags(tags); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Find pet by ID + * Returns a single pet + */ + @Test + public void getPetByIdTest() { + // TODO - assign values to the input arguments. + Long petId = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.getPetById(petId); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Update an existing pet + * + */ + @Test + public void updatePetTest() { + // TODO - assign values to the input arguments. + Pet pet = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.updatePet(pet); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + */ + @Test + public void updatePetWithFormTest() { + // TODO - assign values to the input arguments. + Long petId = null; + // TODO - assign values to the input arguments. + String name = null; + // TODO - assign values to the input arguments. + String status = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.updatePetWithForm(petId, name, status); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * uploads an image + * + */ + @Test + public void uploadFileTest() { + // TODO - assign values to the input arguments. + Long petId = null; + // TODO - assign values to the input arguments. + String additionalMetadata = null; + // TODO - assign values to the input arguments. + File _file = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.uploadFile(petId, additionalMetadata, _file); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * uploads an image (required) + * + */ + @Test + public void uploadFileWithRequiredFileTest() { + // TODO - assign values to the input arguments. + Long petId = null; + // TODO - assign values to the input arguments. + File requiredFile = null; + // TODO - assign values to the input arguments. + String additionalMetadata = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 00000000000..352767de98a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,126 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.Order; + +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.helidon.common.reactive.Single; +import io.helidon.webclient.WebClientResponse; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +/** + * + * OpenAPI Petstore Test + * + * + * API tests for StoreApi + */ +public class StoreApiTest { + + private static ApiClient apiClient; + private static StoreApi api; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() { + apiClient = ApiClient.builder().build(); + api = StoreApiImpl.create(apiClient); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + */ + @Test + public void deleteOrderTest() { + // TODO - assign values to the input arguments. + String orderId = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.deleteOrder(orderId); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + */ + @Test + public void getInventoryTest() { + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse> response = api.getInventory(); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + */ + @Test + public void getOrderByIdTest() { + // TODO - assign values to the input arguments. + Long orderId = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.getOrderById(orderId); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Place an order for a pet + * + */ + @Test + public void placeOrderTest() { + // TODO - assign values to the input arguments. + Order order = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.placeOrder(order); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 00000000000..81fca40222f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,203 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import java.util.List; +import java.util.Map; +import java.time.OffsetDateTime; +import org.openapitools.client.model.User; + +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.helidon.common.reactive.Single; +import io.helidon.webclient.WebClientResponse; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +/** + * + * OpenAPI Petstore Test + * + * + * API tests for UserApi + */ +public class UserApiTest { + + private static ApiClient apiClient; + private static UserApi api; + private static final String baseUrl = "http://localhost:8080"; + + @BeforeAll + public static void setup() { + apiClient = ApiClient.builder().build(); + api = UserApiImpl.create(apiClient); + } + + /** + * Create user + * This can only be done by the logged in user. + */ + @Test + public void createUserTest() { + // TODO - assign values to the input arguments. + User user = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.createUser(user); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + */ + @Test + public void createUsersWithArrayInputTest() { + // TODO - assign values to the input arguments. + List user = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.createUsersWithArrayInput(user); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + */ + @Test + public void createUsersWithListInputTest() { + // TODO - assign values to the input arguments. + List user = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.createUsersWithListInput(user); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Delete user + * This can only be done by the logged in user. + */ + @Test + public void deleteUserTest() { + // TODO - assign values to the input arguments. + String username = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.deleteUser(username); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Get user by user name + * + */ + @Test + public void getUserByNameTest() { + // TODO - assign values to the input arguments. + String username = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.getUserByName(username); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Logs user into the system + * + */ + @Test + public void loginUserTest() { + // TODO - assign values to the input arguments. + String username = null; + // TODO - assign values to the input arguments. + String password = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.loginUser(username, password); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + */ + @Test + public void logoutUserTest() { + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.logoutUser(); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * Updated user + * This can only be done by the logged in user. + */ + @Test + public void updateUserTest() { + // TODO - assign values to the input arguments. + String username = null; + // TODO - assign values to the input arguments. + User user = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.updateUser(username, user); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..008d620d506 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AdditionalPropertiesClass + */ +public class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + public void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + public void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + public void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java new file mode 100644 index 00000000000..ad55c6f2c7d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -0,0 +1,56 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.SingleRefType; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AllOfWithSingleRef + */ +public class AllOfWithSingleRefTest { + private final AllOfWithSingleRef model = new AllOfWithSingleRef(); + + /** + * Model tests for AllOfWithSingleRef + */ + @Test + public void testAllOfWithSingleRef() { + // TODO: test AllOfWithSingleRef + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'singleRefType' + */ + @Test + public void singleRefTypeTest() { + // TODO: test singleRefType + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 00000000000..c38a031c2ee --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,60 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Cat; +import org.openapitools.client.model.Dog; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Animal + */ +public class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + public void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..5a886da823a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +public class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + public void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + public void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..6b0d615c0ee --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,50 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayOfNumberOnly + */ +public class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + public void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + public void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 00000000000..be3f20c9a37 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,66 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayTest + */ +public class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + public void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + public void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + public void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + public void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 00000000000..18e9b9dbf0c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,87 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Capitalization + */ +public class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + public void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + public void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + public void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + public void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + public void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + public void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + public void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CatAllOfTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CatAllOfTest.java new file mode 100644 index 00000000000..3772925dd61 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CatAllOfTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CatAllOf + */ +public class CatAllOfTest { + private final CatAllOf model = new CatAllOf(); + + /** + * Model tests for CatAllOf + */ + @Test + public void testCatAllOf() { + // TODO: test CatAllOf + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 00000000000..d78fcb63591 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Cat + */ +public class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + public void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 00000000000..12d4b6a6441 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Category + */ +public class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + public void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 00000000000..035b80969f6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ClassModel + */ +public class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + public void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 00000000000..9b4899ae227 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Client + */ +public class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + public void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + public void clientTest() { + // TODO: test client + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java new file mode 100644 index 00000000000..54347091cc7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeprecatedObject + */ +public class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + public void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DogAllOfTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DogAllOfTest.java new file mode 100644 index 00000000000..16066cd03f1 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DogAllOfTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DogAllOf + */ +public class DogAllOfTest { + private final DogAllOf model = new DogAllOf(); + + /** + * Model tests for DogAllOf + */ + @Test + public void testDogAllOf() { + // TODO: test DogAllOf + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 00000000000..6819c78158a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Animal; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Dog + */ +public class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + public void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 00000000000..4d249658722 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EnumArrays + */ +public class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + public void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + public void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + public void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 00000000000..11bf230be71 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EnumClass + */ +public class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + public void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 00000000000..ec0d37ce367 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,111 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.OuterEnumDefaultValue; +import org.openapitools.client.model.OuterEnumInteger; +import org.openapitools.client.model.OuterEnumIntegerDefaultValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EnumTest + */ +public class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + public void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + public void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + public void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + public void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + public void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + public void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + public void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + public void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + public void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 00000000000..846646eb944 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,58 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ModelFile; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FileSchemaTestClass + */ +public class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + public void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property '_file' + */ + @Test + public void _fileTest() { + // TODO: test _file + } + + /** + * Test the property 'files' + */ + @Test + public void filesTest() { + // TODO: test files + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java new file mode 100644 index 00000000000..14639567d81 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.Foo; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FooGetDefaultResponse + */ +public class FooGetDefaultResponseTest { + private final FooGetDefaultResponse model = new FooGetDefaultResponse(); + + /** + * Model tests for FooGetDefaultResponse + */ + @Test + public void testFooGetDefaultResponse() { + // TODO: test FooGetDefaultResponse + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 00000000000..6ad35f67e28 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Foo + */ +public class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + public void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 00000000000..773e76967ef --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,172 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FormatTest + */ +public class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + public void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + public void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + public void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + public void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + public void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + public void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + public void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + public void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 00000000000..b956d12d747 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasOnlyReadOnly + */ +public class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + public void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + public void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 00000000000..3267defa3a6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -0,0 +1,51 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HealthCheckResult + */ +public class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + public void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + public void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 00000000000..ac308e40089 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,73 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for MapTest + */ +public class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + public void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + public void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + public void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + public void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + public void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..72a7a2a961c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,68 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +public class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + public void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + public void mapTest() { + // TODO: test map + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 00000000000..79bd883d4c4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Model200Response + */ +public class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + public void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 00000000000..79b915c9675 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,63 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelApiResponse + */ +public class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + public void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 00000000000..c10fa3927e3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 00000000000..7c09d2e78e8 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 00000000000..8c99cb5220f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelReturn + */ +public class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + public void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + public void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 00000000000..8795299bfae --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,71 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Name + */ +public class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + public void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + public void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + public void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + public void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 00000000000..95997f952e7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -0,0 +1,146 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NullableClass + */ +public class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + public void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + public void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + public void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + public void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + public void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + public void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + public void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + public void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + public void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + public void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + public void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + public void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + public void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 00000000000..f1af4caf2ec --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NumberOnly + */ +public class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + public void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + public void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 00000000000..14f312e38a6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,75 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.DeprecatedObject; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ObjectWithDeprecatedFields + */ +public class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + public void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + public void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + public void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 00000000000..e99bf8d598d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,88 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Order + */ +public class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + public void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + public void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + public void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + public void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + public void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 00000000000..28b832d5db9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,64 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterComposite + */ +public class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + public void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + public void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + public void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + public void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 00000000000..75313d6581d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnumDefaultValue + */ +public class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + public void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 00000000000..df4527f0d49 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +public class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + public void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 00000000000..87c29d2fd72 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnumInteger + */ +public class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + public void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 00000000000..226fc34f402 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnum + */ +public class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + public void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 00000000000..24984008abf --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -0,0 +1,48 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.client.model.OuterEnumInteger; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterObjectWithEnumProperty + */ +public class OuterObjectWithEnumPropertyTest { + private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); + + /** + * Model tests for OuterObjectWithEnumProperty + */ + @Test + public void testOuterObjectWithEnumProperty() { + // TODO: test OuterObjectWithEnumProperty + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 00000000000..6de3524dcc4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,94 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Pet + */ +public class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + public void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 00000000000..332a1b116c7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ReadOnlyFirst + */ +public class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + public void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + public void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java new file mode 100644 index 00000000000..82f51f683de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -0,0 +1,32 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SingleRefType + */ +public class SingleRefTypeTest { + /** + * Model tests for SingleRefType + */ + @Test + public void testSingleRefType() { + // TODO: test SingleRefType + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 00000000000..e1d4d10b94f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,47 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialModelName + */ +public class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + public void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + public void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 00000000000..ff32e6c114f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,55 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Tag + */ +public class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + public void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 00000000000..32404a5e38e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/se/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,103 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + public void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + public void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + public void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + public void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/.openapi-generator-ignore b/samples/server/petstore/java-helidon-server/mp/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES new file mode 100644 index 00000000000..25cb8725527 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES @@ -0,0 +1,121 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/server/JavaTimeFormatter.java +src/main/java/org/openapitools/server/RFC3339DateFormat.java +src/main/java/org/openapitools/server/RestApplication.java +src/main/java/org/openapitools/server/api/AnotherFakeService.java +src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java +src/main/java/org/openapitools/server/api/DefaultService.java +src/main/java/org/openapitools/server/api/DefaultServiceImpl.java +src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java +src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java +src/main/java/org/openapitools/server/api/FakeService.java +src/main/java/org/openapitools/server/api/FakeServiceImpl.java +src/main/java/org/openapitools/server/api/PetService.java +src/main/java/org/openapitools/server/api/PetServiceImpl.java +src/main/java/org/openapitools/server/api/StoreService.java +src/main/java/org/openapitools/server/api/StoreServiceImpl.java +src/main/java/org/openapitools/server/api/UserService.java +src/main/java/org/openapitools/server/api/UserServiceImpl.java +src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java +src/main/java/org/openapitools/server/model/Animal.java +src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/server/model/ArrayTest.java +src/main/java/org/openapitools/server/model/Capitalization.java +src/main/java/org/openapitools/server/model/Cat.java +src/main/java/org/openapitools/server/model/CatAllOf.java +src/main/java/org/openapitools/server/model/Category.java +src/main/java/org/openapitools/server/model/ClassModel.java +src/main/java/org/openapitools/server/model/Client.java +src/main/java/org/openapitools/server/model/DeprecatedObject.java +src/main/java/org/openapitools/server/model/Dog.java +src/main/java/org/openapitools/server/model/DogAllOf.java +src/main/java/org/openapitools/server/model/EnumArrays.java +src/main/java/org/openapitools/server/model/EnumClass.java +src/main/java/org/openapitools/server/model/EnumTest.java +src/main/java/org/openapitools/server/model/FileSchemaTestClass.java +src/main/java/org/openapitools/server/model/Foo.java +src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/server/model/FormatTest.java +src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/server/model/HealthCheckResult.java +src/main/java/org/openapitools/server/model/MapTest.java +src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/server/model/Model200Response.java +src/main/java/org/openapitools/server/model/ModelApiResponse.java +src/main/java/org/openapitools/server/model/ModelFile.java +src/main/java/org/openapitools/server/model/ModelList.java +src/main/java/org/openapitools/server/model/ModelReturn.java +src/main/java/org/openapitools/server/model/Name.java +src/main/java/org/openapitools/server/model/NullableClass.java +src/main/java/org/openapitools/server/model/NumberOnly.java +src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java +src/main/java/org/openapitools/server/model/Order.java +src/main/java/org/openapitools/server/model/OuterComposite.java +src/main/java/org/openapitools/server/model/OuterEnum.java +src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/server/model/OuterEnumInteger.java +src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java +src/main/java/org/openapitools/server/model/Pet.java +src/main/java/org/openapitools/server/model/ReadOnlyFirst.java +src/main/java/org/openapitools/server/model/SingleRefType.java +src/main/java/org/openapitools/server/model/SpecialModelName.java +src/main/java/org/openapitools/server/model/Tag.java +src/main/java/org/openapitools/server/model/User.java +src/main/java/org/openapitools/server/package-info.java +src/main/resources/META-INF/beans.xml +src/main/resources/META-INF/microprofile-config.properties +src/main/resources/META-INF/openapi.yml +src/main/resources/logging.properties +src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java +src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java +src/test/java/org/openapitools/server/model/AnimalTest.java +src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/server/model/ArrayTestTest.java +src/test/java/org/openapitools/server/model/CapitalizationTest.java +src/test/java/org/openapitools/server/model/CatAllOfTest.java +src/test/java/org/openapitools/server/model/CatTest.java +src/test/java/org/openapitools/server/model/CategoryTest.java +src/test/java/org/openapitools/server/model/ClassModelTest.java +src/test/java/org/openapitools/server/model/ClientTest.java +src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java +src/test/java/org/openapitools/server/model/DogAllOfTest.java +src/test/java/org/openapitools/server/model/DogTest.java +src/test/java/org/openapitools/server/model/EnumArraysTest.java +src/test/java/org/openapitools/server/model/EnumClassTest.java +src/test/java/org/openapitools/server/model/EnumTestTest.java +src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java +src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java +src/test/java/org/openapitools/server/model/FooTest.java +src/test/java/org/openapitools/server/model/FormatTestTest.java +src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java +src/test/java/org/openapitools/server/model/HealthCheckResultTest.java +src/test/java/org/openapitools/server/model/MapTestTest.java +src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +src/test/java/org/openapitools/server/model/Model200ResponseTest.java +src/test/java/org/openapitools/server/model/ModelApiResponseTest.java +src/test/java/org/openapitools/server/model/ModelFileTest.java +src/test/java/org/openapitools/server/model/ModelListTest.java +src/test/java/org/openapitools/server/model/ModelReturnTest.java +src/test/java/org/openapitools/server/model/NameTest.java +src/test/java/org/openapitools/server/model/NullableClassTest.java +src/test/java/org/openapitools/server/model/NumberOnlyTest.java +src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java +src/test/java/org/openapitools/server/model/OrderTest.java +src/test/java/org/openapitools/server/model/OuterCompositeTest.java +src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java +src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java +src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java +src/test/java/org/openapitools/server/model/OuterEnumTest.java +src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java +src/test/java/org/openapitools/server/model/PetTest.java +src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java +src/test/java/org/openapitools/server/model/SingleRefTypeTest.java +src/test/java/org/openapitools/server/model/SpecialModelNameTest.java +src/test/java/org/openapitools/server/model/TagTest.java +src/test/java/org/openapitools/server/model/UserTest.java diff --git a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/VERSION b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/VERSION new file mode 100644 index 00000000000..7b7e20b5703 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/mp/README.md b/samples/server/petstore/java-helidon-server/mp/README.md new file mode 100644 index 00000000000..582fc1c98eb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/README.md @@ -0,0 +1,74 @@ +# Helidon Server with OpenAPI + +## Build and run + +With JDK11+ +```bash +mvn package +java -jar target/petstore-helidon-server-mp.jar +``` + +## Exercise the application + +``` +curl -X PATCH http://petstore.swagger.io:80/v2 +curl -X GET http://petstore.swagger.io:80/v2 +curl -X GET http://petstore.swagger.io:80/v2/health +curl -X GET http://petstore.swagger.io:80/v2/http-signature-test +curl -X POST http://petstore.swagger.io:80/v2/outer/boolean +curl -X POST http://petstore.swagger.io:80/v2/outer/composite +curl -X POST http://petstore.swagger.io:80/v2/outer/number +curl -X POST http://petstore.swagger.io:80/v2/outer/string +curl -X POST http://petstore.swagger.io:80/v2/property/enum-int +curl -X PUT http://petstore.swagger.io:80/v2/body-with-binary +curl -X PUT http://petstore.swagger.io:80/v2/body-with-file-schema +curl -X PUT http://petstore.swagger.io:80/v2/body-with-query-params +curl -X PATCH http://petstore.swagger.io:80/v2 +curl -X POST http://petstore.swagger.io:80/v2 +curl -X GET http://petstore.swagger.io:80/v2 +curl -X DELETE http://petstore.swagger.io:80/v2 +curl -X POST http://petstore.swagger.io:80/v2/inline-additionalProperties +curl -X GET http://petstore.swagger.io:80/v2/jsonFormData +curl -X PUT http://petstore.swagger.io:80/v2/test-query-parameters +curl -X PATCH http://petstore.swagger.io:80/v2 +curl -X POST http://petstore.swagger.io:80/v2/pet +curl -X DELETE http://petstore.swagger.io:80/v2/pet/{petId} +curl -X GET http://petstore.swagger.io:80/v2/pet/findByStatus +curl -X GET http://petstore.swagger.io:80/v2/pet/findByTags +curl -X GET http://petstore.swagger.io:80/v2/pet/{petId} +curl -X PUT http://petstore.swagger.io:80/v2/pet +curl -X POST http://petstore.swagger.io:80/v2/pet/{petId} +curl -X POST http://petstore.swagger.io:80/v2/pet/{petId}/uploadImage +curl -X POST http://petstore.swagger.io:80/v2/fake/{petId}/uploadImageWithRequiredFile +curl -X DELETE http://petstore.swagger.io:80/v2/order/{order_id} +curl -X GET http://petstore.swagger.io:80/v2/inventory +curl -X GET http://petstore.swagger.io:80/v2/order/{order_id} +curl -X POST http://petstore.swagger.io:80/v2/order +curl -X POST http://petstore.swagger.io:80/v2 +curl -X POST http://petstore.swagger.io:80/v2/createWithArray +curl -X POST http://petstore.swagger.io:80/v2/createWithList +curl -X DELETE http://petstore.swagger.io:80/v2/{username} +curl -X GET http://petstore.swagger.io:80/v2/{username} +curl -X GET http://petstore.swagger.io:80/v2/login +curl -X GET http://petstore.swagger.io:80/v2/logout +curl -X PUT http://petstore.swagger.io:80/v2/{username} + +``` + +## Try health and metrics + +``` +curl -s -X GET http://petstore.swagger.io:80/v2/health +{"outcome":"UP",... +. . . + +# Prometheus Format +curl -s -X GET http://petstore.swagger.io:80/v2/metrics +# TYPE base:gc_g1_young_generation_count gauge +. . . + +# JSON Format +curl -H 'Accept: application/json' -X GET http://petstore.swagger.io:80/v2/metrics +{"base":... +. . . +``` \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/mp/pom.xml b/samples/server/petstore/java-helidon-server/mp/pom.xml new file mode 100644 index 00000000000..2aea52e631d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/pom.xml @@ -0,0 +1,82 @@ + + 4.0.0 + org.openapitools + + io.helidon.applications + helidon-mp + 3.0.1 + + + petstore-helidon-server-mp + petstore-helidon-server-mp + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + 1.0.0 + jar + + + 0.2.3 + + + + + io.helidon.microprofile.bundles + helidon-microprofile-core + + + io.helidon.microprofile.cdi + helidon-microprofile-cdi + + + jakarta.enterprise + jakarta.enterprise.cdi-api + + + jakarta.ws.rs + jakarta.ws.rs-api + + + org.openapitools + jackson-databind-nullable + ${version.jackson.databind.nullable} + + + org.glassfish.jersey.media + jersey-media-json-jackson + + + org.junit.jupiter + junit-jupiter-api + test + + + io.helidon.microprofile.tests + helidon-microprofile-tests-junit5 + test + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-libs + + + + + org.jboss.jandex + jandex-maven-plugin + + + make-index + + + + + + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/JavaTimeFormatter.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/JavaTimeFormatter.java new file mode 100644 index 00000000000..5bb6d6b7962 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/JavaTimeFormatter.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server; + +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; + +/** + * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. + * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. + */ +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public class JavaTimeFormatter { + + private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; + + /** + * Get the date format used to parse/format {@code OffsetDateTime} parameters. + * @return DateTimeFormatter + */ + public DateTimeFormatter getOffsetDateTimeFormatter() { + return offsetDateTimeFormatter; + } + + /** + * Set the date format used to parse/format {@code OffsetDateTime} parameters. + * @param offsetDateTimeFormatter {@code DateTimeFormatter} + */ + public void setOffsetDateTimeFormatter(DateTimeFormatter offsetDateTimeFormatter) { + this.offsetDateTimeFormatter = offsetDateTimeFormatter; + } + + /** + * Parse the given string into {@code OffsetDateTime} object. + * @param str String + * @return {@code OffsetDateTime} + */ + public OffsetDateTime parseOffsetDateTime(String str) { + try { + return OffsetDateTime.parse(str, offsetDateTimeFormatter); + } catch (DateTimeParseException e) { + throw new RuntimeException(e); + } + } + /** + * Format the given {@code OffsetDateTime} object into string. + * @param offsetDateTime {@code OffsetDateTime} + * @return {@code OffsetDateTime} in string format + */ + public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { + return offsetDateTimeFormatter.format(offsetDateTime); + } +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/RFC3339DateFormat.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/RFC3339DateFormat.java new file mode 100644 index 00000000000..f47f2f7f983 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/RFC3339DateFormat.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return this; + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/RestApplication.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/RestApplication.java new file mode 100644 index 00000000000..c6e5b490a2b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/RestApplication.java @@ -0,0 +1,11 @@ +package org.openapitools.server; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; + +@ApplicationScoped +@ApplicationPath("/v2") +public class RestApplication extends Application { + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java new file mode 100644 index 00000000000..2055dd67fb9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java @@ -0,0 +1,35 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/another-fake/dummy") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public interface AnotherFakeService { + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + abstract Response call123testSpecialTags(@Valid @NotNull Client client); +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java new file mode 100644 index 00000000000..a1d4f78cf05 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java @@ -0,0 +1,37 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/another-fake/dummy") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public class AnotherFakeServiceImpl implements AnotherFakeService { + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + public Response call123testSpecialTags(@Valid @NotNull Client client) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultService.java new file mode 100644 index 00000000000..9051caf6f98 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultService.java @@ -0,0 +1,34 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.FooGetDefaultResponse; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/foo") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public interface DefaultService { + + @GET + @Produces({ "application/json" }) + abstract Response fooGet(); +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java new file mode 100644 index 00000000000..c5a10220e98 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java @@ -0,0 +1,36 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.FooGetDefaultResponse; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/foo") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public class DefaultServiceImpl implements DefaultService { + + @GET + @Produces({ "application/json" }) + public Response fooGet() { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java new file mode 100644 index 00000000000..76291169a5a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java @@ -0,0 +1,35 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/fake_classname_test") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public interface FakeClassnameTags123Service { + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + abstract Response testClassname(@Valid @NotNull Client client); +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java new file mode 100644 index 00000000000..009ad116aa1 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java @@ -0,0 +1,37 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/fake_classname_test") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public class FakeClassnameTags123ServiceImpl implements FakeClassnameTags123Service { + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + public Response testClassname(@Valid @NotNull Client client) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java new file mode 100644 index 00000000000..c7ab3fa2595 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java @@ -0,0 +1,127 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.math.BigDecimal; +import org.openapitools.server.model.Client; +import org.openapitools.server.model.EnumClass; +import java.io.File; +import org.openapitools.server.model.FileSchemaTestClass; +import org.openapitools.server.model.HealthCheckResult; +import java.time.LocalDate; +import java.util.Map; +import java.time.OffsetDateTime; +import org.openapitools.server.model.OuterComposite; +import org.openapitools.server.model.OuterObjectWithEnumProperty; +import org.openapitools.server.model.Pet; +import org.openapitools.server.model.User; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/fake") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public interface FakeService { + + @GET + @Path("/health") + @Produces({ "application/json" }) + abstract Response fakeHealthGet(); + + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + abstract Response fakeHttpSignatureTest(@Valid @NotNull Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1); + + @POST + @Path("/outer/boolean") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + abstract Response fakeOuterBooleanSerialize(@Valid Boolean body); + + @POST + @Path("/outer/composite") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + abstract Response fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite); + + @POST + @Path("/outer/number") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + abstract Response fakeOuterNumberSerialize(@Valid BigDecimal body); + + @POST + @Path("/outer/string") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + abstract Response fakeOuterStringSerialize(@Valid String body); + + @POST + @Path("/property/enum-int") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + abstract Response fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty); + + @PUT + @Path("/body-with-binary") + @Consumes({ "image/png" }) + abstract Response testBodyWithBinary(@Valid File body); + + @PUT + @Path("/body-with-file-schema") + @Consumes({ "application/json" }) + abstract Response testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass fileSchemaTestClass); + + @PUT + @Path("/body-with-query-params") + @Consumes({ "application/json" }) + abstract Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query, @Valid @NotNull User user); + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + abstract Response testClientModel(@Valid @NotNull Client client); + + @POST + @Consumes({ "application/x-www-form-urlencoded" }) + abstract Response testEndpointParameters(@FormParam(value = "number") BigDecimal number, @FormParam(value = "double") Double _double, @FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter, @FormParam(value = "byte") byte[] _byte, @FormParam(value = "integer") Integer integer, @FormParam(value = "int32") Integer int32, @FormParam(value = "int64") Long int64, @FormParam(value = "float") Float _float, @FormParam(value = "string") String string, @FormParam(value = "binary") InputStream binaryInputStream, @FormParam(value = "date") LocalDate date, @FormParam(value = "dateTime") OffsetDateTime dateTime, @FormParam(value = "password") String password, @FormParam(value = "callback") String paramCallback); + + @GET + @Consumes({ "application/x-www-form-urlencoded" }) + abstract Response testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") @DefaultValue("-efg") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @QueryParam("enum_query_double") Double enumQueryDouble, @QueryParam("enum_query_model_array") List enumQueryModelArray, @FormParam(value = "enum_form_string_array") List enumFormStringArray, @FormParam(value = "enum_form_string") String enumFormString); + + @DELETE + abstract Response testGroupParameters(@QueryParam("required_string_group") @NotNull Integer requiredStringGroup, @HeaderParam("required_boolean_group") @NotNull Boolean requiredBooleanGroup, @QueryParam("required_int64_group") @NotNull Long requiredInt64Group, @QueryParam("string_group") Integer stringGroup, @HeaderParam("boolean_group") Boolean booleanGroup, @QueryParam("int64_group") Long int64Group); + + @POST + @Path("/inline-additionalProperties") + @Consumes({ "application/json" }) + abstract Response testInlineAdditionalProperties(@Valid @NotNull Map requestBody); + + @GET + @Path("/jsonFormData") + @Consumes({ "application/x-www-form-urlencoded" }) + abstract Response testJsonFormData(@FormParam(value = "param") String param, @FormParam(value = "param2") String param2); + + @PUT + @Path("/test-query-parameters") + abstract Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe, @QueryParam("ioutil") @NotNull List ioutil, @QueryParam("http") @NotNull List http, @QueryParam("url") @NotNull List url, @QueryParam("context") @NotNull List context, @QueryParam("allowEmpty") @NotNull String allowEmpty, @QueryParam("language") Map language); +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java new file mode 100644 index 00000000000..7221b67530f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -0,0 +1,161 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.math.BigDecimal; +import org.openapitools.server.model.Client; +import org.openapitools.server.model.EnumClass; +import java.io.File; +import org.openapitools.server.model.FileSchemaTestClass; +import org.openapitools.server.model.HealthCheckResult; +import java.time.LocalDate; +import java.util.Map; +import java.time.OffsetDateTime; +import org.openapitools.server.model.OuterComposite; +import org.openapitools.server.model.OuterObjectWithEnumProperty; +import org.openapitools.server.model.Pet; +import org.openapitools.server.model.User; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/fake") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public class FakeServiceImpl implements FakeService { + + @GET + @Path("/health") + @Produces({ "application/json" }) + public Response fakeHealthGet() { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + public Response fakeHttpSignatureTest(@Valid @NotNull Pet pet,@QueryParam("query_1") String query1,@HeaderParam("header_1") String header1) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/outer/boolean") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + public Response fakeOuterBooleanSerialize(@Valid Boolean body) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/outer/composite") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + public Response fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/outer/number") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + public Response fakeOuterNumberSerialize(@Valid BigDecimal body) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/outer/string") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + public Response fakeOuterStringSerialize(@Valid String body) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/property/enum-int") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + public Response fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/body-with-binary") + @Consumes({ "image/png" }) + public Response testBodyWithBinary(@Valid File body) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/body-with-file-schema") + @Consumes({ "application/json" }) + public Response testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass fileSchemaTestClass) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/body-with-query-params") + @Consumes({ "application/json" }) + public Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User user) { + return Response.ok().entity("magic!").build(); + } + + @PATCH + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + public Response testClientModel(@Valid @NotNull Client client) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Consumes({ "application/x-www-form-urlencoded" }) + public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string, @FormParam(value = "binary") InputStream binaryInputStream,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") OffsetDateTime dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Consumes({ "application/x-www-form-urlencoded" }) + public Response testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") String enumHeaderString,@QueryParam("enum_query_string_array") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString,@QueryParam("enum_query_integer") Integer enumQueryInteger,@QueryParam("enum_query_double") Double enumQueryDouble,@QueryParam("enum_query_model_array") List enumQueryModelArray,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { + return Response.ok().entity("magic!").build(); + } + + @DELETE + public Response testGroupParameters(@QueryParam("required_string_group") @NotNull Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull Long requiredInt64Group,@QueryParam("string_group") Integer stringGroup,@HeaderParam("boolean_group") Boolean booleanGroup,@QueryParam("int64_group") Long int64Group) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/inline-additionalProperties") + @Consumes({ "application/json" }) + public Response testInlineAdditionalProperties(@Valid @NotNull Map requestBody) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/jsonFormData") + @Consumes({ "application/x-www-form-urlencoded" }) + public Response testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/test-query-parameters") + public Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context,@QueryParam("allowEmpty") @NotNull String allowEmpty,@QueryParam("language") Map language) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetService.java new file mode 100644 index 00000000000..5396af911b6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetService.java @@ -0,0 +1,79 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.io.File; +import org.openapitools.server.model.ModelApiResponse; +import org.openapitools.server.model.Pet; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public interface PetService { + + @POST + @Path("/pet") + @Consumes({ "application/json", "application/xml" }) + abstract Response addPet(@Valid @NotNull Pet pet); + + @DELETE + @Path("/pet/{petId}") + abstract Response deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + + @GET + @Path("/pet/findByStatus") + @Produces({ "application/xml", "application/json" }) + abstract Response findPetsByStatus(@QueryParam("status") @NotNull List status); + + @GET + @Path("/pet/findByTags") + @Produces({ "application/xml", "application/json" }) + abstract Response findPetsByTags(@QueryParam("tags") @NotNull Set tags); + + @GET + @Path("/pet/{petId}") + @Produces({ "application/xml", "application/json" }) + abstract Response getPetById(@PathParam("petId") Long petId); + + @PUT + @Path("/pet") + @Consumes({ "application/json", "application/xml" }) + abstract Response updatePet(@Valid @NotNull Pet pet); + + @POST + @Path("/pet/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + abstract Response updatePetWithForm(@PathParam("petId") Long petId, @FormParam(value = "name") String name, @FormParam(value = "status") String status); + + @POST + @Path("/pet/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + abstract Response uploadFile(@PathParam("petId") Long petId, @FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream); + + @POST + @Path("/fake/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + abstract Response uploadFileWithRequiredFile(@PathParam("petId") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream, @FormParam(value = "additionalMetadata") String additionalMetadata); +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java new file mode 100644 index 00000000000..de0e280df07 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java @@ -0,0 +1,97 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.io.File; +import org.openapitools.server.model.ModelApiResponse; +import org.openapitools.server.model.Pet; +import java.util.Set; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public class PetServiceImpl implements PetService { + + @POST + @Path("/pet") + @Consumes({ "application/json", "application/xml" }) + public Response addPet(@Valid @NotNull Pet pet) { + return Response.ok().entity("magic!").build(); + } + + @DELETE + @Path("/pet/{petId}") + public Response deletePet(@PathParam("petId") Long petId,@HeaderParam("api_key") String apiKey) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/pet/findByStatus") + @Produces({ "application/xml", "application/json" }) + public Response findPetsByStatus(@QueryParam("status") @NotNull List status) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/pet/findByTags") + @Produces({ "application/xml", "application/json" }) + public Response findPetsByTags(@QueryParam("tags") @NotNull Set tags) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/pet/{petId}") + @Produces({ "application/xml", "application/json" }) + public Response getPetById(@PathParam("petId") Long petId) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/pet") + @Consumes({ "application/json", "application/xml" }) + public Response updatePet(@Valid @NotNull Pet pet) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/pet/{petId}") + @Consumes({ "application/x-www-form-urlencoded" }) + public Response updatePetWithForm(@PathParam("petId") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/pet/{petId}/uploadImage") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + public Response uploadFile(@PathParam("petId") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/fake/{petId}/uploadImageWithRequiredFile") + @Consumes({ "multipart/form-data" }) + @Produces({ "application/json" }) + public Response uploadFileWithRequiredFile(@PathParam("petId") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream,@FormParam(value = "additionalMetadata") String additionalMetadata) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreService.java new file mode 100644 index 00000000000..df03b4c69c0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreService.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.util.Map; +import org.openapitools.server.model.Order; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/store") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public interface StoreService { + + @DELETE + @Path("/order/{order_id}") + abstract Response deleteOrder(@PathParam("order_id") String orderId); + + @GET + @Path("/inventory") + @Produces({ "application/json" }) + abstract Response getInventory(); + + @GET + @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) + abstract Response getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) Long orderId); + + @POST + @Path("/order") + @Consumes({ "application/json" }) + @Produces({ "application/xml", "application/json" }) + abstract Response placeOrder(@Valid @NotNull Order order); +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java new file mode 100644 index 00000000000..07e9170b326 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.util.Map; +import org.openapitools.server.model.Order; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/store") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public class StoreServiceImpl implements StoreService { + + @DELETE + @Path("/order/{order_id}") + public Response deleteOrder(@PathParam("order_id") String orderId) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/inventory") + @Produces({ "application/json" }) + public Response getInventory() { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/order/{order_id}") + @Produces({ "application/xml", "application/json" }) + public Response getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) Long orderId) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/order") + @Consumes({ "application/json" }) + @Produces({ "application/xml", "application/json" }) + public Response placeOrder(@Valid @NotNull Order order) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserService.java new file mode 100644 index 00000000000..3d7b81dcea8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserService.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.server.model.User; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/user") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public interface UserService { + + @POST + @Consumes({ "application/json" }) + abstract Response createUser(@Valid @NotNull User user); + + @POST + @Path("/createWithArray") + @Consumes({ "application/json" }) + abstract Response createUsersWithArrayInput(@Valid @NotNull List user); + + @POST + @Path("/createWithList") + @Consumes({ "application/json" }) + abstract Response createUsersWithListInput(@Valid @NotNull List user); + + @DELETE + @Path("/{username}") + abstract Response deleteUser(@PathParam("username") String username); + + @GET + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + abstract Response getUserByName(@PathParam("username") String username); + + @GET + @Path("/login") + @Produces({ "application/xml", "application/json" }) + abstract Response loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); + + @GET + @Path("/logout") + abstract Response logoutUser(); + + @PUT + @Path("/{username}") + @Consumes({ "application/json" }) + abstract Response updateUser(@PathParam("username") String username, @Valid @NotNull User user); +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java new file mode 100644 index 00000000000..1f07a1199ac --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java @@ -0,0 +1,85 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.api; + +import java.util.List; +import java.time.OffsetDateTime; +import org.openapitools.server.model.User; + +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; + + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +@Path("/user") +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen") +public class UserServiceImpl implements UserService { + + @POST + @Consumes({ "application/json" }) + public Response createUser(@Valid @NotNull User user) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/createWithArray") + @Consumes({ "application/json" }) + public Response createUsersWithArrayInput(@Valid @NotNull List user) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/createWithList") + @Consumes({ "application/json" }) + public Response createUsersWithListInput(@Valid @NotNull List user) { + return Response.ok().entity("magic!").build(); + } + + @DELETE + @Path("/{username}") + public Response deleteUser(@PathParam("username") String username) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/{username}") + @Produces({ "application/xml", "application/json" }) + public Response getUserByName(@PathParam("username") String username) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/login") + @Produces({ "application/xml", "application/json" }) + public Response loginUser(@QueryParam("username") @NotNull String username,@QueryParam("password") @NotNull String password) { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/logout") + public Response logoutUser() { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/{username}") + @Consumes({ "application/json" }) + public Response updateUser(@PathParam("username") String username,@Valid @NotNull User user) { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..f5c1e01d9e1 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class AdditionalPropertiesClass { + + private Map mapProperty = null; + + private Map> mapOfMapProperty = null; + + /** + * Get mapProperty + * @return mapProperty + **/ + public Map getMapProperty() { + return mapProperty; + } + + /** + * Set mapProperty + **/ + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + **/ + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + /** + * Set mapOfMapProperty + **/ + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java new file mode 100644 index 00000000000..c6f0778d346 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java @@ -0,0 +1,97 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.openapitools.server.model.SingleRefType; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class AllOfWithSingleRef { + + private String username; + + private SingleRefType singleRefType; + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + **/ + public void setUsername(String username) { + this.username = username; + } + + public AllOfWithSingleRef username(String username) { + this.username = username; + return this; + } + + /** + * Get singleRefType + * @return singleRefType + **/ + public SingleRefType getSingleRefType() { + return singleRefType; + } + + /** + * Set singleRefType + **/ + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java new file mode 100644 index 00000000000..da9c02ed0c3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Animal.java @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Cat; +import org.openapitools.server.model.Dog; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Animal { + + private String className; + + private String color = "red"; + + /** + * Get className + * @return className + **/ + @NotNull + public String getClassName() { + return className; + } + + /** + * Set className + **/ + public void setClassName(String className) { + this.className = className; + } + + public Animal className(String className) { + this.className = className; + return this; + } + + /** + * Get color + * @return color + **/ + public String getColor() { + return color; + } + + /** + * Set color + **/ + public void setColor(String color) { + this.color = color; + } + + public Animal color(String color) { + this.color = color; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..2d384db2efc --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,81 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ArrayOfArrayOfNumberOnly { + + private List> arrayArrayNumber = null; + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + /** + * Set arrayArrayNumber + **/ + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..c97f7e2b9a6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java @@ -0,0 +1,81 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ArrayOfNumberOnly { + + private List arrayNumber = null; + + /** + * Get arrayNumber + * @return arrayNumber + **/ + public List getArrayNumber() { + return arrayNumber; + } + + /** + * Set arrayNumber + **/ + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + this.arrayNumber.add(arrayNumberItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayTest.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayTest.java new file mode 100644 index 00000000000..16e36ccd741 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ArrayTest.java @@ -0,0 +1,137 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.List; +import org.openapitools.server.model.ReadOnlyFirst; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ArrayTest { + + private List arrayOfString = null; + + private List> arrayArrayOfInteger = null; + + private List> arrayArrayOfModel = null; + + /** + * Get arrayOfString + * @return arrayOfString + **/ + @Size(min=0,max=3) public List getArrayOfString() { + return arrayOfString; + } + + /** + * Set arrayOfString + **/ + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + /** + * Set arrayArrayOfInteger + **/ + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + /** + * Set arrayArrayOfModel + **/ + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Capitalization.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Capitalization.java new file mode 100644 index 00000000000..933d2f15d5f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Capitalization.java @@ -0,0 +1,191 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Capitalization { + + private String smallCamel; + + private String capitalCamel; + + private String smallSnake; + + private String capitalSnake; + + private String scAETHFlowPoints; + + /** + * Name of the pet + **/ + private String ATT_NAME; + + /** + * Get smallCamel + * @return smallCamel + **/ + public String getSmallCamel() { + return smallCamel; + } + + /** + * Set smallCamel + **/ + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + public String getCapitalCamel() { + return capitalCamel; + } + + /** + * Set capitalCamel + **/ + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + public String getSmallSnake() { + return smallSnake; + } + + /** + * Set smallSnake + **/ + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + public String getCapitalSnake() { + return capitalSnake; + } + + /** + * Set capitalSnake + **/ + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + /** + * Set scAETHFlowPoints + **/ + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + public String getATTNAME() { + return ATT_NAME; + } + + /** + * Set ATT_NAME + **/ + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java new file mode 100644 index 00000000000..78534303e0f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Cat.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Animal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Cat extends Animal { + + private Boolean declawed; + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + /** + * Set declawed + **/ + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/CatAllOf.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/CatAllOf.java new file mode 100644 index 00000000000..e04130db72b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/CatAllOf.java @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class CatAllOf { + + private Boolean declawed; + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + /** + * Set declawed + **/ + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Category.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Category.java new file mode 100644 index 00000000000..e92a984945d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Category.java @@ -0,0 +1,97 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Category { + + private Long id; + + private String name = "default-name"; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Category id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + @NotNull + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Category name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ClassModel.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ClassModel.java new file mode 100644 index 00000000000..a0b5f1b7eb0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ClassModel.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Model for testing model with \"_class\" property + **/ + +public class ClassModel { + + private String propertyClass; + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + **/ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Client.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Client.java new file mode 100644 index 00000000000..522166364ae --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Client.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Client { + + private String client; + + /** + * Get client + * @return client + **/ + public String getClient() { + return client; + } + + /** + * Set client + **/ + public void setClient(String client) { + this.client = client; + } + + public Client client(String client) { + this.client = client; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/DeprecatedObject.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/DeprecatedObject.java new file mode 100644 index 00000000000..0ea4aa39023 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/DeprecatedObject.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class DeprecatedObject { + + private String name; + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public DeprecatedObject name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Dog.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Dog.java new file mode 100644 index 00000000000..e0f8e5a79b4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Dog.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Animal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Dog extends Animal { + + private String breed; + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + /** + * Set breed + **/ + public void setBreed(String breed) { + this.breed = breed; + } + + public Dog breed(String breed) { + this.breed = breed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/DogAllOf.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/DogAllOf.java new file mode 100644 index 00000000000..6055672091e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/DogAllOf.java @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class DogAllOf { + + private String breed; + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + /** + * Set breed + **/ + public void setBreed(String breed) { + this.breed = breed; + } + + public DogAllOf breed(String breed) { + this.breed = breed; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumArrays.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumArrays.java new file mode 100644 index 00000000000..9247c5b3309 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumArrays.java @@ -0,0 +1,199 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class EnumArrays { + +public enum JustSymbolEnum { + + GREATER_THAN_OR_EQUAL_TO(String.valueOf(">=")), DOLLAR(String.valueOf("$")); + + + private String value; + + JustSymbolEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static JustSymbolEnum fromString(String s) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private JustSymbolEnum justSymbol; + +public enum ArrayEnumEnum { + + FISH(String.valueOf("fish")), CRAB(String.valueOf("crab")); + + + private String value; + + ArrayEnumEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static ArrayEnumEnum fromString(String s) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private List arrayEnum = null; + + /** + * Get justSymbol + * @return justSymbol + **/ + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + /** + * Set justSymbol + **/ + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + public List getArrayEnum() { + return arrayEnum; + } + + /** + * Set arrayEnum + **/ + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + this.arrayEnum.add(arrayEnumItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumClass.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumClass.java new file mode 100644 index 00000000000..dcd8482b869 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumClass.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumClass fromString(String s) { + for (EnumClass b : EnumClass.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumTest.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumTest.java new file mode 100644 index 00000000000..c5054303fc5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/EnumTest.java @@ -0,0 +1,431 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.OuterEnum; +import org.openapitools.server.model.OuterEnumDefaultValue; +import org.openapitools.server.model.OuterEnumInteger; +import org.openapitools.server.model.OuterEnumIntegerDefaultValue; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class EnumTest { + +public enum EnumStringEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + private String value; + + EnumStringEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumStringEnum fromString(String s) { + for (EnumStringEnum b : EnumStringEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private EnumStringEnum enumString; + +public enum EnumStringRequiredEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")), EMPTY(String.valueOf("")); + + + private String value; + + EnumStringRequiredEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumStringRequiredEnum fromString(String s) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private EnumStringRequiredEnum enumStringRequired; + +public enum EnumIntegerEnum { + + NUMBER_1(Integer.valueOf(1)), NUMBER_MINUS_1(Integer.valueOf(-1)); + + + private Integer value; + + EnumIntegerEnum (Integer v) { + value = v; + } + + public Integer value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumIntegerEnum fromString(String s) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private EnumIntegerEnum enumInteger; + +public enum EnumNumberEnum { + + NUMBER_1_DOT_1(Double.valueOf(1.1)), NUMBER_MINUS_1_DOT_2(Double.valueOf(-1.2)); + + + private Double value; + + EnumNumberEnum (Double v) { + value = v; + } + + public Double value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into Double, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static EnumNumberEnum fromString(String s) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private EnumNumberEnum enumNumber; + + private OuterEnum outerEnum; + + private OuterEnumInteger outerEnumInteger; + + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + /** + * Get enumString + * @return enumString + **/ + public EnumStringEnum getEnumString() { + return enumString; + } + + /** + * Set enumString + **/ + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @NotNull + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + /** + * Set enumStringRequired + **/ + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + /** + * Set enumInteger + **/ + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + /** + * Set enumNumber + **/ + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + public OuterEnum getOuterEnum() { + return outerEnum; + } + + /** + * Set outerEnum + **/ + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + **/ + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + /** + * Set outerEnumInteger + **/ + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + **/ + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + /** + * Set outerEnumDefaultValue + **/ + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + **/ + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + /** + * Set outerEnumIntegerDefaultValue + **/ + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java new file mode 100644 index 00000000000..090b7752f40 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.List; +import org.openapitools.server.model.ModelFile; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class FileSchemaTestClass { + + private ModelFile _file; + + private List files = null; + + /** + * Get _file + * @return _file + **/ + public ModelFile getFile() { + return _file; + } + + /** + * Set _file + **/ + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; + return this; + } + + /** + * Get files + * @return files + **/ + public List getFiles() { + return files; + } + + /** + * Set files + **/ + public void setFiles(List files) { + this.files = files; + } + + public FileSchemaTestClass files(List files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + this.files.add(filesItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Foo.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Foo.java new file mode 100644 index 00000000000..66c97424c43 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Foo.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Foo { + + private String bar = "bar"; + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + /** + * Set bar + **/ + public void setBar(String bar) { + this.bar = bar; + } + + public Foo bar(String bar) { + this.bar = bar; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java new file mode 100644 index 00000000000..2536010aaeb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.server.model.Foo; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class FooGetDefaultResponse { + + private Foo string; + + /** + * Get string + * @return string + **/ + public Foo getString() { + return string; + } + + /** + * Set string + **/ + public void setString(Foo string) { + this.string = string; + } + + public FooGetDefaultResponse string(Foo string) { + this.string = string; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FormatTest.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FormatTest.java new file mode 100644 index 00000000000..ceb79d014d5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/FormatTest.java @@ -0,0 +1,444 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class FormatTest { + + private Integer integer; + + private Integer int32; + + private Long int64; + + private BigDecimal number; + + private Float _float; + + private Double _double; + + private BigDecimal decimal; + + private String string; + + private byte[] _byte; + + private File binary; + + private LocalDate date; + + private OffsetDateTime dateTime; + + private UUID uuid; + + private String password; + + /** + * A string that is a 10 digit number. Can have leading zeros. + **/ + private String patternWithDigits; + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + **/ + private String patternWithDigitsAndDelimiter; + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @Min(10) @Max(100) public Integer getInteger() { + return integer; + } + + /** + * Set integer + **/ + public void setInteger(Integer integer) { + this.integer = integer; + } + + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + @Min(20) @Max(200) public Integer getInt32() { + return int32; + } + + /** + * Set int32 + **/ + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + public Long getInt64() { + return int64; + } + + /** + * Set int64 + **/ + public void setInt64(Long int64) { + this.int64 = int64; + } + + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + @NotNull + @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { + return number; + } + + /** + * Set number + **/ + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTest number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { + return _float; + } + + /** + * Set _float + **/ + public void setFloat(Float _float) { + this._float = _float; + } + + public FormatTest _float(Float _float) { + this._float = _float; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { + return _double; + } + + /** + * Set _double + **/ + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest _double(Double _double) { + this._double = _double; + return this; + } + + /** + * Get decimal + * @return decimal + **/ + public BigDecimal getDecimal() { + return decimal; + } + + /** + * Set decimal + **/ + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTest decimal(BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get string + * @return string + **/ + @Pattern(regexp="/[a-z]/i") public String getString() { + return string; + } + + /** + * Set string + **/ + public void setString(String string) { + this.string = string; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @NotNull + public byte[] getByte() { + return _byte; + } + + /** + * Set _byte + **/ + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get binary + * @return binary + **/ + public File getBinary() { + return binary; + } + + /** + * Set binary + **/ + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest binary(File binary) { + this.binary = binary; + return this; + } + + /** + * Get date + * @return date + **/ + @NotNull + public LocalDate getDate() { + return date; + } + + /** + * Set date + **/ + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Set dateTime + **/ + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get password + * @return password + **/ + @NotNull + @Size(min=10,max=64) public String getPassword() { + return password; + } + + /** + * Set password + **/ + public void setPassword(String password) { + this.password = password; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + **/ + @Pattern(regexp="^\\d{10}$") public String getPatternWithDigits() { + return patternWithDigits; + } + + /** + * Set patternWithDigits + **/ + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + public FormatTest patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + **/ + @Pattern(regexp="/^image_\\d{1,3}$/i") public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + /** + * Set patternWithDigitsAndDelimiter + **/ + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..82f9d533067 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java @@ -0,0 +1,89 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class HasOnlyReadOnly { + + private String bar; + + private String foo; + + public HasOnlyReadOnly() { + } + + @JsonCreator + public HasOnlyReadOnly( + + @JsonProperty(value="bar") String bar, + + @JsonProperty(value="foo") String foo + ) { + this.bar = bar; + this.foo = foo; + } + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get foo + * @return foo + **/ + public String getFoo() { + return foo; + } + + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/HealthCheckResult.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/HealthCheckResult.java new file mode 100644 index 00000000000..7ac79cd6f90 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/HealthCheckResult.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.openapitools.jackson.nullable.JsonNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + **/ + +public class HealthCheckResult { + + private String nullableMessage; + + /** + * Get nullableMessage + * @return nullableMessage + **/ + public String getNullableMessage() { + return nullableMessage; + } + + /** + * Set nullableMessage + **/ + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/MapTest.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/MapTest.java new file mode 100644 index 00000000000..c36c7ee0cc4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/MapTest.java @@ -0,0 +1,213 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class MapTest { + + private Map> mapMapOfString = null; + +public enum InnerEnum { + + UPPER(String.valueOf("UPPER")), LOWER(String.valueOf("lower")); + + + private String value; + + InnerEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static InnerEnum fromString(String s) { + for (InnerEnum b : InnerEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private Map mapOfEnumString = null; + + private Map directMap = null; + + private Map indirectMap = null; + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + public Map> getMapMapOfString() { + return mapMapOfString; + } + + /** + * Set mapMapOfString + **/ + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + /** + * Set mapOfEnumString + **/ + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + public Map getDirectMap() { + return directMap; + } + + /** + * Set directMap + **/ + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + public Map getIndirectMap() { + return indirectMap; + } + + /** + * Set indirectMap + **/ + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + this.indirectMap.put(key, indirectMapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..1d04eaf6c94 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,129 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.server.model.Animal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class MixedPropertiesAndAdditionalPropertiesClass { + + private UUID uuid; + + private OffsetDateTime dateTime; + + private Map map = null; + + /** + * Get uuid + * @return uuid + **/ + public UUID getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Set dateTime + **/ + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get map + * @return map + **/ + public Map getMap() { + return map; + } + + /** + * Set map + **/ + public void setMap(Map map) { + this.map = map; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + this.map.put(key, mapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Model200Response.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Model200Response.java new file mode 100644 index 00000000000..a091e534c32 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Model200Response.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Model for testing model name starting with number + **/ + +public class Model200Response { + + private Integer name; + + private String propertyClass; + + /** + * Get name + * @return name + **/ + public Integer getName() { + return name; + } + + /** + * Set name + **/ + public void setName(Integer name) { + this.name = name; + } + + public Model200Response name(Integer name) { + this.name = name; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + public String getPropertyClass() { + return propertyClass; + } + + /** + * Set propertyClass + **/ + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelApiResponse.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelApiResponse.java new file mode 100644 index 00000000000..9d01d1753e1 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelApiResponse.java @@ -0,0 +1,120 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ModelApiResponse { + + private Integer code; + + private String type; + + private String message; + + /** + * Get code + * @return code + **/ + public Integer getCode() { + return code; + } + + /** + * Set code + **/ + public void setCode(Integer code) { + this.code = code; + } + + public ModelApiResponse code(Integer code) { + this.code = code; + return this; + } + + /** + * Get type + * @return type + **/ + public String getType() { + return type; + } + + /** + * Set type + **/ + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse type(String type) { + this.type = type; + return this; + } + + /** + * Get message + * @return message + **/ + public String getMessage() { + return message; + } + + /** + * Set message + **/ + public void setMessage(String message) { + this.message = message; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelFile.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelFile.java new file mode 100644 index 00000000000..432f843889c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelFile.java @@ -0,0 +1,80 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Must be named `File` for test. + **/ + +public class ModelFile { + + /** + * Test capitalization + **/ + private String sourceURI; + + /** + * Test capitalization + * @return sourceURI + **/ + public String getSourceURI() { + return sourceURI; + } + + /** + * Set sourceURI + **/ + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelList.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelList.java new file mode 100644 index 00000000000..a8e0e3a4b0b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelList.java @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ModelList { + + private String _123list; + + /** + * Get _123list + * @return _123list + **/ + public String get123list() { + return _123list; + } + + /** + * Set _123list + **/ + public void set123list(String _123list) { + this._123list = _123list; + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelReturn.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelReturn.java new file mode 100644 index 00000000000..c37c75a2bf2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ModelReturn.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Model for testing reserved words + **/ + +public class ModelReturn { + + private Integer _return; + + /** + * Get _return + * @return _return + **/ + public Integer getReturn() { + return _return; + } + + /** + * Set _return + **/ + public void setReturn(Integer _return) { + this._return = _return; + } + + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Name.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Name.java new file mode 100644 index 00000000000..bb51b809742 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Name.java @@ -0,0 +1,138 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Model for testing model name same as property name + **/ + +public class Name { + + private Integer name; + + private Integer snakeCase; + + private String property; + + private Integer _123number; + + public Name() { + } + + @JsonCreator + public Name( + + @JsonProperty(value="snake_case") Integer snakeCase, + + @JsonProperty(value="123Number") Integer _123number + ) { + this.snakeCase = snakeCase; + this._123number = _123number; + } + + /** + * Get name + * @return name + **/ + @NotNull + public Integer getName() { + return name; + } + + /** + * Set name + **/ + public void setName(Integer name) { + this.name = name; + } + + public Name name(Integer name) { + this.name = name; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + **/ + public Integer getSnakeCase() { + return snakeCase; + } + + + /** + * Get property + * @return property + **/ + public String getProperty() { + return property; + } + + /** + * Set property + **/ + public void setProperty(String property) { + this.property = property; + } + + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get _123number + * @return _123number + **/ + public Integer get123number() { + return _123number; + } + + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/NullableClass.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/NullableClass.java new file mode 100644 index 00000000000..69e3053bea9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/NullableClass.java @@ -0,0 +1,364 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class NullableClass extends HashMap { + + private Integer integerProp; + + private BigDecimal numberProp; + + private Boolean booleanProp; + + private String stringProp; + + private LocalDate dateProp; + + private OffsetDateTime datetimeProp; + + private List arrayNullableProp = null; + + private List arrayAndItemsNullableProp = null; + + private List arrayItemsNullable = null; + + private Map objectNullableProp = null; + + private Map objectAndItemsNullableProp = null; + + private Map objectItemsNullable = null; + + /** + * Get integerProp + * @return integerProp + **/ + public Integer getIntegerProp() { + return integerProp; + } + + /** + * Set integerProp + **/ + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + public NullableClass integerProp(Integer integerProp) { + this.integerProp = integerProp; + return this; + } + + /** + * Get numberProp + * @return numberProp + **/ + public BigDecimal getNumberProp() { + return numberProp; + } + + /** + * Set numberProp + **/ + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + return this; + } + + /** + * Get booleanProp + * @return booleanProp + **/ + public Boolean getBooleanProp() { + return booleanProp; + } + + /** + * Set booleanProp + **/ + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + return this; + } + + /** + * Get stringProp + * @return stringProp + **/ + public String getStringProp() { + return stringProp; + } + + /** + * Set stringProp + **/ + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + public NullableClass stringProp(String stringProp) { + this.stringProp = stringProp; + return this; + } + + /** + * Get dateProp + * @return dateProp + **/ + public LocalDate getDateProp() { + return dateProp; + } + + /** + * Set dateProp + **/ + public void setDateProp(LocalDate dateProp) { + this.dateProp = dateProp; + } + + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = dateProp; + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + **/ + public OffsetDateTime getDatetimeProp() { + return datetimeProp; + } + + /** + * Set datetimeProp + **/ + public void setDatetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public NullableClass datetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + **/ + public List getArrayNullableProp() { + return arrayNullableProp; + } + + /** + * Set arrayNullableProp + **/ + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + **/ + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + /** + * Set arrayAndItemsNullableProp + **/ + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + **/ + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + /** + * Set arrayItemsNullable + **/ + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + **/ + public Map getObjectNullableProp() { + return objectNullableProp; + } + + /** + * Set objectNullableProp + **/ + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + **/ + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + /** + * Set objectAndItemsNullableProp + **/ + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + **/ + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + /** + * Set objectItemsNullable + **/ + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/NumberOnly.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/NumberOnly.java new file mode 100644 index 00000000000..e0761ba551b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/NumberOnly.java @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class NumberOnly { + + private BigDecimal justNumber; + + /** + * Get justNumber + * @return justNumber + **/ + public BigDecimal getJustNumber() { + return justNumber; + } + + /** + * Set justNumber + **/ + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java new file mode 100644 index 00000000000..004f80020d4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,157 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.server.model.DeprecatedObject; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ObjectWithDeprecatedFields { + + private String uuid; + + private BigDecimal id; + + private DeprecatedObject deprecatedRef; + + private List bars = null; + + /** + * Get uuid + * @return uuid + **/ + public String getUuid() { + return uuid; + } + + /** + * Set uuid + **/ + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public ObjectWithDeprecatedFields uuid(String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get id + * @return id + * @deprecated + **/ + @Deprecated + public BigDecimal getId() { + return id; + } + + /** + * Set id + **/ + public void setId(BigDecimal id) { + this.id = id; + } + + public ObjectWithDeprecatedFields id(BigDecimal id) { + this.id = id; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + **/ + @Deprecated + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + /** + * Set deprecatedRef + **/ + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + **/ + @Deprecated + public List getBars() { + return bars; + } + + /** + * Set bars + **/ + public void setBars(List bars) { + this.bars = bars; + } + + public ObjectWithDeprecatedFields bars(List bars) { + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + this.bars.add(barsItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Order.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Order.java new file mode 100644 index 00000000000..62b985da196 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Order.java @@ -0,0 +1,241 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Order { + + private Long id; + + private Long petId; + + private Integer quantity; + + private OffsetDateTime shipDate; + +public enum StatusEnum { + + PLACED(String.valueOf("placed")), APPROVED(String.valueOf("approved")), DELIVERED(String.valueOf("delivered")); + + + private String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static StatusEnum fromString(String s) { + for (StatusEnum b : StatusEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + /** + * Order Status + **/ + private StatusEnum status; + + private Boolean complete = false; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get petId + * @return petId + **/ + public Long getPetId() { + return petId; + } + + /** + * Set petId + **/ + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + public Integer getQuantity() { + return quantity; + } + + /** + * Set quantity + **/ + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + public OffsetDateTime getShipDate() { + return shipDate; + } + + /** + * Set shipDate + **/ + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Order Status + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + **/ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Get complete + * @return complete + **/ + public Boolean getComplete() { + return complete; + } + + /** + * Set complete + **/ + public void setComplete(Boolean complete) { + this.complete = complete; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterComposite.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterComposite.java new file mode 100644 index 00000000000..7d1630e2f52 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterComposite.java @@ -0,0 +1,120 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class OuterComposite { + + private BigDecimal myNumber; + + private String myString; + + private Boolean myBoolean; + + /** + * Get myNumber + * @return myNumber + **/ + public BigDecimal getMyNumber() { + return myNumber; + } + + /** + * Set myNumber + **/ + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myString + * @return myString + **/ + public String getMyString() { + return myString; + } + + /** + * Set myString + **/ + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myString(String myString) { + this.myString = myString; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + public Boolean getMyBoolean() { + return myBoolean; + } + + /** + * Set myBoolean + **/ + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnum.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnum.java new file mode 100644 index 00000000000..771c8a4c8f7 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnum.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnum fromString(String s) { + for (OuterEnum b : OuterEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + return null; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java new file mode 100644 index 00000000000..8900e4a6bb9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumDefaultValue fromString(String s) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String value) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumInteger.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumInteger.java new file mode 100644 index 00000000000..e18841134b7 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumInteger.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumInteger fromString(String s) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(Integer value) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 00000000000..0150c204d6a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,69 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumIntegerDefaultValue fromString(String s) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(Integer value) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java new file mode 100644 index 00000000000..45002fd1d7f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.openapitools.server.model.OuterEnumInteger; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class OuterObjectWithEnumProperty { + + private OuterEnumInteger value; + + /** + * Get value + * @return value + **/ + @NotNull + public OuterEnumInteger getValue() { + return value; + } + + /** + * Set value + **/ + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + this.value = value; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Pet.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Pet.java new file mode 100644 index 00000000000..8cf6295f00f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Pet.java @@ -0,0 +1,260 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.server.model.Category; +import org.openapitools.server.model.Tag; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Pet { + + private Long id; + + private Category category; + + private String name; + + private Set photoUrls = new LinkedHashSet<>(); + + private List tags = null; + +public enum StatusEnum { + + AVAILABLE(String.valueOf("available")), PENDING(String.valueOf("pending")), SOLD(String.valueOf("sold")); + + + private String value; + + StatusEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static StatusEnum fromString(String s) { + for (StatusEnum b : StatusEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + /** + * pet status in the store + **/ + private StatusEnum status; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get category + * @return category + **/ + public Category getCategory() { + return category; + } + + /** + * Set category + **/ + public void setCategory(Category category) { + this.category = category; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get name + * @return name + **/ + @NotNull + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @NotNull + public Set getPhotoUrls() { + return photoUrls; + } + + /** + * Set photoUrls + **/ + @JsonDeserialize(as = LinkedHashSet.class) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + public List getTags() { + return tags; + } + + /** + * Set tags + **/ + public void setTags(List tags) { + this.tags = tags; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * pet status in the store + * @return status + **/ + public StatusEnum getStatus() { + return status; + } + + /** + * Set status + **/ + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..3294db20f65 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class ReadOnlyFirst { + + private String bar; + + private String baz; + + public ReadOnlyFirst() { + } + + @JsonCreator + public ReadOnlyFirst( + + @JsonProperty(value="bar") String bar + ) { + this.bar = bar; + } + + /** + * Get bar + * @return bar + **/ + public String getBar() { + return bar; + } + + + /** + * Get baz + * @return baz + **/ + public String getBaz() { + return baz; + } + + /** + * Set baz + **/ + public void setBaz(String baz) { + this.baz = baz; + } + + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SingleRefType.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SingleRefType.java new file mode 100644 index 00000000000..9442b2914d2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SingleRefType.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static SingleRefType fromString(String s) { + for (SingleRefType b : SingleRefType.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String value) { + for (SingleRefType b : SingleRefType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialModelName.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialModelName.java new file mode 100644 index 00000000000..333b4dd35ca --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/SpecialModelName.java @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class SpecialModelName { + + private Long $specialPropertyName; + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + /** + * Set $specialPropertyName + **/ + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Tag.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Tag.java new file mode 100644 index 00000000000..3be9794db14 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/Tag.java @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class Tag { + + private Long id; + + private String name; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public Tag id(Long id) { + this.id = id; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + /** + * Set name + **/ + public void setName(String name) { + this.name = name; + } + + public Tag name(String name) { + this.name = name; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/User.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/User.java new file mode 100644 index 00000000000..07ab5974ee5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/model/User.java @@ -0,0 +1,237 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; + + +public class User { + + private Long id; + + private String username; + + private String firstName; + + private String lastName; + + private String email; + + private String password; + + private String phone; + + /** + * User Status + **/ + private Integer userStatus; + + /** + * Get id + * @return id + **/ + public Long getId() { + return id; + } + + /** + * Set id + **/ + public void setId(Long id) { + this.id = id; + } + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get username + * @return username + **/ + public String getUsername() { + return username; + } + + /** + * Set username + **/ + public void setUsername(String username) { + this.username = username; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + public String getFirstName() { + return firstName; + } + + /** + * Set firstName + **/ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + public String getLastName() { + return lastName; + } + + /** + * Set lastName + **/ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get email + * @return email + **/ + public String getEmail() { + return email; + } + + /** + * Set email + **/ + public void setEmail(String email) { + this.email = email; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get password + * @return password + **/ + public String getPassword() { + return password; + } + + /** + * Set password + **/ + public void setPassword(String password) { + this.password = password; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get phone + * @return phone + **/ + public String getPhone() { + return phone; + } + + /** + * Set phone + **/ + public void setPhone(String phone) { + this.phone = phone; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * User Status + * @return userStatus + **/ + public Integer getUserStatus() { + return userStatus; + } + + /** + * Set userStatus + **/ + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/package-info.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/package-info.java new file mode 100644 index 00000000000..1025e91aed8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/package-info.java @@ -0,0 +1 @@ +package org.openapitools.server; \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/beans.xml b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/beans.xml new file mode 100644 index 00000000000..125ef995e5e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/beans.xml @@ -0,0 +1,9 @@ + + + + diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/microprofile-config.properties b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/microprofile-config.properties new file mode 100644 index 00000000000..38988f20e5e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/microprofile-config.properties @@ -0,0 +1,11 @@ +# Microprofile server properties + +# Application properties. This is the default greeting +app.greeting=Hello + +# Microprofile server properties +server.port=8080 +server.host=0.0.0.0 + +# Enable the optional MicroProfile Metrics REST.request metrics +metrics.rest-request.enabled=true diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml new file mode 100644 index 00000000000..a599f08c0f9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/resources/META-INF/openapi.yml @@ -0,0 +1,2168 @@ +openapi: 3.0.0 +info: + description: "This spec is mainly for testing Petstore server and contains fake\ + \ endpoints, models. Please do not use this for any other purpose. Special characters:\ + \ \" \\" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_varaible +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + x-accepts: application/json + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-content-type: application/json + x-accepts: application/json + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: Successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-webclient-blocking: true + x-content-type: application/json + x-accepts: application/json + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + - description: test server with variables + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + description: target server + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-webclient-blocking: true + x-accepts: application/json + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-webclient-blocking: true + x-accepts: application/json + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + description: Successful operation + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-webclient-blocking: true + x-accepts: application/json + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-content-type: multipart/form-data + x-accepts: application/json + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-content-type: application/json + x-accepts: application/json + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: application/json + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + x-content-type: application/json + x-accepts: application/json + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: application/json + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: application/json + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + x-accepts: application/json + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + x-content-type: application/json + x-accepts: application/json + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-content-type: application/json + x-accepts: application/json + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Someting wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: application/json + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + - explode: true + in: query + name: enum_query_model_array + required: false + schema: + items: + $ref: '#/components/schemas/EnumClass' + type: array + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-content-type: application/json + x-accepts: application/json + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-content-type: application/json + x-accepts: '*/*' + /fake/property/enum-int: + post: + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Input enum (int) as post body + required: true + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Output enum (int) + tags: + - fake + x-content-type: application/json + x-accepts: '*/*' + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-content-type: application/json + x-accepts: '*/*' + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-content-type: application/json + x-accepts: '*/*' + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-content-type: application/json + x-accepts: '*/*' + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: application/json + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-content-type: application/json + x-accepts: application/json + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request must reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: application/json + /fake/body-with-binary: + put: + description: "For this test, the body has to be a binary file." + operationId: testBodyWithBinary + requestBody: + content: + image/png: + schema: + format: binary + nullable: true + type: string + description: image to upload + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: image/png + x-accepts: application/json + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: pipeDelimited + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: language + required: false + schema: + additionalProperties: + format: string + type: string + type: object + style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: application/json + /fake/{petId}/uploadImageWithRequiredFile: + post: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-content-type: multipart/form-data + x-accepts: application/json + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: application/json + /fake/http-signature-test: + get: + operationId: fake-http-signature-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - http_signature_test: [] + summary: test http signature authentication + tags: + - fake + x-content-type: application/json + x-accepts: application/json +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Cat_allOf' + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + maxItems: 3 + minItems: 0 + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + example: 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + OuterObjectWithEnumProperty: + example: + value: 2 + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + required: + - value + type: object + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + AllOfWithSingleRef: + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + type: object + SingleRefType: + enum: + - admin + - user + title: SingleRefType + type: string + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + Dog_allOf: + properties: + breed: + type: string + type: object + example: null + Cat_allOf: + properties: + declawed: + type: boolean + type: object + example: null + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/resources/logging.properties b/samples/server/petstore/java-helidon-server/mp/src/main/resources/logging.properties new file mode 100644 index 00000000000..cd238eb6615 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/main/resources/logging.properties @@ -0,0 +1,19 @@ + +# Example Logging Configuration File +# For more information see $JAVA_HOME/jre/lib/logging.properties + +# Send messages to the console +handlers=io.helidon.common.HelidonConsoleHandler + +# HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n + +# Global logging level. Can be overridden by specific loggers +.level=INFO + +# Component specific log levels +#io.helidon.webserver.level=INFO +#io.helidon.config.level=INFO +#io.helidon.security.level=INFO +#io.helidon.common.level=INFO +#io.netty.level=INFO diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..87b0cf9126e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AdditionalPropertiesClass + */ +public class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + public void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + public void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + public void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java new file mode 100644 index 00000000000..83a14ba8273 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.openapitools.server.model.SingleRefType; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AllOfWithSingleRef + */ +public class AllOfWithSingleRefTest { + private final AllOfWithSingleRef model = new AllOfWithSingleRef(); + + /** + * Model tests for AllOfWithSingleRef + */ + @Test + public void testAllOfWithSingleRef() { + // TODO: test AllOfWithSingleRef + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'singleRefType' + */ + @Test + public void singleRefTypeTest() { + // TODO: test singleRefType + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AnimalTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AnimalTest.java new file mode 100644 index 00000000000..1299d46ba6f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/AnimalTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Cat; +import org.openapitools.server.model.Dog; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Animal + */ +public class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + public void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..d67cac0b059 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,43 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +public class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + public void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + public void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..150ba7b070d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,43 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayOfNumberOnly + */ +public class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + public void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + public void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java new file mode 100644 index 00000000000..a2d4f750e1c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ArrayTestTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.List; +import org.openapitools.server.model.ReadOnlyFirst; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayTest + */ +public class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + public void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + public void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + public void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + public void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java new file mode 100644 index 00000000000..084a2885fc8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CapitalizationTest.java @@ -0,0 +1,80 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Capitalization + */ +public class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + public void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + public void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + public void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + public void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + public void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + public void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + public void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CatAllOfTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CatAllOfTest.java new file mode 100644 index 00000000000..ab121c24d90 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CatAllOfTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CatAllOf + */ +public class CatAllOfTest { + private final CatAllOf model = new CatAllOf(); + + /** + * Model tests for CatAllOf + */ + @Test + public void testCatAllOf() { + // TODO: test CatAllOf + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CatTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CatTest.java new file mode 100644 index 00000000000..121dcc9756d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CatTest.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Animal; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Cat + */ +public class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + public void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CategoryTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CategoryTest.java new file mode 100644 index 00000000000..2618c8fd934 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/CategoryTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Category + */ +public class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + public void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java new file mode 100644 index 00000000000..f62de6d1cc0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClassModelTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ClassModel + */ +public class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + public void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClientTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClientTest.java new file mode 100644 index 00000000000..a9f4c21ebf8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ClientTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Client + */ +public class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + public void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + public void clientTest() { + // TODO: test client + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java new file mode 100644 index 00000000000..9ad380437ce --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeprecatedObject + */ +public class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + public void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DogAllOfTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DogAllOfTest.java new file mode 100644 index 00000000000..2759c9a2eb9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DogAllOfTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DogAllOf + */ +public class DogAllOfTest { + private final DogAllOf model = new DogAllOf(); + + /** + * Model tests for DogAllOf + */ + @Test + public void testDogAllOf() { + // TODO: test DogAllOf + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DogTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DogTest.java new file mode 100644 index 00000000000..70765267f0a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/DogTest.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Animal; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Dog + */ +public class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + public void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java new file mode 100644 index 00000000000..42b3832090e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumArraysTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EnumArrays + */ +public class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + public void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + public void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + public void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java new file mode 100644 index 00000000000..9c02e17dac0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumClassTest.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EnumClass + */ +public class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + public void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java new file mode 100644 index 00000000000..7c95fed8bb8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/EnumTestTest.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.OuterEnum; +import org.openapitools.server.model.OuterEnumDefaultValue; +import org.openapitools.server.model.OuterEnumInteger; +import org.openapitools.server.model.OuterEnumIntegerDefaultValue; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EnumTest + */ +public class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + public void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + public void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + public void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + public void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + public void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + public void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + public void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + public void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + public void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java new file mode 100644 index 00000000000..fbabc01db3c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.List; +import org.openapitools.server.model.ModelFile; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FileSchemaTestClass + */ +public class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + public void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property '_file' + */ + @Test + public void _fileTest() { + // TODO: test _file + } + + /** + * Test the property 'files' + */ + @Test + public void filesTest() { + // TODO: test files + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java new file mode 100644 index 00000000000..d0dc33cef52 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java @@ -0,0 +1,42 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.server.model.Foo; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FooGetDefaultResponse + */ +public class FooGetDefaultResponseTest { + private final FooGetDefaultResponse model = new FooGetDefaultResponse(); + + /** + * Model tests for FooGetDefaultResponse + */ + @Test + public void testFooGetDefaultResponse() { + // TODO: test FooGetDefaultResponse + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooTest.java new file mode 100644 index 00000000000..39abe05aad6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FooTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Foo + */ +public class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + public void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java new file mode 100644 index 00000000000..5d988452964 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/FormatTestTest.java @@ -0,0 +1,166 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FormatTest + */ +public class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + public void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + public void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + public void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + public void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + public void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + public void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + public void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + public void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java new file mode 100644 index 00000000000..5a56ddcc24d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasOnlyReadOnly + */ +public class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + public void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + public void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java new file mode 100644 index 00000000000..be4be735e57 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HealthCheckResult + */ +public class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + public void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + public void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MapTestTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MapTestTest.java new file mode 100644 index 00000000000..3c6c9450be3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MapTestTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for MapTest + */ +public class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + public void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + public void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + public void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + public void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + public void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..9b15f918a9b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.server.model.Animal; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +public class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + public void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + public void mapTest() { + // TODO: test map + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java new file mode 100644 index 00000000000..33b6d47572d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/Model200ResponseTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Model200Response + */ +public class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + public void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java new file mode 100644 index 00000000000..43cb48513cf --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelApiResponse + */ +public class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + public void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java new file mode 100644 index 00000000000..ff03280b7e5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelFileTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelListTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelListTest.java new file mode 100644 index 00000000000..7f228b19133 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelListTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java new file mode 100644 index 00000000000..e6af66eb003 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ModelReturnTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelReturn + */ +public class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + public void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + public void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NameTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NameTest.java new file mode 100644 index 00000000000..13114ab4e7a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NameTest.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Name + */ +public class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + public void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + public void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + public void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + public void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java new file mode 100644 index 00000000000..e2f2dd91bf7 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NullableClassTest.java @@ -0,0 +1,136 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NullableClass + */ +public class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + public void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + public void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + public void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + public void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + public void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + public void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + public void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + public void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + public void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + public void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + public void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + public void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + public void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java new file mode 100644 index 00000000000..dede232a8fa --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/NumberOnlyTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NumberOnly + */ +public class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + public void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + public void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 00000000000..55cf9bedb07 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.server.model.DeprecatedObject; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ObjectWithDeprecatedFields + */ +public class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + public void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + public void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + public void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OrderTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OrderTest.java new file mode 100644 index 00000000000..90607655525 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OrderTest.java @@ -0,0 +1,83 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Order + */ +public class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + public void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + public void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + public void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + public void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + public void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java new file mode 100644 index 00000000000..f61dfbaf415 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterCompositeTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterComposite + */ +public class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + public void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + public void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + public void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + public void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java new file mode 100644 index 00000000000..55d00b4918c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnumDefaultValue + */ +public class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + public void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 00000000000..6a5e46c6124 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +public class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + public void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java new file mode 100644 index 00000000000..d6c32e321da --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnumInteger + */ +public class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + public void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java new file mode 100644 index 00000000000..5ea29d21383 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterEnumTest.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnum + */ +public class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + public void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 00000000000..d40c868a41b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.openapitools.server.model.OuterEnumInteger; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterObjectWithEnumProperty + */ +public class OuterObjectWithEnumPropertyTest { + private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); + + /** + * Model tests for OuterObjectWithEnumProperty + */ + @Test + public void testOuterObjectWithEnumProperty() { + // TODO: test OuterObjectWithEnumProperty + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/PetTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/PetTest.java new file mode 100644 index 00000000000..bc913dd50a3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/PetTest.java @@ -0,0 +1,89 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.server.model.Category; +import org.openapitools.server.model.Tag; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Pet + */ +public class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + public void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java new file mode 100644 index 00000000000..2fe4c7fc6b7 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ReadOnlyFirst + */ +public class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + public void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + public void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java new file mode 100644 index 00000000000..4ae2c23f4cb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SingleRefType + */ +public class SingleRefTypeTest { + /** + * Model tests for SingleRefType + */ + @Test + public void testSingleRefType() { + // TODO: test SingleRefType + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java new file mode 100644 index 00000000000..809e043f8ec --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialModelName + */ +public class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + public void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + public void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/TagTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/TagTest.java new file mode 100644 index 00000000000..4d0d708bf97 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/TagTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Tag + */ +public class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + public void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/UserTest.java b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/UserTest.java new file mode 100644 index 00000000000..ba936a20805 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/mp/src/test/java/org/openapitools/server/model/UserTest.java @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + public void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + public void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + public void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + public void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/.openapi-generator-ignore b/samples/server/petstore/java-helidon-server/se/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES new file mode 100644 index 00000000000..7d452a07dfb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES @@ -0,0 +1,122 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/server/Main.java +src/main/java/org/openapitools/server/RFC3339DateFormat.java +src/main/java/org/openapitools/server/api/AnotherFakeService.java +src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java +src/main/java/org/openapitools/server/api/DefaultService.java +src/main/java/org/openapitools/server/api/DefaultServiceImpl.java +src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java +src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java +src/main/java/org/openapitools/server/api/FakeService.java +src/main/java/org/openapitools/server/api/FakeServiceImpl.java +src/main/java/org/openapitools/server/api/JsonProvider.java +src/main/java/org/openapitools/server/api/PetService.java +src/main/java/org/openapitools/server/api/PetServiceImpl.java +src/main/java/org/openapitools/server/api/StoreService.java +src/main/java/org/openapitools/server/api/StoreServiceImpl.java +src/main/java/org/openapitools/server/api/UserService.java +src/main/java/org/openapitools/server/api/UserServiceImpl.java +src/main/java/org/openapitools/server/api/ValidatorUtils.java +src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java +src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java +src/main/java/org/openapitools/server/model/Animal.java +src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java +src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java +src/main/java/org/openapitools/server/model/ArrayTest.java +src/main/java/org/openapitools/server/model/Capitalization.java +src/main/java/org/openapitools/server/model/Cat.java +src/main/java/org/openapitools/server/model/CatAllOf.java +src/main/java/org/openapitools/server/model/Category.java +src/main/java/org/openapitools/server/model/ClassModel.java +src/main/java/org/openapitools/server/model/Client.java +src/main/java/org/openapitools/server/model/DeprecatedObject.java +src/main/java/org/openapitools/server/model/Dog.java +src/main/java/org/openapitools/server/model/DogAllOf.java +src/main/java/org/openapitools/server/model/EnumArrays.java +src/main/java/org/openapitools/server/model/EnumClass.java +src/main/java/org/openapitools/server/model/EnumTest.java +src/main/java/org/openapitools/server/model/FileSchemaTestClass.java +src/main/java/org/openapitools/server/model/Foo.java +src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java +src/main/java/org/openapitools/server/model/FormatTest.java +src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java +src/main/java/org/openapitools/server/model/HealthCheckResult.java +src/main/java/org/openapitools/server/model/MapTest.java +src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java +src/main/java/org/openapitools/server/model/Model200Response.java +src/main/java/org/openapitools/server/model/ModelApiResponse.java +src/main/java/org/openapitools/server/model/ModelFile.java +src/main/java/org/openapitools/server/model/ModelList.java +src/main/java/org/openapitools/server/model/ModelReturn.java +src/main/java/org/openapitools/server/model/Name.java +src/main/java/org/openapitools/server/model/NullableClass.java +src/main/java/org/openapitools/server/model/NumberOnly.java +src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java +src/main/java/org/openapitools/server/model/Order.java +src/main/java/org/openapitools/server/model/OuterComposite.java +src/main/java/org/openapitools/server/model/OuterEnum.java +src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java +src/main/java/org/openapitools/server/model/OuterEnumInteger.java +src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java +src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java +src/main/java/org/openapitools/server/model/Pet.java +src/main/java/org/openapitools/server/model/ReadOnlyFirst.java +src/main/java/org/openapitools/server/model/SingleRefType.java +src/main/java/org/openapitools/server/model/SpecialModelName.java +src/main/java/org/openapitools/server/model/Tag.java +src/main/java/org/openapitools/server/model/User.java +src/main/java/org/openapitools/server/package-info.java +src/main/resources/META-INF/openapi.yml +src/main/resources/application.yaml +src/main/resources/logging.properties +src/test/java/org/openapitools/server/MainTest.java +src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java +src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java +src/test/java/org/openapitools/server/model/AnimalTest.java +src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java +src/test/java/org/openapitools/server/model/ArrayTestTest.java +src/test/java/org/openapitools/server/model/CapitalizationTest.java +src/test/java/org/openapitools/server/model/CatAllOfTest.java +src/test/java/org/openapitools/server/model/CatTest.java +src/test/java/org/openapitools/server/model/CategoryTest.java +src/test/java/org/openapitools/server/model/ClassModelTest.java +src/test/java/org/openapitools/server/model/ClientTest.java +src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java +src/test/java/org/openapitools/server/model/DogAllOfTest.java +src/test/java/org/openapitools/server/model/DogTest.java +src/test/java/org/openapitools/server/model/EnumArraysTest.java +src/test/java/org/openapitools/server/model/EnumClassTest.java +src/test/java/org/openapitools/server/model/EnumTestTest.java +src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java +src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java +src/test/java/org/openapitools/server/model/FooTest.java +src/test/java/org/openapitools/server/model/FormatTestTest.java +src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java +src/test/java/org/openapitools/server/model/HealthCheckResultTest.java +src/test/java/org/openapitools/server/model/MapTestTest.java +src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +src/test/java/org/openapitools/server/model/Model200ResponseTest.java +src/test/java/org/openapitools/server/model/ModelApiResponseTest.java +src/test/java/org/openapitools/server/model/ModelFileTest.java +src/test/java/org/openapitools/server/model/ModelListTest.java +src/test/java/org/openapitools/server/model/ModelReturnTest.java +src/test/java/org/openapitools/server/model/NameTest.java +src/test/java/org/openapitools/server/model/NullableClassTest.java +src/test/java/org/openapitools/server/model/NumberOnlyTest.java +src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java +src/test/java/org/openapitools/server/model/OrderTest.java +src/test/java/org/openapitools/server/model/OuterCompositeTest.java +src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java +src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java +src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java +src/test/java/org/openapitools/server/model/OuterEnumTest.java +src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java +src/test/java/org/openapitools/server/model/PetTest.java +src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java +src/test/java/org/openapitools/server/model/SingleRefTypeTest.java +src/test/java/org/openapitools/server/model/SpecialModelNameTest.java +src/test/java/org/openapitools/server/model/TagTest.java +src/test/java/org/openapitools/server/model/UserTest.java diff --git a/samples/server/petstore/java-helidon-server/se/.openapi-generator/VERSION b/samples/server/petstore/java-helidon-server/se/.openapi-generator/VERSION new file mode 100644 index 00000000000..7b7e20b5703 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/se/README.md b/samples/server/petstore/java-helidon-server/se/README.md new file mode 100644 index 00000000000..ed9e99d3ae5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/README.md @@ -0,0 +1,74 @@ +# Helidon SE Server with OpenAPI + +## Build and run + +With JDK11+ +```bash +mvn package +java -jar target/petstore-helidon-server-se.jar +``` + +## Exercise the application + +``` +curl -X PATCH http://petstore.swagger.io:80/v2/another-fake/dummy +curl -X GET http://petstore.swagger.io:80/v2/foo +curl -X GET http://petstore.swagger.io:80/v2/fake/health +curl -X GET http://petstore.swagger.io:80/v2/fake/http-signature-test +curl -X POST http://petstore.swagger.io:80/v2/fake/outer/boolean +curl -X POST http://petstore.swagger.io:80/v2/fake/outer/composite +curl -X POST http://petstore.swagger.io:80/v2/fake/outer/number +curl -X POST http://petstore.swagger.io:80/v2/fake/outer/string +curl -X POST http://petstore.swagger.io:80/v2/fake/property/enum-int +curl -X PUT http://petstore.swagger.io:80/v2/fake/body-with-binary +curl -X PUT http://petstore.swagger.io:80/v2/fake/body-with-file-schema +curl -X PUT http://petstore.swagger.io:80/v2/fake/body-with-query-params +curl -X PATCH http://petstore.swagger.io:80/v2/fake +curl -X POST http://petstore.swagger.io:80/v2/fake +curl -X GET http://petstore.swagger.io:80/v2/fake +curl -X DELETE http://petstore.swagger.io:80/v2/fake +curl -X POST http://petstore.swagger.io:80/v2/fake/inline-additionalProperties +curl -X GET http://petstore.swagger.io:80/v2/fake/jsonFormData +curl -X PUT http://petstore.swagger.io:80/v2/fake/test-query-parameters +curl -X PATCH http://petstore.swagger.io:80/v2/fake_classname_test +curl -X POST http://petstore.swagger.io:80/v2/pet +curl -X DELETE http://petstore.swagger.io:80/v2/pet/{petId} +curl -X GET http://petstore.swagger.io:80/v2/pet/findByStatus +curl -X GET http://petstore.swagger.io:80/v2/pet/findByTags +curl -X GET http://petstore.swagger.io:80/v2/pet/{petId} +curl -X PUT http://petstore.swagger.io:80/v2/pet +curl -X POST http://petstore.swagger.io:80/v2/pet/{petId} +curl -X POST http://petstore.swagger.io:80/v2/pet/{petId}/uploadImage +curl -X POST http://petstore.swagger.io:80/v2/fake/{petId}/uploadImageWithRequiredFile +curl -X DELETE http://petstore.swagger.io:80/v2/store/order/{order_id} +curl -X GET http://petstore.swagger.io:80/v2/store/inventory +curl -X GET http://petstore.swagger.io:80/v2/store/order/{order_id} +curl -X POST http://petstore.swagger.io:80/v2/store/order +curl -X POST http://petstore.swagger.io:80/v2/user +curl -X POST http://petstore.swagger.io:80/v2/user/createWithArray +curl -X POST http://petstore.swagger.io:80/v2/user/createWithList +curl -X DELETE http://petstore.swagger.io:80/v2/user/{username} +curl -X GET http://petstore.swagger.io:80/v2/user/{username} +curl -X GET http://petstore.swagger.io:80/v2/user/login +curl -X GET http://petstore.swagger.io:80/v2/user/logout +curl -X PUT http://petstore.swagger.io:80/v2/user/{username} + +``` + +## Try health and metrics + +``` +curl -s -X GET http://petstore.swagger.io:80/v2/health +{"outcome":"UP",... +. . . + +# Prometheus Format +curl -s -X GET http://petstore.swagger.io:80/v2/metrics +# TYPE base:gc_g1_young_generation_count gauge +. . . + +# JSON Format +curl -H 'Accept: application/json' -X GET http://petstore.swagger.io:80/v2/metrics +{"base":... +. . . +``` \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/se/pom.xml b/samples/server/petstore/java-helidon-server/se/pom.xml new file mode 100644 index 00000000000..cefb0fe5f86 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/pom.xml @@ -0,0 +1,103 @@ + + + 4.0.0 + + io.helidon.applications + helidon-se + 3.0.1 + + + org.openapitools + petstore-helidon-server-se + 1.0.0 + petstore-helidon-server-se + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + + org.openapitools.server.Main + 0.2.3 + + + + + jakarta.validation + jakarta.validation-api + + + io.helidon.webserver + helidon-webserver + + + io.helidon.media + helidon-media-jsonp + + + io.helidon.media + helidon-media-multipart + + + io.helidon.config + helidon-config-yaml + + + io.helidon.health + helidon-health + + + io.helidon.health + helidon-health-checks + + + io.helidon.metrics + helidon-metrics + + + io.helidon.openapi + helidon-openapi + + + org.openapitools + jackson-databind-nullable + ${version.jackson.databind.nullable} + + + io.helidon.media + helidon-media-jackson + + + org.junit.jupiter + junit-jupiter-api + test + + + io.helidon.webclient + helidon-webclient + test + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-libs + + + + + io.helidon.build-tools + helidon-maven-plugin + + + third-party-license-report + + + + + + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/Main.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/Main.java new file mode 100644 index 00000000000..c5a69f38512 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/Main.java @@ -0,0 +1,103 @@ +package org.openapitools.server; + +import org.openapitools.server.api.AnotherFakeServiceImpl; +import org.openapitools.server.api.DefaultServiceImpl; +import org.openapitools.server.api.FakeServiceImpl; +import org.openapitools.server.api.FakeClassnameTags123ServiceImpl; +import org.openapitools.server.api.PetServiceImpl; +import org.openapitools.server.api.StoreServiceImpl; +import org.openapitools.server.api.UserServiceImpl; + +import io.helidon.common.LogConfig; +import io.helidon.common.reactive.Single; +import io.helidon.config.Config; +import io.helidon.health.HealthSupport; +import io.helidon.health.checks.HealthChecks; +import io.helidon.media.jsonp.JsonpSupport; +import io.helidon.media.jackson.JacksonSupport; +import org.openapitools.server.api.JsonProvider; +import io.helidon.metrics.MetricsSupport; +import io.helidon.openapi.OpenAPISupport; +import io.helidon.webserver.Routing; +import io.helidon.webserver.WebServer; + +/** +* The application main class. +*/ +public final class Main { + + /** + * Cannot be instantiated. + */ + private Main() { + } + + /** + * Application main entry point. + * @param args command line arguments. + */ + public static void main(final String[] args) { + startServer(); + } + + /** + * Start the server. + * @return the created {@link WebServer} instance + */ + static Single startServer() { + + // load logging configuration + LogConfig.configureRuntime(); + + // By default this will pick up application.yaml from the classpath + Config config = Config.create(); + + WebServer server = WebServer.builder(createRouting(config)) + .config(config.get("server")) + .addMediaSupport(JsonpSupport.create()) + .addMediaSupport(JacksonSupport.create(JsonProvider.objectMapper())) + .build(); + + Single webserver = server.start(); + + // Try to start the server. If successful, print some info and arrange to + // print a message at shutdown. If unsuccessful, print the exception. + webserver.thenAccept(ws -> { + System.out.println("WEB server is up! http://petstore.swagger.io:80/v2"); + ws.whenShutdown().thenRun(() -> System.out.println("WEB server is DOWN. Good bye!")); + }) + .exceptionallyAccept(t -> { + System.err.println("Startup failed: " + t.getMessage()); + t.printStackTrace(System.err); + }); + + return webserver; + } + + /** + * Creates new {@link Routing}. + * + * @return routing configured with JSON support, a health check, and a service + * @param config configuration of this server + */ + private static Routing createRouting(Config config) { + + MetricsSupport metrics = MetricsSupport.create(); + HealthSupport health = HealthSupport.builder() + .addLiveness(HealthChecks.healthChecks()) // Adds a convenient set of checks + .build(); + + return Routing.builder() + .register(OpenAPISupport.create(config.get(OpenAPISupport.Builder.CONFIG_KEY))) + .register(health) // Health at "/health" + .register(metrics) // Metrics at "/metrics" + .register("/", new AnotherFakeServiceImpl()) + .register("/", new DefaultServiceImpl()) + .register("/", new FakeServiceImpl()) + .register("/", new FakeClassnameTags123ServiceImpl()) + .register("/", new PetServiceImpl()) + .register("/", new StoreServiceImpl()) + .register("/", new UserServiceImpl()) + .build(); + } +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/RFC3339DateFormat.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/RFC3339DateFormat.java new file mode 100644 index 00000000000..f47f2f7f983 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/RFC3339DateFormat.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return this; + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/AnotherFakeService.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/AnotherFakeService.java new file mode 100644 index 00000000000..1aae282a7c9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/AnotherFakeService.java @@ -0,0 +1,32 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import io.helidon.webserver.Handler; +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; +import io.helidon.webserver.Service; + +public interface AnotherFakeService extends Service { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void update(Routing.Rules rules) { + rules.patch("/another-fake/dummy", Handler.create(Client.class, this::call123testSpecialTags)); + } + + + /** + * PATCH /another-fake/dummy : To test special tags. + * @param request the server request + * @param response the server response + * @param client client model + */ + void call123testSpecialTags(ServerRequest request, ServerResponse response, Client client); + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java new file mode 100644 index 00000000000..ecac97ee2d0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java @@ -0,0 +1,22 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import io.helidon.webserver.Handler; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.logging.Logger; + +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; + +public class AnotherFakeServiceImpl implements AnotherFakeService { + + private static final int HTTP_CODE_NOT_IMPLEMENTED = 501; + private static final Logger LOGGER = Logger.getLogger(AnotherFakeService.class.getName()); + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + public void call123testSpecialTags(ServerRequest request, ServerResponse response, Client client) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/DefaultService.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/DefaultService.java new file mode 100644 index 00000000000..6dcf4beace9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/DefaultService.java @@ -0,0 +1,30 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.FooGetDefaultResponse; +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; +import io.helidon.webserver.Service; + +public interface DefaultService extends Service { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void update(Routing.Rules rules) { + rules.get("/foo", this::fooGet); + } + + + /** + * GET /foo. + * @param request the server request + * @param response the server response + */ + void fooGet(ServerRequest request, ServerResponse response); + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java new file mode 100644 index 00000000000..5d6166d32df --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java @@ -0,0 +1,21 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.FooGetDefaultResponse; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.logging.Logger; + +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; + +public class DefaultServiceImpl implements DefaultService { + + private static final int HTTP_CODE_NOT_IMPLEMENTED = 501; + private static final Logger LOGGER = Logger.getLogger(DefaultService.class.getName()); + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + public void fooGet(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java new file mode 100644 index 00000000000..64b29bab65b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java @@ -0,0 +1,32 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import io.helidon.webserver.Handler; +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; +import io.helidon.webserver.Service; + +public interface FakeClassnameTags123Service extends Service { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void update(Routing.Rules rules) { + rules.patch("/fake_classname_test", Handler.create(Client.class, this::testClassname)); + } + + + /** + * PATCH /fake_classname_test : To test class name in snake case. + * @param request the server request + * @param response the server response + * @param client client model + */ + void testClassname(ServerRequest request, ServerResponse response, Client client); + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java new file mode 100644 index 00000000000..a4321c9ffdf --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java @@ -0,0 +1,22 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import io.helidon.webserver.Handler; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.logging.Logger; + +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; + +public class FakeClassnameTags123ServiceImpl implements FakeClassnameTags123Service { + + private static final int HTTP_CODE_NOT_IMPLEMENTED = 501; + private static final Logger LOGGER = Logger.getLogger(FakeClassnameTags123Service.class.getName()); + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + public void testClassname(ServerRequest request, ServerResponse response, Client client) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java new file mode 100644 index 00000000000..3ab5d379653 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeService.java @@ -0,0 +1,177 @@ +package org.openapitools.server.api; + +import java.math.BigDecimal; +import org.openapitools.server.model.Client; +import org.openapitools.server.model.EnumClass; +import java.io.File; +import org.openapitools.server.model.FileSchemaTestClass; +import io.helidon.webserver.Handler; +import org.openapitools.server.model.HealthCheckResult; +import java.time.LocalDate; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.OffsetDateTime; +import org.openapitools.server.model.OuterComposite; +import org.openapitools.server.model.OuterObjectWithEnumProperty; +import org.openapitools.server.model.Pet; +import org.openapitools.server.model.User; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; +import io.helidon.webserver.Service; + +public interface FakeService extends Service { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void update(Routing.Rules rules) { + rules.get("/fake/health", this::fakeHealthGet); + rules.get("/fake/http-signature-test", Handler.create(Pet.class, this::fakeHttpSignatureTest)); + rules.post("/fake/outer/boolean", this::fakeOuterBooleanSerialize); + rules.post("/fake/outer/composite", Handler.create(OuterComposite.class, this::fakeOuterCompositeSerialize)); + rules.post("/fake/outer/number", this::fakeOuterNumberSerialize); + rules.post("/fake/outer/string", this::fakeOuterStringSerialize); + rules.post("/fake/property/enum-int", Handler.create(OuterObjectWithEnumProperty.class, this::fakePropertyEnumIntegerSerialize)); + rules.put("/fake/body-with-binary", this::testBodyWithBinary); + rules.put("/fake/body-with-file-schema", Handler.create(FileSchemaTestClass.class, this::testBodyWithFileSchema)); + rules.put("/fake/body-with-query-params", Handler.create(User.class, this::testBodyWithQueryParams)); + rules.patch("/fake", Handler.create(Client.class, this::testClientModel)); + rules.post("/fake", this::testEndpointParameters); + rules.get("/fake", this::testEnumParameters); + rules.delete("/fake", this::testGroupParameters); + rules.post("/fake/inline-additionalProperties", this::testInlineAdditionalProperties); + rules.get("/fake/jsonFormData", this::testJsonFormData); + rules.put("/fake/test-query-parameters", this::testQueryParameterCollectionFormat); + } + + + /** + * GET /fake/health : Health check endpoint. + * @param request the server request + * @param response the server response + */ + void fakeHealthGet(ServerRequest request, ServerResponse response); + + /** + * GET /fake/http-signature-test : test http signature authentication. + * @param request the server request + * @param response the server response + * @param pet Pet object that needs to be added to the store + */ + void fakeHttpSignatureTest(ServerRequest request, ServerResponse response, Pet pet); + + /** + * POST /fake/outer/boolean. + * @param request the server request + * @param response the server response + */ + void fakeOuterBooleanSerialize(ServerRequest request, ServerResponse response); + + /** + * POST /fake/outer/composite. + * @param request the server request + * @param response the server response + * @param outerComposite Input composite as post body + */ + void fakeOuterCompositeSerialize(ServerRequest request, ServerResponse response, OuterComposite outerComposite); + + /** + * POST /fake/outer/number. + * @param request the server request + * @param response the server response + */ + void fakeOuterNumberSerialize(ServerRequest request, ServerResponse response); + + /** + * POST /fake/outer/string. + * @param request the server request + * @param response the server response + */ + void fakeOuterStringSerialize(ServerRequest request, ServerResponse response); + + /** + * POST /fake/property/enum-int. + * @param request the server request + * @param response the server response + * @param outerObjectWithEnumProperty Input enum (int) as post body + */ + void fakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response, OuterObjectWithEnumProperty outerObjectWithEnumProperty); + + /** + * PUT /fake/body-with-binary. + * @param request the server request + * @param response the server response + */ + void testBodyWithBinary(ServerRequest request, ServerResponse response); + + /** + * PUT /fake/body-with-file-schema. + * @param request the server request + * @param response the server response + * @param fileSchemaTestClass fileSchemaTestClass + */ + void testBodyWithFileSchema(ServerRequest request, ServerResponse response, FileSchemaTestClass fileSchemaTestClass); + + /** + * PUT /fake/body-with-query-params. + * @param request the server request + * @param response the server response + * @param user user + */ + void testBodyWithQueryParams(ServerRequest request, ServerResponse response, User user); + + /** + * PATCH /fake : To test \"client\" model. + * @param request the server request + * @param response the server response + * @param client client model + */ + void testClientModel(ServerRequest request, ServerResponse response, Client client); + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 . + * @param request the server request + * @param response the server response + */ + void testEndpointParameters(ServerRequest request, ServerResponse response); + + /** + * GET /fake : To test enum parameters. + * @param request the server request + * @param response the server response + */ + void testEnumParameters(ServerRequest request, ServerResponse response); + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional). + * @param request the server request + * @param response the server response + */ + void testGroupParameters(ServerRequest request, ServerResponse response); + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties. + * @param request the server request + * @param response the server response + */ + void testInlineAdditionalProperties(ServerRequest request, ServerResponse response); + + /** + * GET /fake/jsonFormData : test json serialization of form data. + * @param request the server request + * @param response the server response + */ + void testJsonFormData(ServerRequest request, ServerResponse response); + + /** + * PUT /fake/test-query-parameters. + * @param request the server request + * @param response the server response + */ + void testQueryParameterCollectionFormat(ServerRequest request, ServerResponse response); + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java new file mode 100644 index 00000000000..8dbc1c125ae --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -0,0 +1,98 @@ +package org.openapitools.server.api; + +import java.math.BigDecimal; +import org.openapitools.server.model.Client; +import org.openapitools.server.model.EnumClass; +import java.io.File; +import org.openapitools.server.model.FileSchemaTestClass; +import io.helidon.webserver.Handler; +import org.openapitools.server.model.HealthCheckResult; +import java.time.LocalDate; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.OffsetDateTime; +import org.openapitools.server.model.OuterComposite; +import org.openapitools.server.model.OuterObjectWithEnumProperty; +import org.openapitools.server.model.Pet; +import org.openapitools.server.model.User; +import java.util.logging.Logger; + +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; + +public class FakeServiceImpl implements FakeService { + + private static final int HTTP_CODE_NOT_IMPLEMENTED = 501; + private static final Logger LOGGER = Logger.getLogger(FakeService.class.getName()); + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + public void fakeHealthGet(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void fakeHttpSignatureTest(ServerRequest request, ServerResponse response, Pet pet) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void fakeOuterBooleanSerialize(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void fakeOuterCompositeSerialize(ServerRequest request, ServerResponse response, OuterComposite outerComposite) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void fakeOuterNumberSerialize(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void fakeOuterStringSerialize(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void fakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response, OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void testBodyWithBinary(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void testBodyWithFileSchema(ServerRequest request, ServerResponse response, FileSchemaTestClass fileSchemaTestClass) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void testBodyWithQueryParams(ServerRequest request, ServerResponse response, User user) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void testClientModel(ServerRequest request, ServerResponse response, Client client) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void testEndpointParameters(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void testEnumParameters(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void testGroupParameters(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void testInlineAdditionalProperties(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void testJsonFormData(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void testQueryParameterCollectionFormat(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/JsonProvider.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/JsonProvider.java new file mode 100644 index 00000000000..41f01e882ab --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/JsonProvider.java @@ -0,0 +1,20 @@ +package org.openapitools.server.api; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; + +public class JsonProvider { + + public static ObjectMapper objectMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.registerModule(new JavaTimeModule()); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY); + mapper.configure(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE, false); + return mapper; + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/PetService.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/PetService.java new file mode 100644 index 00000000000..6851238e192 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/PetService.java @@ -0,0 +1,100 @@ +package org.openapitools.server.api; + +import java.io.File; +import io.helidon.webserver.Handler; +import org.openapitools.server.model.ModelApiResponse; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.server.model.Pet; +import java.util.Set; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; +import io.helidon.webserver.Service; + +public interface PetService extends Service { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void update(Routing.Rules rules) { + rules.post("/pet", Handler.create(Pet.class, this::addPet)); + rules.delete("/pet/{petId}", this::deletePet); + rules.get("/pet/findByStatus", this::findPetsByStatus); + rules.get("/pet/findByTags", this::findPetsByTags); + rules.get("/pet/{petId}", this::getPetById); + rules.put("/pet", Handler.create(Pet.class, this::updatePet)); + rules.post("/pet/{petId}", this::updatePetWithForm); + rules.post("/pet/{petId}/uploadImage", this::uploadFile); + rules.post("/fake/{petId}/uploadImageWithRequiredFile", this::uploadFileWithRequiredFile); + } + + + /** + * POST /pet : Add a new pet to the store. + * @param request the server request + * @param response the server response + * @param pet Pet object that needs to be added to the store + */ + void addPet(ServerRequest request, ServerResponse response, Pet pet); + + /** + * DELETE /pet/{petId} : Deletes a pet. + * @param request the server request + * @param response the server response + */ + void deletePet(ServerRequest request, ServerResponse response); + + /** + * GET /pet/findByStatus : Finds Pets by status. + * @param request the server request + * @param response the server response + */ + void findPetsByStatus(ServerRequest request, ServerResponse response); + + /** + * GET /pet/findByTags : Finds Pets by tags. + * @param request the server request + * @param response the server response + */ + void findPetsByTags(ServerRequest request, ServerResponse response); + + /** + * GET /pet/{petId} : Find pet by ID. + * @param request the server request + * @param response the server response + */ + void getPetById(ServerRequest request, ServerResponse response); + + /** + * PUT /pet : Update an existing pet. + * @param request the server request + * @param response the server response + * @param pet Pet object that needs to be added to the store + */ + void updatePet(ServerRequest request, ServerResponse response, Pet pet); + + /** + * POST /pet/{petId} : Updates a pet in the store with form data. + * @param request the server request + * @param response the server response + */ + void updatePetWithForm(ServerRequest request, ServerResponse response); + + /** + * POST /pet/{petId}/uploadImage : uploads an image. + * @param request the server request + * @param response the server response + */ + void uploadFile(ServerRequest request, ServerResponse response); + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required). + * @param request the server request + * @param response the server response + */ + void uploadFileWithRequiredFile(ServerRequest request, ServerResponse response); + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/PetServiceImpl.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/PetServiceImpl.java new file mode 100644 index 00000000000..7857f6bfa57 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/PetServiceImpl.java @@ -0,0 +1,57 @@ +package org.openapitools.server.api; + +import java.io.File; +import io.helidon.webserver.Handler; +import org.openapitools.server.model.ModelApiResponse; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.server.model.Pet; +import java.util.Set; +import java.util.logging.Logger; + +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; + +public class PetServiceImpl implements PetService { + + private static final int HTTP_CODE_NOT_IMPLEMENTED = 501; + private static final Logger LOGGER = Logger.getLogger(PetService.class.getName()); + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + public void addPet(ServerRequest request, ServerResponse response, Pet pet) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void deletePet(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void findPetsByStatus(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void findPetsByTags(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void getPetById(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void updatePet(ServerRequest request, ServerResponse response, Pet pet) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void updatePetWithForm(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void uploadFile(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void uploadFileWithRequiredFile(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/StoreService.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/StoreService.java new file mode 100644 index 00000000000..d24b3a027a9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/StoreService.java @@ -0,0 +1,57 @@ +package org.openapitools.server.api; + +import io.helidon.webserver.Handler; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.server.model.Order; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; +import io.helidon.webserver.Service; + +public interface StoreService extends Service { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void update(Routing.Rules rules) { + rules.delete("/store/order/{order_id}", this::deleteOrder); + rules.get("/store/inventory", this::getInventory); + rules.get("/store/order/{order_id}", this::getOrderById); + rules.post("/store/order", Handler.create(Order.class, this::placeOrder)); + } + + + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID. + * @param request the server request + * @param response the server response + */ + void deleteOrder(ServerRequest request, ServerResponse response); + + /** + * GET /store/inventory : Returns pet inventories by status. + * @param request the server request + * @param response the server response + */ + void getInventory(ServerRequest request, ServerResponse response); + + /** + * GET /store/order/{order_id} : Find purchase order by ID. + * @param request the server request + * @param response the server response + */ + void getOrderById(ServerRequest request, ServerResponse response); + + /** + * POST /store/order : Place an order for a pet. + * @param request the server request + * @param response the server response + * @param order order placed for purchasing the pet + */ + void placeOrder(ServerRequest request, ServerResponse response, Order order); + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/StoreServiceImpl.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/StoreServiceImpl.java new file mode 100644 index 00000000000..7b51983f8ba --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/StoreServiceImpl.java @@ -0,0 +1,35 @@ +package org.openapitools.server.api; + +import io.helidon.webserver.Handler; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.server.model.Order; +import java.util.logging.Logger; + +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; + +public class StoreServiceImpl implements StoreService { + + private static final int HTTP_CODE_NOT_IMPLEMENTED = 501; + private static final Logger LOGGER = Logger.getLogger(StoreService.class.getName()); + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + public void deleteOrder(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void getInventory(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void getOrderById(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void placeOrder(ServerRequest request, ServerResponse response, Order order) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/UserService.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/UserService.java new file mode 100644 index 00000000000..4db3a7fe694 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/UserService.java @@ -0,0 +1,91 @@ +package org.openapitools.server.api; + +import io.helidon.webserver.Handler; +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.OffsetDateTime; +import org.openapitools.server.model.User; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; +import io.helidon.webserver.Service; + +public interface UserService extends Service { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void update(Routing.Rules rules) { + rules.post("/user", Handler.create(User.class, this::createUser)); + rules.post("/user/createWithArray", this::createUsersWithArrayInput); + rules.post("/user/createWithList", this::createUsersWithListInput); + rules.delete("/user/{username}", this::deleteUser); + rules.get("/user/{username}", this::getUserByName); + rules.get("/user/login", this::loginUser); + rules.get("/user/logout", this::logoutUser); + rules.put("/user/{username}", Handler.create(User.class, this::updateUser)); + } + + + /** + * POST /user : Create user. + * @param request the server request + * @param response the server response + * @param user Created user object + */ + void createUser(ServerRequest request, ServerResponse response, User user); + + /** + * POST /user/createWithArray : Creates list of users with given input array. + * @param request the server request + * @param response the server response + */ + void createUsersWithArrayInput(ServerRequest request, ServerResponse response); + + /** + * POST /user/createWithList : Creates list of users with given input array. + * @param request the server request + * @param response the server response + */ + void createUsersWithListInput(ServerRequest request, ServerResponse response); + + /** + * DELETE /user/{username} : Delete user. + * @param request the server request + * @param response the server response + */ + void deleteUser(ServerRequest request, ServerResponse response); + + /** + * GET /user/{username} : Get user by user name. + * @param request the server request + * @param response the server response + */ + void getUserByName(ServerRequest request, ServerResponse response); + + /** + * GET /user/login : Logs user into the system. + * @param request the server request + * @param response the server response + */ + void loginUser(ServerRequest request, ServerResponse response); + + /** + * GET /user/logout : Logs out current logged in user session. + * @param request the server request + * @param response the server response + */ + void logoutUser(ServerRequest request, ServerResponse response); + + /** + * PUT /user/{username} : Updated user. + * @param request the server request + * @param response the server response + * @param user Updated user object + */ + void updateUser(ServerRequest request, ServerResponse response, User user); + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/UserServiceImpl.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/UserServiceImpl.java new file mode 100644 index 00000000000..2e8dc2916c4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/UserServiceImpl.java @@ -0,0 +1,52 @@ +package org.openapitools.server.api; + +import io.helidon.webserver.Handler; +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.OffsetDateTime; +import org.openapitools.server.model.User; +import java.util.logging.Logger; + +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; + +public class UserServiceImpl implements UserService { + + private static final int HTTP_CODE_NOT_IMPLEMENTED = 501; + private static final Logger LOGGER = Logger.getLogger(UserService.class.getName()); + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + public void createUser(ServerRequest request, ServerResponse response, User user) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void createUsersWithArrayInput(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void createUsersWithListInput(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void deleteUser(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void getUserByName(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void loginUser(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void logoutUser(ServerRequest request, ServerResponse response) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + + public void updateUser(ServerRequest request, ServerResponse response, User user) { + response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/ValidatorUtils.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/ValidatorUtils.java new file mode 100644 index 00000000000..a57963d73f3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/api/ValidatorUtils.java @@ -0,0 +1,112 @@ +package org.openapitools.server.api; + +import java.lang.reflect.Array; +import java.math.BigDecimal; +import java.util.Collection; +import java.util.Map; +import java.util.Objects; + +import jakarta.validation.ValidationException; + +/** +* Validation utility methods. +*/ +public final class ValidatorUtils { + + public static boolean validateMin(Integer value, Integer min) { + checkNonNull(value); + if (value < min) { + throw new ValidationException(String.format("%s is less than %s", value, min)); + } + return true; + } + + public static boolean validateMax(Integer value, Integer max) { + checkNonNull(value); + if (value > max) { + throw new ValidationException(String.format("%s is more than %s", value, max)); + } + return true; + } + + public static boolean validateSize(Object value, Integer min, Integer max) { + checkNonNull(value); + Integer size = -1; + if (value instanceof Map) { + size = ((Map) value).size(); + } + if (value instanceof CharSequence) { + size = ((CharSequence) value).length(); + } + if (value instanceof Collection) { + size = ((Collection) value).size(); + } + if (value.getClass().isArray()) { + size = Array.getLength(value); + } + if (size == -1) { + throw new ValidationException("Value has incorrect type"); + } + if (min != null) { + validateMin(size, min); + } + if (max != null) { + validateMax(size, max); + } + return true; + } + + public static boolean validatePattern(String value, String pattern) { + checkNonNull(value, pattern); + if (value.matches(pattern)) { + return true; + } + throw new ValidationException(String.format("'%s' does not match the pattern '%s'", value, pattern)); + } + + public static boolean validateMin(BigDecimal value, String stringMinValue, boolean inclusive) { + checkNonNull(value); + BigDecimal minValue = new BigDecimal(stringMinValue); + int result = value.compareTo(minValue); + if (inclusive) { + if (result >= 0) { + return true; + } + } else { + if (result > 0) { + return true; + } + } + throw new ValidationException( + String.format("%s is not valid value. Min value '%s'. Inclusive - %s.", value, stringMinValue, inclusive) + ); + } + + public static boolean validateMax(BigDecimal value, String stringMaxValue, boolean inclusive) { + checkNonNull(value); + BigDecimal maxValue = new BigDecimal(stringMaxValue); + int result = value.compareTo(maxValue); + if (inclusive) { + if (result <= 0) { + return true; + } + } else { + if (result < 0) { + return true; + } + } + throw new ValidationException( + String.format("%s is not valid value. Max value '%s'. Inclusive - %s.", value, stringMaxValue, inclusive) + ); + } + + public static void checkNonNull(Object... args) { + try { + for (Object o : args) { + Objects.requireNonNull(o); + } + } catch (Exception e) { + throw new ValidationException(e); + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java new file mode 100644 index 00000000000..9f9f831237c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java @@ -0,0 +1,85 @@ +package org.openapitools.server.model; + +import java.util.HashMap; +import java.util.Map; + + + +public class AdditionalPropertiesClass { + + private Map mapProperty = new HashMap<>(); + private Map> mapOfMapProperty = new HashMap<>(); + + /** + * Default constructor. + */ + public AdditionalPropertiesClass() { + // JSON-B / Jackson + } + + /** + * Create AdditionalPropertiesClass. + * + * @param mapProperty mapProperty + * @param mapOfMapProperty mapOfMapProperty + */ + public AdditionalPropertiesClass( + Map mapProperty, + Map> mapOfMapProperty + ) { + this.mapProperty = mapProperty; + this.mapOfMapProperty = mapOfMapProperty; + } + + + + /** + * Get mapProperty + * @return mapProperty + */ + public Map getMapProperty() { + return mapProperty; + } + + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + */ + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java new file mode 100644 index 00000000000..b40d9201c0e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java @@ -0,0 +1,84 @@ +package org.openapitools.server.model; + +import org.openapitools.server.model.SingleRefType; + + + +public class AllOfWithSingleRef { + + private String username; + private SingleRefType singleRefType; + + /** + * Default constructor. + */ + public AllOfWithSingleRef() { + // JSON-B / Jackson + } + + /** + * Create AllOfWithSingleRef. + * + * @param username username + * @param singleRefType singleRefType + */ + public AllOfWithSingleRef( + String username, + SingleRefType singleRefType + ) { + this.username = username; + this.singleRefType = singleRefType; + } + + + + /** + * Get username + * @return username + */ + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + /** + * Get singleRefType + * @return singleRefType + */ + public SingleRefType getSingleRefType() { + return singleRefType; + } + + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java new file mode 100644 index 00000000000..72fd34477f8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Animal.java @@ -0,0 +1,88 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Cat; +import org.openapitools.server.model.Dog; + + + +public class Animal { + + private String className; + private String color = "red"; + + /** + * Default constructor. + */ + public Animal() { + // JSON-B / Jackson + } + + /** + * Create Animal. + * + * @param className className + * @param color color + */ + public Animal( + String className, + String color + ) { + this.className = className; + this.color = color; + } + + + + /** + * Get className + * @return className + */ + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + /** + * Get color + * @return color + */ + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 00000000000..5ba378a4203 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + +public class ArrayOfArrayOfNumberOnly { + + private List> arrayArrayNumber = new ArrayList<>(); + + /** + * Default constructor. + */ + public ArrayOfArrayOfNumberOnly() { + // JSON-B / Jackson + } + + /** + * Create ArrayOfArrayOfNumberOnly. + * + * @param arrayArrayNumber arrayArrayNumber + */ + public ArrayOfArrayOfNumberOnly( + List> arrayArrayNumber + ) { + this.arrayArrayNumber = arrayArrayNumber; + } + + + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + */ + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java new file mode 100644 index 00000000000..05e4cfc0700 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + + + +public class ArrayOfNumberOnly { + + private List arrayNumber = new ArrayList<>(); + + /** + * Default constructor. + */ + public ArrayOfNumberOnly() { + // JSON-B / Jackson + } + + /** + * Create ArrayOfNumberOnly. + * + * @param arrayNumber arrayNumber + */ + public ArrayOfNumberOnly( + List arrayNumber + ) { + this.arrayNumber = arrayNumber; + } + + + + /** + * Get arrayNumber + * @return arrayNumber + */ + public List getArrayNumber() { + return arrayNumber; + } + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayTest.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayTest.java new file mode 100644 index 00000000000..f7eeaade3fa --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ArrayTest.java @@ -0,0 +1,103 @@ +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.List; +import org.openapitools.server.model.ReadOnlyFirst; + + + +public class ArrayTest { + + private List arrayOfString = new ArrayList<>(); + private List> arrayArrayOfInteger = new ArrayList<>(); + private List> arrayArrayOfModel = new ArrayList<>(); + + /** + * Default constructor. + */ + public ArrayTest() { + // JSON-B / Jackson + } + + /** + * Create ArrayTest. + * + * @param arrayOfString arrayOfString + * @param arrayArrayOfInteger arrayArrayOfInteger + * @param arrayArrayOfModel arrayArrayOfModel + */ + public ArrayTest( + List arrayOfString, + List> arrayArrayOfInteger, + List> arrayArrayOfModel + ) { + this.arrayOfString = arrayOfString; + this.arrayArrayOfInteger = arrayArrayOfInteger; + this.arrayArrayOfModel = arrayArrayOfModel; + } + + + + /** + * Get arrayOfString + * @return arrayOfString + */ + public List getArrayOfString() { + return arrayOfString; + } + + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + */ + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + */ + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Capitalization.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Capitalization.java new file mode 100644 index 00000000000..ab3f58fcd43 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Capitalization.java @@ -0,0 +1,151 @@ +package org.openapitools.server.model; + + + + +public class Capitalization { + + private String smallCamel; + private String capitalCamel; + private String smallSnake; + private String capitalSnake; + private String scAETHFlowPoints; + private String ATT_NAME; + + /** + * Default constructor. + */ + public Capitalization() { + // JSON-B / Jackson + } + + /** + * Create Capitalization. + * + * @param smallCamel smallCamel + * @param capitalCamel capitalCamel + * @param smallSnake smallSnake + * @param capitalSnake capitalSnake + * @param scAETHFlowPoints scAETHFlowPoints + * @param ATT_NAME Name of the pet + */ + public Capitalization( + String smallCamel, + String capitalCamel, + String smallSnake, + String capitalSnake, + String scAETHFlowPoints, + String ATT_NAME + ) { + this.smallCamel = smallCamel; + this.capitalCamel = capitalCamel; + this.smallSnake = smallSnake; + this.capitalSnake = capitalSnake; + this.scAETHFlowPoints = scAETHFlowPoints; + this.ATT_NAME = ATT_NAME; + } + + + + /** + * Get smallCamel + * @return smallCamel + */ + public String getSmallCamel() { + return smallCamel; + } + + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + /** + * Get capitalCamel + * @return capitalCamel + */ + public String getCapitalCamel() { + return capitalCamel; + } + + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + /** + * Get smallSnake + * @return smallSnake + */ + public String getSmallSnake() { + return smallSnake; + } + + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + /** + * Get capitalSnake + * @return capitalSnake + */ + public String getCapitalSnake() { + return capitalSnake; + } + + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + */ + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + /** + * Name of the pet + * @return ATT_NAME + */ + public String getATTNAME() { + return ATT_NAME; + } + + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java new file mode 100644 index 00000000000..663f2a85183 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Cat.java @@ -0,0 +1,70 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Animal; + + + +public class Cat extends Animal { + + private Boolean declawed; + + /** + * Default constructor. + */ + public Cat() { + // JSON-B / Jackson + } + + /** + * Create Cat. + * + * @param declawed declawed + */ + public Cat( + Boolean declawed + ) { + this.declawed = declawed; + } + + + + /** + * Get declawed + * @return declawed + */ + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/CatAllOf.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/CatAllOf.java new file mode 100644 index 00000000000..8d2e8a501d6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/CatAllOf.java @@ -0,0 +1,67 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +public class CatAllOf { + + private Boolean declawed; + + /** + * Default constructor. + */ + public CatAllOf() { + // JSON-B / Jackson + } + + /** + * Create CatAllOf. + * + * @param declawed declawed + */ + public CatAllOf( + Boolean declawed + ) { + this.declawed = declawed; + } + + + + /** + * Get declawed + * @return declawed + */ + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Category.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Category.java new file mode 100644 index 00000000000..f449dcdbdcc --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Category.java @@ -0,0 +1,83 @@ +package org.openapitools.server.model; + + + + +public class Category { + + private Long id; + private String name = "default-name"; + + /** + * Default constructor. + */ + public Category() { + // JSON-B / Jackson + } + + /** + * Create Category. + * + * @param id id + * @param name name + */ + public Category( + Long id, + String name + ) { + this.id = id; + this.name = name; + } + + + + /** + * Get id + * @return id + */ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + /** + * Get name + * @return name + */ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ClassModel.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ClassModel.java new file mode 100644 index 00000000000..ba7528f6ddb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ClassModel.java @@ -0,0 +1,68 @@ +package org.openapitools.server.model; + + + +/** + * Model for testing model with \"_class\" property + */ +public class ClassModel { + + private String propertyClass; + + /** + * Default constructor. + */ + public ClassModel() { + // JSON-B / Jackson + } + + /** + * Create ClassModel. + * + * @param propertyClass propertyClass + */ + public ClassModel( + String propertyClass + ) { + this.propertyClass = propertyClass; + } + + + + /** + * Get propertyClass + * @return propertyClass + */ + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Client.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Client.java new file mode 100644 index 00000000000..76c4d19ab60 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Client.java @@ -0,0 +1,66 @@ +package org.openapitools.server.model; + + + + +public class Client { + + private String client; + + /** + * Default constructor. + */ + public Client() { + // JSON-B / Jackson + } + + /** + * Create Client. + * + * @param client client + */ + public Client( + String client + ) { + this.client = client; + } + + + + /** + * Get client + * @return client + */ + public String getClient() { + return client; + } + + public void setClient(String client) { + this.client = client; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/DeprecatedObject.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/DeprecatedObject.java new file mode 100644 index 00000000000..7add1761a84 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/DeprecatedObject.java @@ -0,0 +1,66 @@ +package org.openapitools.server.model; + + + + +public class DeprecatedObject { + + private String name; + + /** + * Default constructor. + */ + public DeprecatedObject() { + // JSON-B / Jackson + } + + /** + * Create DeprecatedObject. + * + * @param name name + */ + public DeprecatedObject( + String name + ) { + this.name = name; + } + + + + /** + * Get name + * @return name + */ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Dog.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Dog.java new file mode 100644 index 00000000000..2c904956ac4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Dog.java @@ -0,0 +1,70 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Animal; + + + +public class Dog extends Animal { + + private String breed; + + /** + * Default constructor. + */ + public Dog() { + // JSON-B / Jackson + } + + /** + * Create Dog. + * + * @param breed breed + */ + public Dog( + String breed + ) { + this.breed = breed; + } + + + + /** + * Get breed + * @return breed + */ + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/DogAllOf.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/DogAllOf.java new file mode 100644 index 00000000000..f4f1dd5724e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/DogAllOf.java @@ -0,0 +1,67 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +public class DogAllOf { + + private String breed; + + /** + * Default constructor. + */ + public DogAllOf() { + // JSON-B / Jackson + } + + /** + * Create DogAllOf. + * + * @param breed breed + */ + public DogAllOf( + String breed + ) { + this.breed = breed; + } + + + + /** + * Get breed + * @return breed + */ + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumArrays.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumArrays.java new file mode 100644 index 00000000000..d7f30e7d963 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumArrays.java @@ -0,0 +1,161 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; + + + +public class EnumArrays { + + + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + DOLLAR("$"); + + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static JustSymbolEnum fromValue(String text) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private List arrayEnum = new ArrayList<>(); + + /** + * Default constructor. + */ + public EnumArrays() { + // JSON-B / Jackson + } + + /** + * Create EnumArrays. + * + * @param justSymbol justSymbol + * @param arrayEnum arrayEnum + */ + public EnumArrays( + JustSymbolEnum justSymbol, + List arrayEnum + ) { + this.justSymbol = justSymbol; + this.arrayEnum = arrayEnum; + } + + + + /** + * Get justSymbol + * @return justSymbol + */ + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + /** + * Get arrayEnum + * @return arrayEnum + */ + public List getArrayEnum() { + return arrayEnum; + } + + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumClass.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumClass.java new file mode 100644 index 00000000000..d3f6c24ce36 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumClass.java @@ -0,0 +1,44 @@ +package org.openapitools.server.model; + + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ + +public enum EnumClass { + + _ABC("_abc"), + _EFG("-efg"), + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String text) { + for (EnumClass b : EnumClass.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumTest.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumTest.java new file mode 100644 index 00000000000..54b36a98ed9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/EnumTest.java @@ -0,0 +1,343 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.OuterEnum; +import org.openapitools.server.model.OuterEnumDefaultValue; +import org.openapitools.server.model.OuterEnumInteger; +import org.openapitools.server.model.OuterEnumIntegerDefaultValue; + + + +public class EnumTest { + + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + LOWER("lower"), + EMPTY(""); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static EnumStringEnum fromValue(String text) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + LOWER("lower"), + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String text) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @JsonValue + public Double getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static EnumNumberEnum fromValue(String text) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private EnumNumberEnum enumNumber; + private OuterEnum outerEnum; + private OuterEnumInteger outerEnumInteger; + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + + /** + * Default constructor. + */ + public EnumTest() { + // JSON-B / Jackson + } + + /** + * Create EnumTest. + * + * @param enumString enumString + * @param enumStringRequired enumStringRequired + * @param enumInteger enumInteger + * @param enumNumber enumNumber + * @param outerEnum outerEnum + * @param outerEnumInteger outerEnumInteger + * @param outerEnumDefaultValue outerEnumDefaultValue + * @param outerEnumIntegerDefaultValue outerEnumIntegerDefaultValue + */ + public EnumTest( + EnumStringEnum enumString, + EnumStringRequiredEnum enumStringRequired, + EnumIntegerEnum enumInteger, + EnumNumberEnum enumNumber, + OuterEnum outerEnum, + OuterEnumInteger outerEnumInteger, + OuterEnumDefaultValue outerEnumDefaultValue, + OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue + ) { + this.enumString = enumString; + this.enumStringRequired = enumStringRequired; + this.enumInteger = enumInteger; + this.enumNumber = enumNumber; + this.outerEnum = outerEnum; + this.outerEnumInteger = outerEnumInteger; + this.outerEnumDefaultValue = outerEnumDefaultValue; + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + + + /** + * Get enumString + * @return enumString + */ + public EnumStringEnum getEnumString() { + return enumString; + } + + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + */ + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + /** + * Get enumInteger + * @return enumInteger + */ + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + /** + * Get enumNumber + * @return enumNumber + */ + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + /** + * Get outerEnum + * @return outerEnum + */ + public OuterEnum getOuterEnum() { + return outerEnum; + } + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + */ + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + */ + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + */ + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java new file mode 100644 index 00000000000..1730307fb6d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java @@ -0,0 +1,86 @@ +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.List; +import org.openapitools.server.model.ModelFile; + + + +public class FileSchemaTestClass { + + private ModelFile _file; + private List files = new ArrayList<>(); + + /** + * Default constructor. + */ + public FileSchemaTestClass() { + // JSON-B / Jackson + } + + /** + * Create FileSchemaTestClass. + * + * @param _file _file + * @param files files + */ + public FileSchemaTestClass( + ModelFile _file, + List files + ) { + this._file = _file; + this.files = files; + } + + + + /** + * Get _file + * @return _file + */ + public ModelFile getFile() { + return _file; + } + + public void setFile(ModelFile _file) { + this._file = _file; + } + + /** + * Get files + * @return files + */ + public List getFiles() { + return files; + } + + public void setFiles(List files) { + this.files = files; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Foo.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Foo.java new file mode 100644 index 00000000000..6b3869f6f4c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Foo.java @@ -0,0 +1,66 @@ +package org.openapitools.server.model; + + + + +public class Foo { + + private String bar = "bar"; + + /** + * Default constructor. + */ + public Foo() { + // JSON-B / Jackson + } + + /** + * Create Foo. + * + * @param bar bar + */ + public Foo( + String bar + ) { + this.bar = bar; + } + + + + /** + * Get bar + * @return bar + */ + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java new file mode 100644 index 00000000000..f4716bdfcd1 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java @@ -0,0 +1,68 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.server.model.Foo; + + + +public class FooGetDefaultResponse { + + private Foo string; + + /** + * Default constructor. + */ + public FooGetDefaultResponse() { + // JSON-B / Jackson + } + + /** + * Create FooGetDefaultResponse. + * + * @param string string + */ + public FooGetDefaultResponse( + Foo string + ) { + this.string = string; + } + + + + /** + * Get string + * @return string + */ + public Foo getString() { + return string; + } + + public void setString(Foo string) { + this.string = string; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FormatTest.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FormatTest.java new file mode 100644 index 00000000000..df656b5b83c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/FormatTest.java @@ -0,0 +1,337 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; + + + +public class FormatTest { + + private Integer integer; + private Integer int32; + private Long int64; + private BigDecimal number; + private Float _float; + private Double _double; + private BigDecimal decimal; + private String string; + private byte[] _byte; + private File binary; + private LocalDate date; + private OffsetDateTime dateTime; + private UUID uuid; + private String password; + private String patternWithDigits; + private String patternWithDigitsAndDelimiter; + + /** + * Default constructor. + */ + public FormatTest() { + // JSON-B / Jackson + } + + /** + * Create FormatTest. + * + * @param integer integer + * @param int32 int32 + * @param int64 int64 + * @param number number + * @param _float _float + * @param _double _double + * @param decimal decimal + * @param string string + * @param _byte _byte + * @param binary binary + * @param date date + * @param dateTime dateTime + * @param uuid uuid + * @param password password + * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. + * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + */ + public FormatTest( + Integer integer, + Integer int32, + Long int64, + BigDecimal number, + Float _float, + Double _double, + BigDecimal decimal, + String string, + byte[] _byte, + File binary, + LocalDate date, + OffsetDateTime dateTime, + UUID uuid, + String password, + String patternWithDigits, + String patternWithDigitsAndDelimiter + ) { + this.integer = integer; + this.int32 = int32; + this.int64 = int64; + this.number = number; + this._float = _float; + this._double = _double; + this.decimal = decimal; + this.string = string; + this._byte = _byte; + this.binary = binary; + this.date = date; + this.dateTime = dateTime; + this.uuid = uuid; + this.password = password; + this.patternWithDigits = patternWithDigits; + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + */ + public Integer getInteger() { + return integer; + } + + public void setInteger(Integer integer) { + this.integer = integer; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + */ + public Integer getInt32() { + return int32; + } + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + /** + * Get int64 + * @return int64 + */ + public Long getInt64() { + return int64; + } + + public void setInt64(Long int64) { + this.int64 = int64; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + */ + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + */ + public Float getFloat() { + return _float; + } + + public void setFloat(Float _float) { + this._float = _float; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + */ + public Double getDouble() { + return _double; + } + + public void setDouble(Double _double) { + this._double = _double; + } + + /** + * Get decimal + * @return decimal + */ + public BigDecimal getDecimal() { + return decimal; + } + + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + /** + * Get string + * @return string + */ + public String getString() { + return string; + } + + public void setString(String string) { + this.string = string; + } + + /** + * Get _byte + * @return _byte + */ + public byte[] getByte() { + return _byte; + } + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + /** + * Get binary + * @return binary + */ + public File getBinary() { + return binary; + } + + public void setBinary(File binary) { + this.binary = binary; + } + + /** + * Get date + * @return date + */ + public LocalDate getDate() { + return date; + } + + public void setDate(LocalDate date) { + this.date = date; + } + + /** + * Get dateTime + * @return dateTime + */ + public OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + /** + * Get uuid + * @return uuid + */ + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + /** + * Get password + * @return password + */ + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + */ + public String getPatternWithDigits() { + return patternWithDigits; + } + + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + */ + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java new file mode 100644 index 00000000000..b5228bf6e66 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java @@ -0,0 +1,84 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +public class HasOnlyReadOnly { + + private String bar; + private String foo; + + /** + * Default constructor. + */ + public HasOnlyReadOnly() { + // JSON-B / Jackson + } + + /** + * Create HasOnlyReadOnly. + * + * @param bar bar + * @param foo foo + */ + public HasOnlyReadOnly( + String bar, + String foo + ) { + this.bar = bar; + this.foo = foo; + } + + + + /** + * Get bar + * @return bar + */ + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + /** + * Get foo + * @return foo + */ + public String getFoo() { + return foo; + } + + public void setFoo(String foo) { + this.foo = foo; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/HealthCheckResult.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/HealthCheckResult.java new file mode 100644 index 00000000000..97e9dba137a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/HealthCheckResult.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import org.openapitools.jackson.nullable.JsonNullable; + + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + */ +public class HealthCheckResult { + + private String nullableMessage; + + /** + * Default constructor. + */ + public HealthCheckResult() { + // JSON-B / Jackson + } + + /** + * Create HealthCheckResult. + * + * @param nullableMessage nullableMessage + */ + public HealthCheckResult( + String nullableMessage + ) { + this.nullableMessage = nullableMessage; + } + + + + /** + * Get nullableMessage + * @return nullableMessage + */ + public String getNullableMessage() { + return nullableMessage; + } + + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/MapTest.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/MapTest.java new file mode 100644 index 00000000000..4bef65f6a8e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/MapTest.java @@ -0,0 +1,158 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; + + + +public class MapTest { + + private Map> mapMapOfString = new HashMap<>(); + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static InnerEnum fromValue(String text) { + for (InnerEnum b : InnerEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private Map mapOfEnumString = new HashMap<>(); + private Map directMap = new HashMap<>(); + private Map indirectMap = new HashMap<>(); + + /** + * Default constructor. + */ + public MapTest() { + // JSON-B / Jackson + } + + /** + * Create MapTest. + * + * @param mapMapOfString mapMapOfString + * @param mapOfEnumString mapOfEnumString + * @param directMap directMap + * @param indirectMap indirectMap + */ + public MapTest( + Map> mapMapOfString, + Map mapOfEnumString, + Map directMap, + Map indirectMap + ) { + this.mapMapOfString = mapMapOfString; + this.mapOfEnumString = mapOfEnumString; + this.directMap = directMap; + this.indirectMap = indirectMap; + } + + + + /** + * Get mapMapOfString + * @return mapMapOfString + */ + public Map> getMapMapOfString() { + return mapMapOfString; + } + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + */ + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + /** + * Get directMap + * @return directMap + */ + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + /** + * Get indirectMap + * @return indirectMap + */ + public Map getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 00000000000..0a6bef328e2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,105 @@ +package org.openapitools.server.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.server.model.Animal; + + + +public class MixedPropertiesAndAdditionalPropertiesClass { + + private UUID uuid; + private OffsetDateTime dateTime; + private Map map = new HashMap<>(); + + /** + * Default constructor. + */ + public MixedPropertiesAndAdditionalPropertiesClass() { + // JSON-B / Jackson + } + + /** + * Create MixedPropertiesAndAdditionalPropertiesClass. + * + * @param uuid uuid + * @param dateTime dateTime + * @param map map + */ + public MixedPropertiesAndAdditionalPropertiesClass( + UUID uuid, + OffsetDateTime dateTime, + Map map + ) { + this.uuid = uuid; + this.dateTime = dateTime; + this.map = map; + } + + + + /** + * Get uuid + * @return uuid + */ + public UUID getUuid() { + return uuid; + } + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + /** + * Get dateTime + * @return dateTime + */ + public OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + /** + * Get map + * @return map + */ + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Model200Response.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Model200Response.java new file mode 100644 index 00000000000..dc685bdf99b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Model200Response.java @@ -0,0 +1,86 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; + + +/** + * Model for testing model name starting with number + */ +public class Model200Response { + + private Integer name; + private String propertyClass; + + /** + * Default constructor. + */ + public Model200Response() { + // JSON-B / Jackson + } + + /** + * Create Model200Response. + * + * @param name name + * @param propertyClass propertyClass + */ + public Model200Response( + Integer name, + String propertyClass + ) { + this.name = name; + this.propertyClass = propertyClass; + } + + + + /** + * Get name + * @return name + */ + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + /** + * Get propertyClass + * @return propertyClass + */ + public String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelApiResponse.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelApiResponse.java new file mode 100644 index 00000000000..10d22866ed5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelApiResponse.java @@ -0,0 +1,101 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +public class ModelApiResponse { + + private Integer code; + private String type; + private String message; + + /** + * Default constructor. + */ + public ModelApiResponse() { + // JSON-B / Jackson + } + + /** + * Create ModelApiResponse. + * + * @param code code + * @param type type + * @param message message + */ + public ModelApiResponse( + Integer code, + String type, + String message + ) { + this.code = code; + this.type = type; + this.message = message; + } + + + + /** + * Get code + * @return code + */ + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + /** + * Get type + * @return type + */ + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * Get message + * @return message + */ + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelFile.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelFile.java new file mode 100644 index 00000000000..0721c23130d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelFile.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; + + +/** + * Must be named `File` for test. + */ +public class ModelFile { + + private String sourceURI; + + /** + * Default constructor. + */ + public ModelFile() { + // JSON-B / Jackson + } + + /** + * Create ModelFile. + * + * @param sourceURI Test capitalization + */ + public ModelFile( + String sourceURI + ) { + this.sourceURI = sourceURI; + } + + + + /** + * Test capitalization + * @return sourceURI + */ + public String getSourceURI() { + return sourceURI; + } + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelList.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelList.java new file mode 100644 index 00000000000..6bba122e69e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelList.java @@ -0,0 +1,67 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +public class ModelList { + + private String _123list; + + /** + * Default constructor. + */ + public ModelList() { + // JSON-B / Jackson + } + + /** + * Create ModelList. + * + * @param _123list _123list + */ + public ModelList( + String _123list + ) { + this._123list = _123list; + } + + + + /** + * Get _123list + * @return _123list + */ + public String get123list() { + return _123list; + } + + public void set123list(String _123list) { + this._123list = _123list; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelReturn.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelReturn.java new file mode 100644 index 00000000000..0b9538b4aaf --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ModelReturn.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; + + +/** + * Model for testing reserved words + */ +public class ModelReturn { + + private Integer _return; + + /** + * Default constructor. + */ + public ModelReturn() { + // JSON-B / Jackson + } + + /** + * Create ModelReturn. + * + * @param _return _return + */ + public ModelReturn( + Integer _return + ) { + this._return = _return; + } + + + + /** + * Get _return + * @return _return + */ + public Integer getReturn() { + return _return; + } + + public void setReturn(Integer _return) { + this._return = _return; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Name.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Name.java new file mode 100644 index 00000000000..a081e1d5c13 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Name.java @@ -0,0 +1,119 @@ +package org.openapitools.server.model; + + + +/** + * Model for testing model name same as property name + */ +public class Name { + + private Integer name; + private Integer snakeCase; + private String property; + private Integer _123number; + + /** + * Default constructor. + */ + public Name() { + // JSON-B / Jackson + } + + /** + * Create Name. + * + * @param name name + * @param snakeCase snakeCase + * @param property property + * @param _123number _123number + */ + public Name( + Integer name, + Integer snakeCase, + String property, + Integer _123number + ) { + this.name = name; + this.snakeCase = snakeCase; + this.property = property; + this._123number = _123number; + } + + + + /** + * Get name + * @return name + */ + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + /** + * Get snakeCase + * @return snakeCase + */ + public Integer getSnakeCase() { + return snakeCase; + } + + public void setSnakeCase(Integer snakeCase) { + this.snakeCase = snakeCase; + } + + /** + * Get property + * @return property + */ + public String getProperty() { + return property; + } + + public void setProperty(String property) { + this.property = property; + } + + /** + * Get _123number + * @return _123number + */ + public Integer get123number() { + return _123number; + } + + public void set123number(Integer _123number) { + this._123number = _123number; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NullableClass.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NullableClass.java new file mode 100644 index 00000000000..2e2c2659cd4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NullableClass.java @@ -0,0 +1,261 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + + + +public class NullableClass extends HashMap { + + private Integer integerProp; + private BigDecimal numberProp; + private Boolean booleanProp; + private String stringProp; + private LocalDate dateProp; + private OffsetDateTime datetimeProp; + private List arrayNullableProp = new ArrayList<>(); + private List arrayAndItemsNullableProp = new ArrayList<>(); + private List arrayItemsNullable = new ArrayList<>(); + private Map objectNullableProp = new HashMap<>(); + private Map objectAndItemsNullableProp = new HashMap<>(); + private Map objectItemsNullable = new HashMap<>(); + + /** + * Default constructor. + */ + public NullableClass() { + // JSON-B / Jackson + } + + /** + * Create NullableClass. + * + * @param integerProp integerProp + * @param numberProp numberProp + * @param booleanProp booleanProp + * @param stringProp stringProp + * @param dateProp dateProp + * @param datetimeProp datetimeProp + * @param arrayNullableProp arrayNullableProp + * @param arrayAndItemsNullableProp arrayAndItemsNullableProp + * @param arrayItemsNullable arrayItemsNullable + * @param objectNullableProp objectNullableProp + * @param objectAndItemsNullableProp objectAndItemsNullableProp + * @param objectItemsNullable objectItemsNullable + */ + public NullableClass( + Integer integerProp, + BigDecimal numberProp, + Boolean booleanProp, + String stringProp, + LocalDate dateProp, + OffsetDateTime datetimeProp, + List arrayNullableProp, + List arrayAndItemsNullableProp, + List arrayItemsNullable, + Map objectNullableProp, + Map objectAndItemsNullableProp, + Map objectItemsNullable + ) { + this.integerProp = integerProp; + this.numberProp = numberProp; + this.booleanProp = booleanProp; + this.stringProp = stringProp; + this.dateProp = dateProp; + this.datetimeProp = datetimeProp; + this.arrayNullableProp = arrayNullableProp; + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + this.arrayItemsNullable = arrayItemsNullable; + this.objectNullableProp = objectNullableProp; + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + this.objectItemsNullable = objectItemsNullable; + } + + + + /** + * Get integerProp + * @return integerProp + */ + public Integer getIntegerProp() { + return integerProp; + } + + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + /** + * Get numberProp + * @return numberProp + */ + public BigDecimal getNumberProp() { + return numberProp; + } + + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + /** + * Get booleanProp + * @return booleanProp + */ + public Boolean getBooleanProp() { + return booleanProp; + } + + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + /** + * Get stringProp + * @return stringProp + */ + public String getStringProp() { + return stringProp; + } + + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + /** + * Get dateProp + * @return dateProp + */ + public LocalDate getDateProp() { + return dateProp; + } + + public void setDateProp(LocalDate dateProp) { + this.dateProp = dateProp; + } + + /** + * Get datetimeProp + * @return datetimeProp + */ + public OffsetDateTime getDatetimeProp() { + return datetimeProp; + } + + public void setDatetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = datetimeProp; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + */ + public List getArrayNullableProp() { + return arrayNullableProp; + } + + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + */ + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + */ + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + */ + public Map getObjectNullableProp() { + return objectNullableProp; + } + + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + */ + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + */ + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NumberOnly.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NumberOnly.java new file mode 100644 index 00000000000..3a003f97091 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/NumberOnly.java @@ -0,0 +1,67 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; + + + +public class NumberOnly { + + private BigDecimal justNumber; + + /** + * Default constructor. + */ + public NumberOnly() { + // JSON-B / Jackson + } + + /** + * Create NumberOnly. + * + * @param justNumber justNumber + */ + public NumberOnly( + BigDecimal justNumber + ) { + this.justNumber = justNumber; + } + + + + /** + * Get justNumber + * @return justNumber + */ + public BigDecimal getJustNumber() { + return justNumber; + } + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java new file mode 100644 index 00000000000..57ee9e374e2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,121 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.server.model.DeprecatedObject; + + + +public class ObjectWithDeprecatedFields { + + private String uuid; + private BigDecimal id; + private DeprecatedObject deprecatedRef; + private List bars = new ArrayList<>(); + + /** + * Default constructor. + */ + public ObjectWithDeprecatedFields() { + // JSON-B / Jackson + } + + /** + * Create ObjectWithDeprecatedFields. + * + * @param uuid uuid + * @param id id + * @param deprecatedRef deprecatedRef + * @param bars bars + */ + public ObjectWithDeprecatedFields( + String uuid, + BigDecimal id, + DeprecatedObject deprecatedRef, + List bars + ) { + this.uuid = uuid; + this.id = id; + this.deprecatedRef = deprecatedRef; + this.bars = bars; + } + + + + /** + * Get uuid + * @return uuid + */ + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + * Get id + * @return id + */ + public BigDecimal getId() { + return id; + } + + public void setId(BigDecimal id) { + this.id = id; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + */ + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + /** + * Get bars + * @return bars + */ + public List getBars() { + return bars; + } + + public void setBars(List bars) { + this.bars = bars; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Order.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Order.java new file mode 100644 index 00000000000..39a04dc1511 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Order.java @@ -0,0 +1,192 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; + + + +public class Order { + + private Long id; + private Long petId; + private Integer quantity; + private OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private StatusEnum status; + private Boolean complete = false; + + /** + * Default constructor. + */ + public Order() { + // JSON-B / Jackson + } + + /** + * Create Order. + * + * @param id id + * @param petId petId + * @param quantity quantity + * @param shipDate shipDate + * @param status Order Status + * @param complete complete + */ + public Order( + Long id, + Long petId, + Integer quantity, + OffsetDateTime shipDate, + StatusEnum status, + Boolean complete + ) { + this.id = id; + this.petId = petId; + this.quantity = quantity; + this.shipDate = shipDate; + this.status = status; + this.complete = complete; + } + + + + /** + * Get id + * @return id + */ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + /** + * Get petId + * @return petId + */ + public Long getPetId() { + return petId; + } + + public void setPetId(Long petId) { + this.petId = petId; + } + + /** + * Get quantity + * @return quantity + */ + public Integer getQuantity() { + return quantity; + } + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + /** + * Get shipDate + * @return shipDate + */ + public OffsetDateTime getShipDate() { + return shipDate; + } + + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + /** + * Order Status + * @return status + */ + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + * Get complete + * @return complete + */ + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterComposite.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterComposite.java new file mode 100644 index 00000000000..92eb34508d3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterComposite.java @@ -0,0 +1,101 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; + + + +public class OuterComposite { + + private BigDecimal myNumber; + private String myString; + private Boolean myBoolean; + + /** + * Default constructor. + */ + public OuterComposite() { + // JSON-B / Jackson + } + + /** + * Create OuterComposite. + * + * @param myNumber myNumber + * @param myString myString + * @param myBoolean myBoolean + */ + public OuterComposite( + BigDecimal myNumber, + String myString, + Boolean myBoolean + ) { + this.myNumber = myNumber; + this.myString = myString; + this.myBoolean = myBoolean; + } + + + + /** + * Get myNumber + * @return myNumber + */ + public BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + /** + * Get myString + * @return myString + */ + public String getMyString() { + return myString; + } + + public void setMyString(String myString) { + this.myString = myString; + } + + /** + * Get myBoolean + * @return myBoolean + */ + public Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnum.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnum.java new file mode 100644 index 00000000000..3cdb4cdeb79 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnum.java @@ -0,0 +1,44 @@ +package org.openapitools.server.model; + + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ + +public enum OuterEnum { + + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String text) { + for (OuterEnum b : OuterEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java new file mode 100644 index 00000000000..c8110bd330a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java @@ -0,0 +1,44 @@ +package org.openapitools.server.model; + + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ + +public enum OuterEnumDefaultValue { + + PLACED("placed"), + APPROVED("approved"), + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String text) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumInteger.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumInteger.java new file mode 100644 index 00000000000..b6d2661725f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumInteger.java @@ -0,0 +1,44 @@ +package org.openapitools.server.model; + + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ + +public enum OuterEnumInteger { + + NUMBER_0(0), + NUMBER_1(1), + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(String text) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 00000000000..af1fe21752a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,44 @@ +package org.openapitools.server.model; + + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ + +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + NUMBER_1(1), + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(String text) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java new file mode 100644 index 00000000000..7a75e0e3b60 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,67 @@ +package org.openapitools.server.model; + +import org.openapitools.server.model.OuterEnumInteger; + + + +public class OuterObjectWithEnumProperty { + + private OuterEnumInteger value; + + /** + * Default constructor. + */ + public OuterObjectWithEnumProperty() { + // JSON-B / Jackson + } + + /** + * Create OuterObjectWithEnumProperty. + * + * @param value value + */ + public OuterObjectWithEnumProperty( + OuterEnumInteger value + ) { + this.value = value; + } + + + + /** + * Get value + * @return value + */ + public OuterEnumInteger getValue() { + return value; + } + + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Pet.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Pet.java new file mode 100644 index 00000000000..a040a9d288b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Pet.java @@ -0,0 +1,198 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.server.model.Category; +import org.openapitools.server.model.Tag; + + + +public class Pet { + + private Long id; + private Category category; + private String name; + private Set photoUrls = new LinkedHashSet<>(); + private List tags = new ArrayList<>(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + PENDING("pending"), + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static StatusEnum fromValue(String text) { + for (StatusEnum b : StatusEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private StatusEnum status; + + /** + * Default constructor. + */ + public Pet() { + // JSON-B / Jackson + } + + /** + * Create Pet. + * + * @param id id + * @param category category + * @param name name + * @param photoUrls photoUrls + * @param tags tags + * @param status pet status in the store + */ + public Pet( + Long id, + Category category, + String name, + Set photoUrls, + List tags, + StatusEnum status + ) { + this.id = id; + this.category = category; + this.name = name; + this.photoUrls = photoUrls; + this.tags = tags; + this.status = status; + } + + + + /** + * Get id + * @return id + */ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + /** + * Get category + * @return category + */ + public Category getCategory() { + return category; + } + + public void setCategory(Category category) { + this.category = category; + } + + /** + * Get name + * @return name + */ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * Get photoUrls + * @return photoUrls + */ + public Set getPhotoUrls() { + return photoUrls; + } + + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + /** + * Get tags + * @return tags + */ + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * pet status in the store + * @return status + */ + public StatusEnum getStatus() { + return status; + } + + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java new file mode 100644 index 00000000000..e62e2270eea --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java @@ -0,0 +1,83 @@ +package org.openapitools.server.model; + + + + +public class ReadOnlyFirst { + + private String bar; + private String baz; + + /** + * Default constructor. + */ + public ReadOnlyFirst() { + // JSON-B / Jackson + } + + /** + * Create ReadOnlyFirst. + * + * @param bar bar + * @param baz baz + */ + public ReadOnlyFirst( + String bar, + String baz + ) { + this.bar = bar; + this.baz = baz; + } + + + + /** + * Get bar + * @return bar + */ + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + /** + * Get baz + * @return baz + */ + public String getBaz() { + return baz; + } + + public void setBaz(String baz) { + this.baz = baz; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SingleRefType.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SingleRefType.java new file mode 100644 index 00000000000..6689e8a2b60 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SingleRefType.java @@ -0,0 +1,43 @@ +package org.openapitools.server.model; + + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ + +public enum SingleRefType { + + ADMIN("admin"), + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String text) { + for (SingleRefType b : SingleRefType.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialModelName.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialModelName.java new file mode 100644 index 00000000000..2ab0a370197 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/SpecialModelName.java @@ -0,0 +1,67 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +public class SpecialModelName { + + private Long $specialPropertyName; + + /** + * Default constructor. + */ + public SpecialModelName() { + // JSON-B / Jackson + } + + /** + * Create SpecialModelName. + * + * @param $specialPropertyName $specialPropertyName + */ + public SpecialModelName( + Long $specialPropertyName + ) { + this.$specialPropertyName = $specialPropertyName; + } + + + + /** + * Get $specialPropertyName + * @return $specialPropertyName + */ + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Tag.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Tag.java new file mode 100644 index 00000000000..494d8fcf928 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/Tag.java @@ -0,0 +1,83 @@ +package org.openapitools.server.model; + + + + +public class Tag { + + private Long id; + private String name; + + /** + * Default constructor. + */ + public Tag() { + // JSON-B / Jackson + } + + /** + * Create Tag. + * + * @param id id + * @param name name + */ + public Tag( + Long id, + String name + ) { + this.id = id; + this.name = name; + } + + + + /** + * Get id + * @return id + */ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + /** + * Get name + * @return name + */ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/User.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/User.java new file mode 100644 index 00000000000..8110b662252 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/model/User.java @@ -0,0 +1,185 @@ +package org.openapitools.server.model; + + + + +public class User { + + private Long id; + private String username; + private String firstName; + private String lastName; + private String email; + private String password; + private String phone; + private Integer userStatus; + + /** + * Default constructor. + */ + public User() { + // JSON-B / Jackson + } + + /** + * Create User. + * + * @param id id + * @param username username + * @param firstName firstName + * @param lastName lastName + * @param email email + * @param password password + * @param phone phone + * @param userStatus User Status + */ + public User( + Long id, + String username, + String firstName, + String lastName, + String email, + String password, + String phone, + Integer userStatus + ) { + this.id = id; + this.username = username; + this.firstName = firstName; + this.lastName = lastName; + this.email = email; + this.password = password; + this.phone = phone; + this.userStatus = userStatus; + } + + + + /** + * Get id + * @return id + */ + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + /** + * Get username + * @return username + */ + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + /** + * Get firstName + * @return firstName + */ + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * Get lastName + * @return lastName + */ + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * Get email + * @return email + */ + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + /** + * Get password + * @return password + */ + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + /** + * Get phone + * @return phone + */ + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + /** + * User Status + * @return userStatus + */ + public Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/package-info.java b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/package-info.java new file mode 100644 index 00000000000..1025e91aed8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/java/org/openapitools/server/package-info.java @@ -0,0 +1 @@ +package org.openapitools.server; \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml new file mode 100644 index 00000000000..a599f08c0f9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/resources/META-INF/openapi.yml @@ -0,0 +1,2168 @@ +openapi: 3.0.0 +info: + description: "This spec is mainly for testing Petstore server and contains fake\ + \ endpoints, models. Please do not use this for any other purpose. Special characters:\ + \ \" \\" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_varaible +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + x-accepts: application/json + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-content-type: application/json + x-accepts: application/json + put: + description: "" + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: Successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-webclient-blocking: true + x-content-type: application/json + x-accepts: application/json + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + - description: test server with variables + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + description: target server + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-webclient-blocking: true + x-accepts: application/json + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-webclient-blocking: true + x-accepts: application/json + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + description: Successful operation + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-webclient-blocking: true + x-accepts: application/json + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-content-type: multipart/form-data + x-accepts: application/json + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-content-type: application/json + x-accepts: application/json + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: application/json + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + x-content-type: application/json + x-accepts: application/json + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: application/json + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: application/json + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + x-accepts: application/json + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + x-content-type: application/json + x-accepts: application/json + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-content-type: application/json + x-accepts: application/json + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Someting wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: application/json + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + - explode: true + in: query + name: enum_query_model_array + required: false + schema: + items: + $ref: '#/components/schemas/EnumClass' + type: array + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-content-type: application/json + x-accepts: application/json + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-content-type: application/json + x-accepts: '*/*' + /fake/property/enum-int: + post: + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Input enum (int) as post body + required: true + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Output enum (int) + tags: + - fake + x-content-type: application/json + x-accepts: '*/*' + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-content-type: application/json + x-accepts: '*/*' + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-content-type: application/json + x-accepts: '*/*' + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-content-type: application/json + x-accepts: '*/*' + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: application/json + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: application/json + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-content-type: application/json + x-accepts: application/json + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request must reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: application/json + /fake/body-with-binary: + put: + description: "For this test, the body has to be a binary file." + operationId: testBodyWithBinary + requestBody: + content: + image/png: + schema: + format: binary + nullable: true + type: string + description: image to upload + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: image/png + x-accepts: application/json + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: pipeDelimited + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: language + required: false + schema: + additionalProperties: + format: string + type: string + type: object + style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: application/json + /fake/{petId}/uploadImageWithRequiredFile: + post: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-content-type: multipart/form-data + x-accepts: application/json + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: application/json + /fake/http-signature-test: + get: + operationId: fake-http-signature-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - http_signature_test: [] + summary: test http signature authentication + tags: + - fake + x-content-type: application/json + x-accepts: application/json +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Cat_allOf' + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + maxItems: 3 + minItems: 0 + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + example: 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + OuterObjectWithEnumProperty: + example: + value: 2 + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + required: + - value + type: object + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true + items: + $ref: '#/components/schemas/Bar' + type: array + type: object + AllOfWithSingleRef: + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + type: object + SingleRefType: + enum: + - admin + - user + title: SingleRefType + type: string + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + Dog_allOf: + properties: + breed: + type: string + type: object + example: null + Cat_allOf: + properties: + declawed: + type: boolean + type: object + example: null + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http diff --git a/samples/server/petstore/java-helidon-server/se/src/main/resources/application.yaml b/samples/server/petstore/java-helidon-server/se/src/main/resources/application.yaml new file mode 100644 index 00000000000..2c0422edc74 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/resources/application.yaml @@ -0,0 +1,3 @@ +server: + port: 8080 + host: petstore.swagger.io diff --git a/samples/server/petstore/java-helidon-server/se/src/main/resources/logging.properties b/samples/server/petstore/java-helidon-server/se/src/main/resources/logging.properties new file mode 100644 index 00000000000..cd238eb6615 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/main/resources/logging.properties @@ -0,0 +1,19 @@ + +# Example Logging Configuration File +# For more information see $JAVA_HOME/jre/lib/logging.properties + +# Send messages to the console +handlers=io.helidon.common.HelidonConsoleHandler + +# HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread +java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n + +# Global logging level. Can be overridden by specific loggers +.level=INFO + +# Component specific log levels +#io.helidon.webserver.level=INFO +#io.helidon.config.level=INFO +#io.helidon.security.level=INFO +#io.helidon.common.level=INFO +#io.netty.level=INFO diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/MainTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/MainTest.java new file mode 100644 index 00000000000..3035d3c4fc1 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/MainTest.java @@ -0,0 +1,47 @@ +package org.openapitools.server; + +import java.util.Collections; +import java.util.concurrent.TimeUnit; + +import jakarta.json.Json; +import jakarta.json.JsonBuilderFactory; + +import io.helidon.media.jsonp.JsonpSupport; +import io.helidon.webclient.WebClient; +import io.helidon.webserver.WebServer; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled +public class MainTest { + + private static WebServer webServer; + private static WebClient webClient; + private static final JsonBuilderFactory JSON_BUILDER = Json.createBuilderFactory(Collections.emptyMap()); + + @BeforeAll + public static void startTheServer() throws Exception { + webServer = Main.startServer().await(); + + webClient = WebClient.builder() + .baseUri("http://localhost:" + webServer.port()) + .addMediaSupport(JsonpSupport.create()) + .build(); + } + + @AfterAll + public static void stopServer() throws Exception { + if (webServer != null) { + webServer.shutdown() + .toCompletableFuture() + .get(10, TimeUnit.SECONDS); + } + } + + @Test + public void test() throws Exception { + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..87b0cf9126e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AdditionalPropertiesClass + */ +public class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + public void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapProperty' + */ + @Test + public void mapPropertyTest() { + // TODO: test mapProperty + } + + /** + * Test the property 'mapOfMapProperty' + */ + @Test + public void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java new file mode 100644 index 00000000000..83a14ba8273 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.openapitools.server.model.SingleRefType; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for AllOfWithSingleRef + */ +public class AllOfWithSingleRefTest { + private final AllOfWithSingleRef model = new AllOfWithSingleRef(); + + /** + * Model tests for AllOfWithSingleRef + */ + @Test + public void testAllOfWithSingleRef() { + // TODO: test AllOfWithSingleRef + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'singleRefType' + */ + @Test + public void singleRefTypeTest() { + // TODO: test singleRefType + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AnimalTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AnimalTest.java new file mode 100644 index 00000000000..1299d46ba6f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/AnimalTest.java @@ -0,0 +1,53 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Cat; +import org.openapitools.server.model.Dog; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Animal + */ +public class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + public void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..d67cac0b059 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,43 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +public class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + public void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + public void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 00000000000..150ba7b070d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,43 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayOfNumberOnly + */ +public class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + public void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + public void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayTestTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayTestTest.java new file mode 100644 index 00000000000..a2d4f750e1c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ArrayTestTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.List; +import org.openapitools.server.model.ReadOnlyFirst; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ArrayTest + */ +public class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + public void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + public void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + public void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + public void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CapitalizationTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CapitalizationTest.java new file mode 100644 index 00000000000..084a2885fc8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CapitalizationTest.java @@ -0,0 +1,80 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Capitalization + */ +public class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + public void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + public void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + public void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + public void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + public void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + public void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + public void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CatAllOfTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CatAllOfTest.java new file mode 100644 index 00000000000..ab121c24d90 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CatAllOfTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for CatAllOf + */ +public class CatAllOfTest { + private final CatAllOf model = new CatAllOf(); + + /** + * Model tests for CatAllOf + */ + @Test + public void testCatAllOf() { + // TODO: test CatAllOf + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CatTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CatTest.java new file mode 100644 index 00000000000..121dcc9756d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CatTest.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Animal; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Cat + */ +public class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + public void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CategoryTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CategoryTest.java new file mode 100644 index 00000000000..2618c8fd934 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/CategoryTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Category + */ +public class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + public void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClassModelTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClassModelTest.java new file mode 100644 index 00000000000..f62de6d1cc0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClassModelTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ClassModel + */ +public class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + public void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClientTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClientTest.java new file mode 100644 index 00000000000..a9f4c21ebf8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ClientTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Client + */ +public class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + public void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + public void clientTest() { + // TODO: test client + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java new file mode 100644 index 00000000000..9ad380437ce --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DeprecatedObject + */ +public class DeprecatedObjectTest { + private final DeprecatedObject model = new DeprecatedObject(); + + /** + * Model tests for DeprecatedObject + */ + @Test + public void testDeprecatedObject() { + // TODO: test DeprecatedObject + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DogAllOfTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DogAllOfTest.java new file mode 100644 index 00000000000..2759c9a2eb9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DogAllOfTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for DogAllOf + */ +public class DogAllOfTest { + private final DogAllOf model = new DogAllOf(); + + /** + * Model tests for DogAllOf + */ + @Test + public void testDogAllOf() { + // TODO: test DogAllOf + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DogTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DogTest.java new file mode 100644 index 00000000000..70765267f0a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/DogTest.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.openapitools.server.model.Animal; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Dog + */ +public class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + public void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumArraysTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumArraysTest.java new file mode 100644 index 00000000000..42b3832090e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumArraysTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EnumArrays + */ +public class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + public void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + public void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + public void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumClassTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumClassTest.java new file mode 100644 index 00000000000..9c02e17dac0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumClassTest.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EnumClass + */ +public class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + public void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumTestTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumTestTest.java new file mode 100644 index 00000000000..7c95fed8bb8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/EnumTestTest.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.OuterEnum; +import org.openapitools.server.model.OuterEnumDefaultValue; +import org.openapitools.server.model.OuterEnumInteger; +import org.openapitools.server.model.OuterEnumIntegerDefaultValue; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for EnumTest + */ +public class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + public void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + public void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + public void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + public void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + public void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + public void outerEnumTest() { + // TODO: test outerEnum + } + + /** + * Test the property 'outerEnumInteger' + */ + @Test + public void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** + * Test the property 'outerEnumDefaultValue' + */ + @Test + public void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** + * Test the property 'outerEnumIntegerDefaultValue' + */ + @Test + public void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java new file mode 100644 index 00000000000..fbabc01db3c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.List; +import org.openapitools.server.model.ModelFile; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FileSchemaTestClass + */ +public class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + public void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property '_file' + */ + @Test + public void _fileTest() { + // TODO: test _file + } + + /** + * Test the property 'files' + */ + @Test + public void filesTest() { + // TODO: test files + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java new file mode 100644 index 00000000000..d0dc33cef52 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java @@ -0,0 +1,42 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.openapitools.server.model.Foo; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FooGetDefaultResponse + */ +public class FooGetDefaultResponseTest { + private final FooGetDefaultResponse model = new FooGetDefaultResponse(); + + /** + * Model tests for FooGetDefaultResponse + */ + @Test + public void testFooGetDefaultResponse() { + // TODO: test FooGetDefaultResponse + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooTest.java new file mode 100644 index 00000000000..39abe05aad6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FooTest.java @@ -0,0 +1,40 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Foo + */ +public class FooTest { + private final Foo model = new Foo(); + + /** + * Model tests for Foo + */ + @Test + public void testFoo() { + // TODO: test Foo + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FormatTestTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FormatTestTest.java new file mode 100644 index 00000000000..5d988452964 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/FormatTestTest.java @@ -0,0 +1,166 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.io.File; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for FormatTest + */ +public class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + public void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + public void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'decimal' + */ + @Test + public void decimalTest() { + // TODO: test decimal + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + public void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + public void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + public void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'patternWithDigits' + */ + @Test + public void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + + /** + * Test the property 'patternWithDigitsAndDelimiter' + */ + @Test + public void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java new file mode 100644 index 00000000000..5a56ddcc24d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HasOnlyReadOnly + */ +public class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + public void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + public void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java new file mode 100644 index 00000000000..be4be735e57 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for HealthCheckResult + */ +public class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** + * Model tests for HealthCheckResult + */ + @Test + public void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** + * Test the property 'nullableMessage' + */ + @Test + public void nullableMessageTest() { + // TODO: test nullableMessage + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MapTestTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MapTestTest.java new file mode 100644 index 00000000000..3c6c9450be3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MapTestTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for MapTest + */ +public class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + public void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + public void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + public void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + public void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + public void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 00000000000..9b15f918a9b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.server.model.Animal; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +public class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + public void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + public void mapTest() { + // TODO: test map + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.java new file mode 100644 index 00000000000..33b6d47572d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Model200Response + */ +public class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + public void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java new file mode 100644 index 00000000000..43cb48513cf --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelApiResponse + */ +public class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + public void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelFileTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelFileTest.java new file mode 100644 index 00000000000..ff03280b7e5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelFileTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelListTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelListTest.java new file mode 100644 index 00000000000..7f228b19133 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelListTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelReturnTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelReturnTest.java new file mode 100644 index 00000000000..e6af66eb003 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ModelReturnTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelReturn + */ +public class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + public void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + public void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NameTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NameTest.java new file mode 100644 index 00000000000..13114ab4e7a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NameTest.java @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Name + */ +public class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + public void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + public void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + public void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + public void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NullableClassTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NullableClassTest.java new file mode 100644 index 00000000000..e2f2dd91bf7 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NullableClassTest.java @@ -0,0 +1,136 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NullableClass + */ +public class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** + * Model tests for NullableClass + */ + @Test + public void testNullableClass() { + // TODO: test NullableClass + } + + /** + * Test the property 'integerProp' + */ + @Test + public void integerPropTest() { + // TODO: test integerProp + } + + /** + * Test the property 'numberProp' + */ + @Test + public void numberPropTest() { + // TODO: test numberProp + } + + /** + * Test the property 'booleanProp' + */ + @Test + public void booleanPropTest() { + // TODO: test booleanProp + } + + /** + * Test the property 'stringProp' + */ + @Test + public void stringPropTest() { + // TODO: test stringProp + } + + /** + * Test the property 'dateProp' + */ + @Test + public void datePropTest() { + // TODO: test dateProp + } + + /** + * Test the property 'datetimeProp' + */ + @Test + public void datetimePropTest() { + // TODO: test datetimeProp + } + + /** + * Test the property 'arrayNullableProp' + */ + @Test + public void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** + * Test the property 'arrayAndItemsNullableProp' + */ + @Test + public void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** + * Test the property 'arrayItemsNullable' + */ + @Test + public void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** + * Test the property 'objectNullableProp' + */ + @Test + public void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** + * Test the property 'objectAndItemsNullableProp' + */ + @Test + public void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** + * Test the property 'objectItemsNullable' + */ + @Test + public void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.java new file mode 100644 index 00000000000..dede232a8fa --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for NumberOnly + */ +public class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + public void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + public void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 00000000000..55cf9bedb07 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.server.model.DeprecatedObject; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ObjectWithDeprecatedFields + */ +public class ObjectWithDeprecatedFieldsTest { + private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); + + /** + * Model tests for ObjectWithDeprecatedFields + */ + @Test + public void testObjectWithDeprecatedFields() { + // TODO: test ObjectWithDeprecatedFields + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'deprecatedRef' + */ + @Test + public void deprecatedRefTest() { + // TODO: test deprecatedRef + } + + /** + * Test the property 'bars' + */ + @Test + public void barsTest() { + // TODO: test bars + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OrderTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OrderTest.java new file mode 100644 index 00000000000..90607655525 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OrderTest.java @@ -0,0 +1,83 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Order + */ +public class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + public void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + public void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + public void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + public void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + public void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.java new file mode 100644 index 00000000000..f61dfbaf415 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import java.math.BigDecimal; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterComposite + */ +public class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + public void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + public void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + public void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + public void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java new file mode 100644 index 00000000000..55d00b4918c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnumDefaultValue + */ +public class OuterEnumDefaultValueTest { + /** + * Model tests for OuterEnumDefaultValue + */ + @Test + public void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 00000000000..6a5e46c6124 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnumIntegerDefaultValue + */ +public class OuterEnumIntegerDefaultValueTest { + /** + * Model tests for OuterEnumIntegerDefaultValue + */ + @Test + public void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java new file mode 100644 index 00000000000..d6c32e321da --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnumInteger + */ +public class OuterEnumIntegerTest { + /** + * Model tests for OuterEnumInteger + */ + @Test + public void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java new file mode 100644 index 00000000000..5ea29d21383 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterEnum + */ +public class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + public void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 00000000000..d40c868a41b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.openapitools.server.model.OuterEnumInteger; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for OuterObjectWithEnumProperty + */ +public class OuterObjectWithEnumPropertyTest { + private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); + + /** + * Model tests for OuterObjectWithEnumProperty + */ + @Test + public void testOuterObjectWithEnumProperty() { + // TODO: test OuterObjectWithEnumProperty + } + + /** + * Test the property 'value' + */ + @Test + public void valueTest() { + // TODO: test value + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/PetTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/PetTest.java new file mode 100644 index 00000000000..bc913dd50a3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/PetTest.java @@ -0,0 +1,89 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.server.model.Category; +import org.openapitools.server.model.Tag; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Pet + */ +public class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + public void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java new file mode 100644 index 00000000000..2fe4c7fc6b7 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ReadOnlyFirst + */ +public class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + public void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + public void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java new file mode 100644 index 00000000000..4ae2c23f4cb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SingleRefType + */ +public class SingleRefTypeTest { + /** + * Model tests for SingleRefType + */ + @Test + public void testSingleRefType() { + // TODO: test SingleRefType + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java new file mode 100644 index 00000000000..809e043f8ec --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for SpecialModelName + */ +public class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + public void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + public void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/TagTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/TagTest.java new file mode 100644 index 00000000000..4d0d708bf97 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/TagTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for Tag + */ +public class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + public void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/UserTest.java b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/UserTest.java new file mode 100644 index 00000000000..ba936a20805 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/se/src/test/java/org/openapitools/server/model/UserTest.java @@ -0,0 +1,96 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.server.model; + +import org.junit.jupiter.api.Test; + + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + public void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + public void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + public void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + public void userStatusTest() { + // TODO: test userStatus + } + +} From 51dc1c928a1df2ca6ff3b249a458240ac42218d9 Mon Sep 17 00:00:00 2001 From: "tim.quinn@oracle.com" Date: Fri, 23 Sep 2022 18:06:37 -0500 Subject: [PATCH 10/18] Missed updated/generated files Signed-off-by: tim.quinn@oracle.com --- docs/generators.md | 2 + .../mp/.openapi-generator/FILES | 58 ----------------- .../se/.openapi-generator/FILES | 58 ----------------- .../mp/.openapi-generator/FILES | 60 ------------------ .../se/.openapi-generator/FILES | 63 ------------------- 5 files changed, 2 insertions(+), 239 deletions(-) diff --git a/docs/generators.md b/docs/generators.md index 336639c7b2a..cd0466f9ad5 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -32,6 +32,7 @@ The following generators are available: * [groovy](generators/groovy.md) * [haskell-http-client](generators/haskell-http-client.md) * [java](generators/java.md) +* [java-helidon-client (beta)](generators/java-helidon-client.md) * [java-micronaut-client (beta)](generators/java-micronaut-client.md) * [javascript](generators/javascript.md) * [javascript-apollo-deprecated (deprecated)](generators/javascript-apollo-deprecated.md) @@ -92,6 +93,7 @@ The following generators are available: * [haskell](generators/haskell.md) * [haskell-yesod (beta)](generators/haskell-yesod.md) * [java-camel](generators/java-camel.md) +* [java-helidon-server (beta)](generators/java-helidon-server.md) * [java-inflector](generators/java-inflector.md) * [java-micronaut-server (beta)](generators/java-micronaut-server.md) * [java-msf4j](generators/java-msf4j.md) diff --git a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES index eb34506786e..0e0a040ebbd 100644 --- a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES +++ b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES @@ -1,5 +1,3 @@ -.openapi-generator-ignore -README.md docs/AdditionalPropertiesClass.md docs/AllOfWithSingleRef.md docs/Animal.md @@ -55,7 +53,6 @@ docs/StoreApi.md docs/Tag.md docs/User.md docs/UserApi.md -pom.xml src/main/java/org/openapitools/client/JavaTimeFormatter.java src/main/java/org/openapitools/client/RFC3339DateFormat.java src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -115,58 +112,3 @@ src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java -src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java -src/test/java/org/openapitools/client/api/DefaultApiTest.java -src/test/java/org/openapitools/client/api/FakeApiTest.java -src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java -src/test/java/org/openapitools/client/api/PetApiTest.java -src/test/java/org/openapitools/client/api/StoreApiTest.java -src/test/java/org/openapitools/client/api/UserApiTest.java -src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java -src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java -src/test/java/org/openapitools/client/model/AnimalTest.java -src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/client/model/ArrayTestTest.java -src/test/java/org/openapitools/client/model/CapitalizationTest.java -src/test/java/org/openapitools/client/model/CatAllOfTest.java -src/test/java/org/openapitools/client/model/CatTest.java -src/test/java/org/openapitools/client/model/CategoryTest.java -src/test/java/org/openapitools/client/model/ClassModelTest.java -src/test/java/org/openapitools/client/model/ClientTest.java -src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java -src/test/java/org/openapitools/client/model/DogAllOfTest.java -src/test/java/org/openapitools/client/model/DogTest.java -src/test/java/org/openapitools/client/model/EnumArraysTest.java -src/test/java/org/openapitools/client/model/EnumClassTest.java -src/test/java/org/openapitools/client/model/EnumTestTest.java -src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java -src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java -src/test/java/org/openapitools/client/model/FooTest.java -src/test/java/org/openapitools/client/model/FormatTestTest.java -src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java -src/test/java/org/openapitools/client/model/HealthCheckResultTest.java -src/test/java/org/openapitools/client/model/MapTestTest.java -src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java -src/test/java/org/openapitools/client/model/Model200ResponseTest.java -src/test/java/org/openapitools/client/model/ModelApiResponseTest.java -src/test/java/org/openapitools/client/model/ModelFileTest.java -src/test/java/org/openapitools/client/model/ModelListTest.java -src/test/java/org/openapitools/client/model/ModelReturnTest.java -src/test/java/org/openapitools/client/model/NameTest.java -src/test/java/org/openapitools/client/model/NullableClassTest.java -src/test/java/org/openapitools/client/model/NumberOnlyTest.java -src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java -src/test/java/org/openapitools/client/model/OrderTest.java -src/test/java/org/openapitools/client/model/OuterCompositeTest.java -src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java -src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java -src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java -src/test/java/org/openapitools/client/model/OuterEnumTest.java -src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java -src/test/java/org/openapitools/client/model/PetTest.java -src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java -src/test/java/org/openapitools/client/model/SingleRefTypeTest.java -src/test/java/org/openapitools/client/model/SpecialModelNameTest.java -src/test/java/org/openapitools/client/model/TagTest.java -src/test/java/org/openapitools/client/model/UserTest.java diff --git a/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES index 6f20904b624..f7bde3116a0 100644 --- a/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES +++ b/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES @@ -1,5 +1,3 @@ -.openapi-generator-ignore -README.md docs/AdditionalPropertiesClass.md docs/AllOfWithSingleRef.md docs/Animal.md @@ -55,7 +53,6 @@ docs/StoreApi.md docs/Tag.md docs/User.md docs/UserApi.md -pom.xml src/main/java/org/openapitools/client/ApiClient.java src/main/java/org/openapitools/client/ApiResponse.java src/main/java/org/openapitools/client/ApiResponseBase.java @@ -124,58 +121,3 @@ src/main/java/org/openapitools/client/model/SingleRefType.java src/main/java/org/openapitools/client/model/SpecialModelName.java src/main/java/org/openapitools/client/model/Tag.java src/main/java/org/openapitools/client/model/User.java -src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java -src/test/java/org/openapitools/client/api/DefaultApiTest.java -src/test/java/org/openapitools/client/api/FakeApiTest.java -src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java -src/test/java/org/openapitools/client/api/PetApiTest.java -src/test/java/org/openapitools/client/api/StoreApiTest.java -src/test/java/org/openapitools/client/api/UserApiTest.java -src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java -src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java -src/test/java/org/openapitools/client/model/AnimalTest.java -src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/client/model/ArrayTestTest.java -src/test/java/org/openapitools/client/model/CapitalizationTest.java -src/test/java/org/openapitools/client/model/CatAllOfTest.java -src/test/java/org/openapitools/client/model/CatTest.java -src/test/java/org/openapitools/client/model/CategoryTest.java -src/test/java/org/openapitools/client/model/ClassModelTest.java -src/test/java/org/openapitools/client/model/ClientTest.java -src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java -src/test/java/org/openapitools/client/model/DogAllOfTest.java -src/test/java/org/openapitools/client/model/DogTest.java -src/test/java/org/openapitools/client/model/EnumArraysTest.java -src/test/java/org/openapitools/client/model/EnumClassTest.java -src/test/java/org/openapitools/client/model/EnumTestTest.java -src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java -src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java -src/test/java/org/openapitools/client/model/FooTest.java -src/test/java/org/openapitools/client/model/FormatTestTest.java -src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java -src/test/java/org/openapitools/client/model/HealthCheckResultTest.java -src/test/java/org/openapitools/client/model/MapTestTest.java -src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java -src/test/java/org/openapitools/client/model/Model200ResponseTest.java -src/test/java/org/openapitools/client/model/ModelApiResponseTest.java -src/test/java/org/openapitools/client/model/ModelFileTest.java -src/test/java/org/openapitools/client/model/ModelListTest.java -src/test/java/org/openapitools/client/model/ModelReturnTest.java -src/test/java/org/openapitools/client/model/NameTest.java -src/test/java/org/openapitools/client/model/NullableClassTest.java -src/test/java/org/openapitools/client/model/NumberOnlyTest.java -src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java -src/test/java/org/openapitools/client/model/OrderTest.java -src/test/java/org/openapitools/client/model/OuterCompositeTest.java -src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java -src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java -src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java -src/test/java/org/openapitools/client/model/OuterEnumTest.java -src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java -src/test/java/org/openapitools/client/model/PetTest.java -src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java -src/test/java/org/openapitools/client/model/SingleRefTypeTest.java -src/test/java/org/openapitools/client/model/SpecialModelNameTest.java -src/test/java/org/openapitools/client/model/TagTest.java -src/test/java/org/openapitools/client/model/UserTest.java diff --git a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES index 25cb8725527..3fca3cdbaaa 100644 --- a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES +++ b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES @@ -1,23 +1,13 @@ -.openapi-generator-ignore -README.md -pom.xml src/main/java/org/openapitools/server/JavaTimeFormatter.java src/main/java/org/openapitools/server/RFC3339DateFormat.java src/main/java/org/openapitools/server/RestApplication.java src/main/java/org/openapitools/server/api/AnotherFakeService.java -src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java src/main/java/org/openapitools/server/api/DefaultService.java -src/main/java/org/openapitools/server/api/DefaultServiceImpl.java src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java -src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java src/main/java/org/openapitools/server/api/FakeService.java -src/main/java/org/openapitools/server/api/FakeServiceImpl.java src/main/java/org/openapitools/server/api/PetService.java -src/main/java/org/openapitools/server/api/PetServiceImpl.java src/main/java/org/openapitools/server/api/StoreService.java -src/main/java/org/openapitools/server/api/StoreServiceImpl.java src/main/java/org/openapitools/server/api/UserService.java -src/main/java/org/openapitools/server/api/UserServiceImpl.java src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java src/main/java/org/openapitools/server/model/Animal.java @@ -66,56 +56,6 @@ src/main/java/org/openapitools/server/model/SingleRefType.java src/main/java/org/openapitools/server/model/SpecialModelName.java src/main/java/org/openapitools/server/model/Tag.java src/main/java/org/openapitools/server/model/User.java -src/main/java/org/openapitools/server/package-info.java src/main/resources/META-INF/beans.xml src/main/resources/META-INF/microprofile-config.properties src/main/resources/META-INF/openapi.yml -src/main/resources/logging.properties -src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java -src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java -src/test/java/org/openapitools/server/model/AnimalTest.java -src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/server/model/ArrayTestTest.java -src/test/java/org/openapitools/server/model/CapitalizationTest.java -src/test/java/org/openapitools/server/model/CatAllOfTest.java -src/test/java/org/openapitools/server/model/CatTest.java -src/test/java/org/openapitools/server/model/CategoryTest.java -src/test/java/org/openapitools/server/model/ClassModelTest.java -src/test/java/org/openapitools/server/model/ClientTest.java -src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java -src/test/java/org/openapitools/server/model/DogAllOfTest.java -src/test/java/org/openapitools/server/model/DogTest.java -src/test/java/org/openapitools/server/model/EnumArraysTest.java -src/test/java/org/openapitools/server/model/EnumClassTest.java -src/test/java/org/openapitools/server/model/EnumTestTest.java -src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java -src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java -src/test/java/org/openapitools/server/model/FooTest.java -src/test/java/org/openapitools/server/model/FormatTestTest.java -src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java -src/test/java/org/openapitools/server/model/HealthCheckResultTest.java -src/test/java/org/openapitools/server/model/MapTestTest.java -src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java -src/test/java/org/openapitools/server/model/Model200ResponseTest.java -src/test/java/org/openapitools/server/model/ModelApiResponseTest.java -src/test/java/org/openapitools/server/model/ModelFileTest.java -src/test/java/org/openapitools/server/model/ModelListTest.java -src/test/java/org/openapitools/server/model/ModelReturnTest.java -src/test/java/org/openapitools/server/model/NameTest.java -src/test/java/org/openapitools/server/model/NullableClassTest.java -src/test/java/org/openapitools/server/model/NumberOnlyTest.java -src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java -src/test/java/org/openapitools/server/model/OrderTest.java -src/test/java/org/openapitools/server/model/OuterCompositeTest.java -src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java -src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java -src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java -src/test/java/org/openapitools/server/model/OuterEnumTest.java -src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java -src/test/java/org/openapitools/server/model/PetTest.java -src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java -src/test/java/org/openapitools/server/model/SingleRefTypeTest.java -src/test/java/org/openapitools/server/model/SpecialModelNameTest.java -src/test/java/org/openapitools/server/model/TagTest.java -src/test/java/org/openapitools/server/model/UserTest.java diff --git a/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES index 7d452a07dfb..41a6ebc821e 100644 --- a/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES +++ b/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES @@ -1,23 +1,12 @@ -.openapi-generator-ignore -README.md -pom.xml -src/main/java/org/openapitools/server/Main.java src/main/java/org/openapitools/server/RFC3339DateFormat.java src/main/java/org/openapitools/server/api/AnotherFakeService.java -src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java src/main/java/org/openapitools/server/api/DefaultService.java -src/main/java/org/openapitools/server/api/DefaultServiceImpl.java src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java -src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java src/main/java/org/openapitools/server/api/FakeService.java -src/main/java/org/openapitools/server/api/FakeServiceImpl.java src/main/java/org/openapitools/server/api/JsonProvider.java src/main/java/org/openapitools/server/api/PetService.java -src/main/java/org/openapitools/server/api/PetServiceImpl.java src/main/java/org/openapitools/server/api/StoreService.java -src/main/java/org/openapitools/server/api/StoreServiceImpl.java src/main/java/org/openapitools/server/api/UserService.java -src/main/java/org/openapitools/server/api/UserServiceImpl.java src/main/java/org/openapitools/server/api/ValidatorUtils.java src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java @@ -67,56 +56,4 @@ src/main/java/org/openapitools/server/model/SingleRefType.java src/main/java/org/openapitools/server/model/SpecialModelName.java src/main/java/org/openapitools/server/model/Tag.java src/main/java/org/openapitools/server/model/User.java -src/main/java/org/openapitools/server/package-info.java src/main/resources/META-INF/openapi.yml -src/main/resources/application.yaml -src/main/resources/logging.properties -src/test/java/org/openapitools/server/MainTest.java -src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java -src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java -src/test/java/org/openapitools/server/model/AnimalTest.java -src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/server/model/ArrayTestTest.java -src/test/java/org/openapitools/server/model/CapitalizationTest.java -src/test/java/org/openapitools/server/model/CatAllOfTest.java -src/test/java/org/openapitools/server/model/CatTest.java -src/test/java/org/openapitools/server/model/CategoryTest.java -src/test/java/org/openapitools/server/model/ClassModelTest.java -src/test/java/org/openapitools/server/model/ClientTest.java -src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java -src/test/java/org/openapitools/server/model/DogAllOfTest.java -src/test/java/org/openapitools/server/model/DogTest.java -src/test/java/org/openapitools/server/model/EnumArraysTest.java -src/test/java/org/openapitools/server/model/EnumClassTest.java -src/test/java/org/openapitools/server/model/EnumTestTest.java -src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java -src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java -src/test/java/org/openapitools/server/model/FooTest.java -src/test/java/org/openapitools/server/model/FormatTestTest.java -src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java -src/test/java/org/openapitools/server/model/HealthCheckResultTest.java -src/test/java/org/openapitools/server/model/MapTestTest.java -src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java -src/test/java/org/openapitools/server/model/Model200ResponseTest.java -src/test/java/org/openapitools/server/model/ModelApiResponseTest.java -src/test/java/org/openapitools/server/model/ModelFileTest.java -src/test/java/org/openapitools/server/model/ModelListTest.java -src/test/java/org/openapitools/server/model/ModelReturnTest.java -src/test/java/org/openapitools/server/model/NameTest.java -src/test/java/org/openapitools/server/model/NullableClassTest.java -src/test/java/org/openapitools/server/model/NumberOnlyTest.java -src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java -src/test/java/org/openapitools/server/model/OrderTest.java -src/test/java/org/openapitools/server/model/OuterCompositeTest.java -src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java -src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java -src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java -src/test/java/org/openapitools/server/model/OuterEnumTest.java -src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java -src/test/java/org/openapitools/server/model/PetTest.java -src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java -src/test/java/org/openapitools/server/model/SingleRefTypeTest.java -src/test/java/org/openapitools/server/model/SpecialModelNameTest.java -src/test/java/org/openapitools/server/model/TagTest.java -src/test/java/org/openapitools/server/model/UserTest.java From b24c2d42bcb891efefbcf0210faba1ee247015c0 Mon Sep 17 00:00:00 2001 From: Tim Quinn Date: Thu, 6 Oct 2022 12:50:56 -0500 Subject: [PATCH 11/18] Add Helidon samples to JDK17 samples workflow (#68) Signed-off-by: tim.quinn@oracle.com Signed-off-by: tim.quinn@oracle.com --- .github/workflows/samples-jdk17.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/samples-jdk17.yaml b/.github/workflows/samples-jdk17.yaml index 3403f99621f..153802e17f3 100644 --- a/.github/workflows/samples-jdk17.yaml +++ b/.github/workflows/samples-jdk17.yaml @@ -4,14 +4,22 @@ on: paths: # clients - samples/openapi3/client/petstore/spring-cloud-3/** + - samples/client/petstore/java-helidon-client/mp + - samples/client/petstore/java-helidon-client/se # servers - samples/openapi3/server/petstore/springboot-3/** + - samples/server/petstore/java-helidon-server/mp + - samples/server/petstore/java-helidon-server/se pull_request: paths: # clients - samples/openapi3/client/petstore/spring-cloud-3/** + - samples/client/petstore/java-helidon-client/mp + - samples/client/petstore/java-helidon-client/se # servers - samples/openapi3/server/petstore/springboot-3/** + - samples/server/petstore/java-helidon-server/mp + - samples/server/petstore/java-helidon-server/se jobs: build: name: Build with JDK17 @@ -22,8 +30,12 @@ jobs: sample: # clients - samples/openapi3/client/petstore/spring-cloud-3 + - samples/client/petstore/java-helidon-client/mp + - samples/client/petstore/java-helidon-client/se # servers - samples/openapi3/server/petstore/springboot-3 + - samples/server/petstore/java-helidon-server/mp + - samples/server/petstore/java-helidon-server/se steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 From 9e5625c84255b4f07cbe26ad367f1c6e5170bfa3 Mon Sep 17 00:00:00 2001 From: Tim Quinn Date: Thu, 6 Oct 2022 16:05:32 -0500 Subject: [PATCH 12/18] Push generated samples with updated version (#70) Signed-off-by: tim.quinn@oracle.com Signed-off-by: tim.quinn@oracle.com --- .../petstore/java-helidon-client/mp/.openapi-generator/VERSION | 2 +- .../petstore/java-helidon-client/se/.openapi-generator/VERSION | 2 +- .../petstore/java-helidon-server/mp/.openapi-generator/VERSION | 2 +- .../petstore/java-helidon-server/se/.openapi-generator/VERSION | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/VERSION b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/VERSION index 7b7e20b5703..ed829dbcdde 100644 --- a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/VERSION +++ b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/VERSION @@ -1 +1 @@ -6.1.1-SNAPSHOT \ No newline at end of file +6.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java-helidon-client/se/.openapi-generator/VERSION b/samples/client/petstore/java-helidon-client/se/.openapi-generator/VERSION index 7b7e20b5703..ed829dbcdde 100644 --- a/samples/client/petstore/java-helidon-client/se/.openapi-generator/VERSION +++ b/samples/client/petstore/java-helidon-client/se/.openapi-generator/VERSION @@ -1 +1 @@ -6.1.1-SNAPSHOT \ No newline at end of file +6.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/VERSION b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/VERSION index 7b7e20b5703..ed829dbcdde 100644 --- a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/VERSION +++ b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/VERSION @@ -1 +1 @@ -6.1.1-SNAPSHOT \ No newline at end of file +6.2.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/se/.openapi-generator/VERSION b/samples/server/petstore/java-helidon-server/se/.openapi-generator/VERSION index 7b7e20b5703..ed829dbcdde 100644 --- a/samples/server/petstore/java-helidon-server/se/.openapi-generator/VERSION +++ b/samples/server/petstore/java-helidon-server/se/.openapi-generator/VERSION @@ -1 +1 @@ -6.1.1-SNAPSHOT \ No newline at end of file +6.2.1-SNAPSHOT \ No newline at end of file From 700f01dbf84931e52a2ba23998e269eec42e14ad Mon Sep 17 00:00:00 2001 From: Tim Quinn Date: Tue, 11 Oct 2022 13:23:46 -0500 Subject: [PATCH 13/18] Update copyrights; incorporate intervening change to samples-jdk17.yaml (#71) Signed-off-by: tim.quinn@oracle.com Signed-off-by: tim.quinn@oracle.com --- .../languages/JavaHelidonClientCodegen.java | 3 +-- .../languages/JavaHelidonCommonCodegen.java | 1 + .../languages/JavaHelidonServerCodegen.java | 1 + ...vaHelidonCommonCodegenPackagePrefixTest.java | 1 + .../helidon/JavaHelidonCommonCodegenTest.java | 1 + .../helidon/JavaHelidonMpClientCodegenTest.java | 17 +++++++++++++++++ .../helidon/JavaHelidonMpServerCodegenTest.java | 17 +++++++++++++++++ .../helidon/JavaHelidonSeClientCodegenTest.java | 5 +++-- .../helidon/JavaHelidonSeServerCodegenTest.java | 16 ++++++++++++++++ .../java/helidon/functional/FunctionalBase.java | 1 + .../functional/FunctionalHelidonClientBase.java | 1 + .../FunctionalHelidonMPClientTest.java | 1 + .../FunctionalHelidonMPServerTest.java | 1 + .../FunctionalHelidonSEClientTest.java | 1 + .../FunctionalHelidonSeServerTest.java | 1 + 15 files changed, 64 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java index 6f2de171dd7..755a6247620 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonClientCodegen.java @@ -1,6 +1,5 @@ /* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) * Copyright (c) 2022 Oracle and/or its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java index 53beef1e21c..14495faceff 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java @@ -1,4 +1,5 @@ /* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) * Copyright (c) 2022 Oracle and/or its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java index 267d1e58509..852ccbab4b7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonServerCodegen.java @@ -1,4 +1,5 @@ /* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) * Copyright (c) 2022 Oracle and/or its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java index 70f0e76eca9..d55c062f7e7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenPackagePrefixTest.java @@ -1,4 +1,5 @@ /* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) * Copyright (c) 2022 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenTest.java index d399c97de46..c92b404c09d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonCommonCodegenTest.java @@ -1,4 +1,5 @@ /* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) * Copyright (c) 2022 Oracle and/or its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpClientCodegenTest.java index 28a03cd6944..3cecbf9b605 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpClientCodegenTest.java @@ -1,3 +1,20 @@ +/* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.openapitools.codegen.java.helidon; import java.io.File; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpServerCodegenTest.java index 599ef9f43d6..8f278b64ac4 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpServerCodegenTest.java @@ -1,3 +1,20 @@ +/* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.openapitools.codegen.java.helidon; import org.openapitools.codegen.DefaultGenerator; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeClientCodegenTest.java index 8ce80c3aca6..61e49d79f8f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeClientCodegenTest.java @@ -1,11 +1,12 @@ /* - * Copyright (c) 2022 Oracle and/or its affiliates. + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright (c) 2022 Oracle and/or its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeServerCodegenTest.java index fb629a114ed..0e415b83869 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonSeServerCodegenTest.java @@ -1,3 +1,19 @@ +/* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * Copyright (c) 2022 Oracle and/or its affiliates + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.openapitools.codegen.java.helidon; import java.io.File; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalBase.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalBase.java index c7094725ad1..15c858f4352 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalBase.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalBase.java @@ -1,4 +1,5 @@ /* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) * Copyright (c) 2022 Oracle and/or its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonClientBase.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonClientBase.java index a3997aea8e3..967e77bcbaf 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonClientBase.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonClientBase.java @@ -1,4 +1,5 @@ /* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) * Copyright (c) 2022 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPClientTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPClientTest.java index 2837e5f69b8..7c2aa943556 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPClientTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPClientTest.java @@ -1,4 +1,5 @@ /* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) * Copyright (c) 2022 Oracle and/or its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPServerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPServerTest.java index 2f62ffcab7d..ca19e93f7a3 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPServerTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonMPServerTest.java @@ -1,4 +1,5 @@ /* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) * Copyright (c) 2022 Oracle and/or its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSEClientTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSEClientTest.java index 1a4341e5c65..8e390f59154 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSEClientTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSEClientTest.java @@ -1,4 +1,5 @@ /* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) * Copyright (c) 2022 Oracle and/or its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSeServerTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSeServerTest.java index 3ef3bb45e95..020c44257d6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSeServerTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/functional/FunctionalHelidonSeServerTest.java @@ -1,4 +1,5 @@ /* + * Copyright 2022 OpenAPI-Generator Contributors (https://openapi-generator.tech) * Copyright (c) 2022 Oracle and/or its affiliates * * Licensed under the Apache License, Version 2.0 (the "License"); From 048f78e0c6893ffd7d90b98fc5f8a21e5607be5c Mon Sep 17 00:00:00 2001 From: Tim Quinn Date: Thu, 13 Oct 2022 11:39:59 -0500 Subject: [PATCH 14/18] Change generated MP server return type from `Response` to the document-indicated type (#72) Signed-off-by: tim.quinn@oracle.com Signed-off-by: tim.quinn@oracle.com --- .../languages/JavaHelidonCommonCodegen.java | 58 +++++++++++++++++++ .../server/libraries/mp/api.mustache | 3 +- .../server/libraries/mp/apiAbstract.mustache | 2 +- .../server/libraries/mp/apiImpl.mustache | 2 + .../server/libraries/mp/apiMethod.mustache | 19 +++++- .../mp/returnAsyncTypeInterface.mustache | 1 + .../server/libraries/mp/returnTypes.mustache | 2 +- .../JavaHelidonMpServerCodegenTest.java | 51 ++++++++++++++-- .../server/api/AnotherFakeService.java | 4 +- .../server/api/DefaultService.java | 4 +- .../api/FakeClassnameTags123Service.java | 4 +- .../openapitools/server/api/FakeService.java | 36 ++++++------ .../openapitools/server/api/PetService.java | 20 +++---- .../openapitools/server/api/StoreService.java | 10 ++-- .../openapitools/server/api/UserService.java | 18 +++--- 15 files changed, 170 insertions(+), 64 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/returnAsyncTypeInterface.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java index 14495faceff..50519b08370 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java @@ -24,8 +24,11 @@ import java.util.Locale; import java.util.Set; import java.util.stream.Collectors; +import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.servers.Server; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.languages.features.BeanValidationFeatures; import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures; @@ -52,6 +55,8 @@ public abstract class JavaHelidonCommonCodegen extends AbstractJavaCodegen static final String MICROPROFILE_ROOT_PACKAGE = "rootJavaEEPackage"; static final String MICROPROFILE_ROOT_DEP_PREFIX = "x-helidon-rootJavaEEDepPrefix"; + static final String X_HAS_RETURN_TYPE = "x-helidon-hasReturnType"; + static final String X_RETURN_TYPE_EXAMPLE_VALUE = "x-helidon-exampleReturnTypeValue"; static final String MICROPROFILE_ROOT_PACKAGE_DESC = "Root package name for Java EE"; static final String MICROPROFILE_ROOT_PACKAGE_JAVAX = "javax"; static final String MICROPROFILE_ROOT_PACKAGE_JAKARTA = "jakarta"; @@ -125,6 +130,14 @@ public abstract class JavaHelidonCommonCodegen extends AbstractJavaCodegen setEEPackageAndDependencies(helidonVersion); } + @Override + public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { + CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); + op.vendorExtensions.put(X_HAS_RETURN_TYPE, op.returnType != null && !op.returnType.equals("void")); + op.vendorExtensions.put(X_RETURN_TYPE_EXAMPLE_VALUE, chooseExampleReturnTypeValue(op)); + return op; + } + /** * Remove set of options not currently used by any Helidon generator. Should be * called during construction but only on leaf classes. @@ -257,4 +270,49 @@ public abstract class JavaHelidonCommonCodegen extends AbstractJavaCodegen .collect(Collectors.toSet()); forRemoval.forEach(cliOptions::remove); } + + private String chooseExampleReturnTypeValue(CodegenOperation op) { + + // See DefaultCodegen#handleMethodResponse to see how the various op fields related to the return type are set. + if (op.returnType == null) { + return ""; // won't be used anyway in the templates + } + if (op.isMap) { + return "java.util.Collections.emptyMap()"; + } + if (op.isArray) { + return "java.util.Collections.emptyList()"; + } + switch (op.returnType) { + case "Integer": + return "new Integer(0)"; + + case "byte[]": + return "new byte[0]"; + + case "Float": + return "new Float(0.0f)"; + + case "boolean": + return "false"; + + case "Long": + return "new Long(0L)"; + + case "Object": + return "new Object()"; + + case "String": + return "\"\""; + + case "Boolean": + return "new Boolean(false)"; + + case "Double": + return "new Double(0.0d)"; + + default: + return "null"; + } + } } diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api.mustache index 5527f4d8165..495b0cc7599 100644 --- a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api.mustache +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/api.mustache @@ -5,8 +5,9 @@ package {{package}}; {{/imports}} import {{rootJavaEEPackage}}.ws.rs.*; +{{#returnResponse}} import {{rootJavaEEPackage}}.ws.rs.core.Response; - +{{/returnResponse}} {{#supportAsync}} import java.util.concurrent.CompletionStage; import java.util.concurrent.CompletableFuture; diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiAbstract.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiAbstract.mustache index bbed9724d48..a2d82121b02 100644 --- a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiAbstract.mustache +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiAbstract.mustache @@ -2,4 +2,4 @@ @Path("{{{path}}}"){{/subresourceOperation}}{{#hasConsumes}} @Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}} @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} - abstract {{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}Response{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}); \ No newline at end of file + {{#useAbstractClass}}abstract {{/useAbstractClass}}{{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}{{>returnTypes}}{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiImpl.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiImpl.mustache index 140daa53eb2..9c9db82b249 100644 --- a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiImpl.mustache +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiImpl.mustache @@ -5,7 +5,9 @@ package {{package}}; {{/imports}} import {{rootJavaEEPackage}}.ws.rs.*; +{{#returnResponse}} import {{rootJavaEEPackage}}.ws.rs.core.Response; +{{/returnResponse}} {{#supportAsync}} import java.util.concurrent.CompletionStage; diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiMethod.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiMethod.mustache index 96387ec48e0..b1c07572f6c 100644 --- a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiMethod.mustache +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/apiMethod.mustache @@ -2,6 +2,21 @@ @Path("{{{path}}}"){{/subresourceOperation}}{{#hasConsumes}} @Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}} @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} - public {{#supportAsync}}CompletionStage<{{/supportAsync}}Response{{#supportAsync}}>{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { - return {{#supportAsync}}CompletableFuture.supplyAsync(() -> {{/supportAsync}}Response.ok().entity("magic!").build(){{#supportAsync}}){{/supportAsync}}; + public {{#supportAsync}}{{>returnAsyncTypeInterface}}{{/supportAsync}}{{^supportAsync}}{{>returnTypes}}{{/supportAsync}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { + {{#returnResponse}} + return {{#supportAsync}}CompletableFuture.supplyAsync(() -> {{/supportAsync}}Response.ok({{#vendorExtensions.x-helidon-hasReturnType}}/* Pass {{{returnType}}} entity payload */{{/vendorExtensions.x-helidon-hasReturnType}}).build(){{#supportAsync}}){{/supportAsync}}; // Replace with correct business logic. + {{/returnResponse}} + {{^returnResponse}} + {{#vendorExtensions.x-helidon-hasReturnType}} + {{{returnType}}} result = {{{vendorExtensions.x-helidon-exampleReturnTypeValue}}}; // Replace with correct business logic. + {{/vendorExtensions.x-helidon-hasReturnType}} + {{#supportAsync}} + return CompletableFuture.supplyAsync(() -> {{#vendorExtensions.x-helidon-hasReturnType}}result{{/vendorExtensions.x-helidon-hasReturnType}}{{^vendorExtensions.x-helidon-hasReturnType}}null{{/vendorExtensions.x-helidon-hasReturnType}}); + {{/supportAsync}} + {{^supportAsync}} + {{#vendorExtensions.x-helidon-hasReturnType}} + return result; + {{/vendorExtensions.x-helidon-hasReturnType}} + {{/supportAsync}} + {{/returnResponse}} } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/returnAsyncTypeInterface.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/returnAsyncTypeInterface.mustache new file mode 100644 index 00000000000..0da348c7a22 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/returnAsyncTypeInterface.mustache @@ -0,0 +1 @@ +CompletionStage<{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnBaseType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnBaseType}}}{{/returnContainer}}{{/returnResponse}}> \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/returnTypes.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/returnTypes.mustache index 433b7334785..87831bd299e 100644 --- a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/returnTypes.mustache @@ -1 +1 @@ -{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}} \ No newline at end of file +{{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{#returnContainer}}{{#isMap}}Map{{/isMap}}{{#isArray}}{{{returnContainer}}}<{{{returnBaseType}}}>{{/isArray}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}{{/returnResponse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpServerCodegenTest.java index 8f278b64ac4..312d2f9d855 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/helidon/JavaHelidonMpServerCodegenTest.java @@ -29,6 +29,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Objects; +import java.util.concurrent.CompletableFuture; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -111,13 +112,13 @@ public class JavaHelidonMpServerCodegenTest { .fileContains("public abstract class StoreService") .assertMethod("placeOrder", "Order") .doesNotHaveImplementation() - .hasReturnType("Response"); + .hasReturnType("Order"); JavaFileAssert.assertThat(Paths.get(apiPackage + "/StoreServiceImpl.java")) .fileContains("public class StoreServiceImpl extends StoreService") .assertMethod("placeOrder", "Order") - .hasReturnType("Response") - .bodyContainsLines("return Response.ok().entity(\"magic!\").build();"); + .hasReturnType("Order") + .bodyContainsLines("Order result = null; // Replace with correct business logic.", "return result;"); } @Test @@ -131,7 +132,7 @@ public class JavaHelidonMpServerCodegenTest { JavaFileAssert.assertThat(Paths.get(apiPackage + "/StoreService.java")) .fileContains("public interface StoreService") .assertMethod("placeOrder", "Order") - .hasReturnType("Response"); + .hasReturnType("Order"); } @Test @@ -206,4 +207,46 @@ public class JavaHelidonMpServerCodegenTest { TestUtils.assertFileNotExists(Paths.get(outputPath + "/pom.xml")); } + @Test + public void testReturnResponse() { + generate(createConfigurator().addAdditionalProperty("returnResponse", "true")); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/PetService.java")) + .fileContains("public interface PetService") + .assertMethod("addPet", "Pet") + .hasReturnType("Response"); + JavaFileAssert.assertThat(Paths.get(apiPackage + "/PetService.java")) + .fileContains("public interface PetService") + .assertMethod("deletePet", "Long", "String", "Long", "String", "Integer", "List", "List") + .hasReturnType("Response"); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/PetServiceImpl.java")) + .fileContains("public class PetServiceImpl implements PetService") + .assertMethod("addPet", "Pet") + .hasReturnType("Response") + .bodyContainsLines("return Response.ok(/* Pass Pet entity payload */).build(); " + + "// Replace with correct business logic."); + } + + @Test + public void testSupportAsync() { + generate(createConfigurator().addAdditionalProperty("supportAsync", "true")); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/PetService.java")) + .fileContains("public interface PetService") + .assertMethod("addPet", "Pet") + .hasReturnType("CompletionStage"); + JavaFileAssert.assertThat(Paths.get(apiPackage + "/PetService.java")) + .fileContains("public interface PetService") + .assertMethod("deletePet", "Long", "String", "Long", "String", "Integer", "List", "List") + .hasReturnType("CompletionStage"); + + JavaFileAssert.assertThat(Paths.get(apiPackage + "/PetServiceImpl.java")) + .fileContains("public class PetServiceImpl implements PetService") + .assertMethod("addPet", "Pet") + .hasReturnType("CompletionStage") + .bodyContainsLines("Pet result = null; // Replace with correct business logic.", + "return CompletableFuture.supplyAsync(() -> result);"); + } + } \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java index 2055dd67fb9..259be05eb53 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeService.java @@ -15,8 +15,6 @@ package org.openapitools.server.api; import org.openapitools.server.model.Client; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; - import java.io.InputStream; import java.util.Map; @@ -31,5 +29,5 @@ public interface AnotherFakeService { @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - abstract Response call123testSpecialTags(@Valid @NotNull Client client); + Client call123testSpecialTags(@Valid @NotNull Client client); } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultService.java index 9051caf6f98..d5c2422a841 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultService.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultService.java @@ -15,8 +15,6 @@ package org.openapitools.server.api; import org.openapitools.server.model.FooGetDefaultResponse; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; - import java.io.InputStream; import java.util.Map; @@ -30,5 +28,5 @@ public interface DefaultService { @GET @Produces({ "application/json" }) - abstract Response fooGet(); + FooGetDefaultResponse fooGet(); } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java index 76291169a5a..0a3aebe9026 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java @@ -15,8 +15,6 @@ package org.openapitools.server.api; import org.openapitools.server.model.Client; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; - import java.io.InputStream; import java.util.Map; @@ -31,5 +29,5 @@ public interface FakeClassnameTags123Service { @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - abstract Response testClassname(@Valid @NotNull Client client); + Client testClassname(@Valid @NotNull Client client); } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java index c7ab3fa2595..130451d090f 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeService.java @@ -27,8 +27,6 @@ import org.openapitools.server.model.Pet; import org.openapitools.server.model.User; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; - import java.io.InputStream; import java.util.Map; @@ -43,85 +41,85 @@ public interface FakeService { @GET @Path("/health") @Produces({ "application/json" }) - abstract Response fakeHealthGet(); + HealthCheckResult fakeHealthGet(); @GET @Path("/http-signature-test") @Consumes({ "application/json", "application/xml" }) - abstract Response fakeHttpSignatureTest(@Valid @NotNull Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1); + void fakeHttpSignatureTest(@Valid @NotNull Pet pet, @QueryParam("query_1") String query1, @HeaderParam("header_1") String header1); @POST @Path("/outer/boolean") @Consumes({ "application/json" }) @Produces({ "*/*" }) - abstract Response fakeOuterBooleanSerialize(@Valid Boolean body); + Boolean fakeOuterBooleanSerialize(@Valid Boolean body); @POST @Path("/outer/composite") @Consumes({ "application/json" }) @Produces({ "*/*" }) - abstract Response fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite); + OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite); @POST @Path("/outer/number") @Consumes({ "application/json" }) @Produces({ "*/*" }) - abstract Response fakeOuterNumberSerialize(@Valid BigDecimal body); + BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body); @POST @Path("/outer/string") @Consumes({ "application/json" }) @Produces({ "*/*" }) - abstract Response fakeOuterStringSerialize(@Valid String body); + String fakeOuterStringSerialize(@Valid String body); @POST @Path("/property/enum-int") @Consumes({ "application/json" }) @Produces({ "*/*" }) - abstract Response fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty); + OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty); @PUT @Path("/body-with-binary") @Consumes({ "image/png" }) - abstract Response testBodyWithBinary(@Valid File body); + void testBodyWithBinary(@Valid File body); @PUT @Path("/body-with-file-schema") @Consumes({ "application/json" }) - abstract Response testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass fileSchemaTestClass); + void testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass fileSchemaTestClass); @PUT @Path("/body-with-query-params") @Consumes({ "application/json" }) - abstract Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query, @Valid @NotNull User user); + void testBodyWithQueryParams(@QueryParam("query") @NotNull String query, @Valid @NotNull User user); @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - abstract Response testClientModel(@Valid @NotNull Client client); + Client testClientModel(@Valid @NotNull Client client); @POST @Consumes({ "application/x-www-form-urlencoded" }) - abstract Response testEndpointParameters(@FormParam(value = "number") BigDecimal number, @FormParam(value = "double") Double _double, @FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter, @FormParam(value = "byte") byte[] _byte, @FormParam(value = "integer") Integer integer, @FormParam(value = "int32") Integer int32, @FormParam(value = "int64") Long int64, @FormParam(value = "float") Float _float, @FormParam(value = "string") String string, @FormParam(value = "binary") InputStream binaryInputStream, @FormParam(value = "date") LocalDate date, @FormParam(value = "dateTime") OffsetDateTime dateTime, @FormParam(value = "password") String password, @FormParam(value = "callback") String paramCallback); + void testEndpointParameters(@FormParam(value = "number") BigDecimal number, @FormParam(value = "double") Double _double, @FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter, @FormParam(value = "byte") byte[] _byte, @FormParam(value = "integer") Integer integer, @FormParam(value = "int32") Integer int32, @FormParam(value = "int64") Long int64, @FormParam(value = "float") Float _float, @FormParam(value = "string") String string, @FormParam(value = "binary") InputStream binaryInputStream, @FormParam(value = "date") LocalDate date, @FormParam(value = "dateTime") OffsetDateTime dateTime, @FormParam(value = "password") String password, @FormParam(value = "callback") String paramCallback); @GET @Consumes({ "application/x-www-form-urlencoded" }) - abstract Response testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") @DefaultValue("-efg") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @QueryParam("enum_query_double") Double enumQueryDouble, @QueryParam("enum_query_model_array") List enumQueryModelArray, @FormParam(value = "enum_form_string_array") List enumFormStringArray, @FormParam(value = "enum_form_string") String enumFormString); + void testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray, @HeaderParam("enum_header_string") @DefaultValue("-efg") String enumHeaderString, @QueryParam("enum_query_string_array") List enumQueryStringArray, @QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString, @QueryParam("enum_query_integer") Integer enumQueryInteger, @QueryParam("enum_query_double") Double enumQueryDouble, @QueryParam("enum_query_model_array") List enumQueryModelArray, @FormParam(value = "enum_form_string_array") List enumFormStringArray, @FormParam(value = "enum_form_string") String enumFormString); @DELETE - abstract Response testGroupParameters(@QueryParam("required_string_group") @NotNull Integer requiredStringGroup, @HeaderParam("required_boolean_group") @NotNull Boolean requiredBooleanGroup, @QueryParam("required_int64_group") @NotNull Long requiredInt64Group, @QueryParam("string_group") Integer stringGroup, @HeaderParam("boolean_group") Boolean booleanGroup, @QueryParam("int64_group") Long int64Group); + void testGroupParameters(@QueryParam("required_string_group") @NotNull Integer requiredStringGroup, @HeaderParam("required_boolean_group") @NotNull Boolean requiredBooleanGroup, @QueryParam("required_int64_group") @NotNull Long requiredInt64Group, @QueryParam("string_group") Integer stringGroup, @HeaderParam("boolean_group") Boolean booleanGroup, @QueryParam("int64_group") Long int64Group); @POST @Path("/inline-additionalProperties") @Consumes({ "application/json" }) - abstract Response testInlineAdditionalProperties(@Valid @NotNull Map requestBody); + void testInlineAdditionalProperties(@Valid @NotNull Map requestBody); @GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - abstract Response testJsonFormData(@FormParam(value = "param") String param, @FormParam(value = "param2") String param2); + void testJsonFormData(@FormParam(value = "param") String param, @FormParam(value = "param2") String param2); @PUT @Path("/test-query-parameters") - abstract Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe, @QueryParam("ioutil") @NotNull List ioutil, @QueryParam("http") @NotNull List http, @QueryParam("url") @NotNull List url, @QueryParam("context") @NotNull List context, @QueryParam("allowEmpty") @NotNull String allowEmpty, @QueryParam("language") Map language); + void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe, @QueryParam("ioutil") @NotNull List ioutil, @QueryParam("http") @NotNull List http, @QueryParam("url") @NotNull List url, @QueryParam("context") @NotNull List context, @QueryParam("allowEmpty") @NotNull String allowEmpty, @QueryParam("language") Map language); } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetService.java index 5396af911b6..20b812611b5 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetService.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetService.java @@ -18,8 +18,6 @@ import org.openapitools.server.model.Pet; import java.util.Set; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; - import java.io.InputStream; import java.util.Map; @@ -34,46 +32,46 @@ public interface PetService { @POST @Path("/pet") @Consumes({ "application/json", "application/xml" }) - abstract Response addPet(@Valid @NotNull Pet pet); + void addPet(@Valid @NotNull Pet pet); @DELETE @Path("/pet/{petId}") - abstract Response deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); + void deletePet(@PathParam("petId") Long petId, @HeaderParam("api_key") String apiKey); @GET @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) - abstract Response findPetsByStatus(@QueryParam("status") @NotNull List status); + List findPetsByStatus(@QueryParam("status") @NotNull List status); @GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) - abstract Response findPetsByTags(@QueryParam("tags") @NotNull Set tags); + Set findPetsByTags(@QueryParam("tags") @NotNull Set tags); @GET @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) - abstract Response getPetById(@PathParam("petId") Long petId); + Pet getPetById(@PathParam("petId") Long petId); @PUT @Path("/pet") @Consumes({ "application/json", "application/xml" }) - abstract Response updatePet(@Valid @NotNull Pet pet); + void updatePet(@Valid @NotNull Pet pet); @POST @Path("/pet/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) - abstract Response updatePetWithForm(@PathParam("petId") Long petId, @FormParam(value = "name") String name, @FormParam(value = "status") String status); + void updatePetWithForm(@PathParam("petId") Long petId, @FormParam(value = "name") String name, @FormParam(value = "status") String status); @POST @Path("/pet/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - abstract Response uploadFile(@PathParam("petId") Long petId, @FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream); + ModelApiResponse uploadFile(@PathParam("petId") Long petId, @FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream); @POST @Path("/fake/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - abstract Response uploadFileWithRequiredFile(@PathParam("petId") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream, @FormParam(value = "additionalMetadata") String additionalMetadata); + ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream, @FormParam(value = "additionalMetadata") String additionalMetadata); } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreService.java index df03b4c69c0..a2bc50a77bd 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreService.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreService.java @@ -16,8 +16,6 @@ import java.util.Map; import org.openapitools.server.model.Order; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; - import java.io.InputStream; import java.util.Map; @@ -31,21 +29,21 @@ public interface StoreService { @DELETE @Path("/order/{order_id}") - abstract Response deleteOrder(@PathParam("order_id") String orderId); + void deleteOrder(@PathParam("order_id") String orderId); @GET @Path("/inventory") @Produces({ "application/json" }) - abstract Response getInventory(); + Map getInventory(); @GET @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) - abstract Response getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) Long orderId); + Order getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) Long orderId); @POST @Path("/order") @Consumes({ "application/json" }) @Produces({ "application/xml", "application/json" }) - abstract Response placeOrder(@Valid @NotNull Order order); + Order placeOrder(@Valid @NotNull Order order); } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserService.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserService.java index 3d7b81dcea8..3b907684f9a 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserService.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserService.java @@ -17,8 +17,6 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.User; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; - import java.io.InputStream; import java.util.Map; @@ -32,38 +30,38 @@ public interface UserService { @POST @Consumes({ "application/json" }) - abstract Response createUser(@Valid @NotNull User user); + void createUser(@Valid @NotNull User user); @POST @Path("/createWithArray") @Consumes({ "application/json" }) - abstract Response createUsersWithArrayInput(@Valid @NotNull List user); + void createUsersWithArrayInput(@Valid @NotNull List user); @POST @Path("/createWithList") @Consumes({ "application/json" }) - abstract Response createUsersWithListInput(@Valid @NotNull List user); + void createUsersWithListInput(@Valid @NotNull List user); @DELETE @Path("/{username}") - abstract Response deleteUser(@PathParam("username") String username); + void deleteUser(@PathParam("username") String username); @GET @Path("/{username}") @Produces({ "application/xml", "application/json" }) - abstract Response getUserByName(@PathParam("username") String username); + User getUserByName(@PathParam("username") String username); @GET @Path("/login") @Produces({ "application/xml", "application/json" }) - abstract Response loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); + String loginUser(@QueryParam("username") @NotNull String username, @QueryParam("password") @NotNull String password); @GET @Path("/logout") - abstract Response logoutUser(); + void logoutUser(); @PUT @Path("/{username}") @Consumes({ "application/json" }) - abstract Response updateUser(@PathParam("username") String username, @Valid @NotNull User user); + void updateUser(@PathParam("username") String username, @Valid @NotNull User user); } From 74bc35e33c85f040e4d874862369099fa50c6cc5 Mon Sep 17 00:00:00 2001 From: "tim.quinn@oracle.com" Date: Fri, 14 Oct 2022 06:40:00 -0500 Subject: [PATCH 15/18] Add path wildcarding Signed-off-by: tim.quinn@oracle.com --- .github/workflows/samples-jdk17.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/samples-jdk17.yaml b/.github/workflows/samples-jdk17.yaml index 153802e17f3..6d89ce09da0 100644 --- a/.github/workflows/samples-jdk17.yaml +++ b/.github/workflows/samples-jdk17.yaml @@ -4,22 +4,22 @@ on: paths: # clients - samples/openapi3/client/petstore/spring-cloud-3/** - - samples/client/petstore/java-helidon-client/mp - - samples/client/petstore/java-helidon-client/se + - samples/client/petstore/java-helidon-client/mp/** + - samples/client/petstore/java-helidon-client/se/** # servers - samples/openapi3/server/petstore/springboot-3/** - - samples/server/petstore/java-helidon-server/mp - - samples/server/petstore/java-helidon-server/se + - samples/server/petstore/java-helidon-server/mp/** + - samples/server/petstore/java-helidon-server/se/** pull_request: paths: # clients - samples/openapi3/client/petstore/spring-cloud-3/** - - samples/client/petstore/java-helidon-client/mp - - samples/client/petstore/java-helidon-client/se + - samples/client/petstore/java-helidon-client/mp/** + - samples/client/petstore/java-helidon-client/se/** # servers - samples/openapi3/server/petstore/springboot-3/** - - samples/server/petstore/java-helidon-server/mp - - samples/server/petstore/java-helidon-server/se + - samples/server/petstore/java-helidon-server/mp/** + - samples/server/petstore/java-helidon-server/se/** jobs: build: name: Build with JDK17 From 5b3a7b0cffe421e26ecd5f0db246ff96326bf65f Mon Sep 17 00:00:00 2001 From: "tim.quinn@oracle.com" Date: Fri, 14 Oct 2022 10:15:56 -0500 Subject: [PATCH 16/18] Change sample generation config to use full project option Signed-off-by: tim.quinn@oracle.com --- bin/configs/java-helidon-client-mp.yaml | 1 + bin/configs/java-helidon-client-se.yaml | 1 + bin/configs/java-helidon-server-mp.yaml | 3 ++- bin/configs/java-helidon-server-se.yaml | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/configs/java-helidon-client-mp.yaml b/bin/configs/java-helidon-client-mp.yaml index 083e776f16b..5dc5c6883c6 100644 --- a/bin/configs/java-helidon-client-mp.yaml +++ b/bin/configs/java-helidon-client-mp.yaml @@ -10,3 +10,4 @@ additionalProperties: test: "spock" requiredPropertiesInConstructor: "false" visitable: "true" + fullProject: "true" diff --git a/bin/configs/java-helidon-client-se.yaml b/bin/configs/java-helidon-client-se.yaml index fd7b9916356..bd4d7a363fd 100644 --- a/bin/configs/java-helidon-client-se.yaml +++ b/bin/configs/java-helidon-client-se.yaml @@ -10,3 +10,4 @@ additionalProperties: test: "spock" requiredPropertiesInConstructor: "false" visitable: "true" + fullProject: "true" diff --git a/bin/configs/java-helidon-server-mp.yaml b/bin/configs/java-helidon-server-mp.yaml index 86bf0c9bdd9..80a72e4f3bd 100644 --- a/bin/configs/java-helidon-server-mp.yaml +++ b/bin/configs/java-helidon-server-mp.yaml @@ -8,4 +8,5 @@ additionalProperties: hideGenerationTimestamp: "true" build: "all" test: "spock" - useAuth: "false" \ No newline at end of file + useAuth: "false" + fullProject: "true" \ No newline at end of file diff --git a/bin/configs/java-helidon-server-se.yaml b/bin/configs/java-helidon-server-se.yaml index add3f7ea764..641f131f5ed 100644 --- a/bin/configs/java-helidon-server-se.yaml +++ b/bin/configs/java-helidon-server-se.yaml @@ -5,4 +5,5 @@ inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-e templateDir: modules/openapi-generator/src/main/resources/java-helidon/server additionalProperties: artifactId: petstore-helidon-server-se - hideGenerationTimestamp: "true" \ No newline at end of file + hideGenerationTimestamp: "true" + fullProject: "true" \ No newline at end of file From 715bbfab56b082acba5d6b8b2603e5f3a02d2f97 Mon Sep 17 00:00:00 2001 From: "tim.quinn@oracle.com" Date: Fri, 14 Oct 2022 10:16:27 -0500 Subject: [PATCH 17/18] Push up-to-date generated samples Signed-off-by: tim.quinn@oracle.com --- .../mp/.openapi-generator/FILES | 2 + .../se/.openapi-generator/FILES | 2 + .../mp/.openapi-generator/FILES | 11 ++++ .../server/api/AnotherFakeServiceImpl.java | 6 +- .../server/api/DefaultServiceImpl.java | 6 +- .../api/FakeClassnameTags123ServiceImpl.java | 6 +- .../server/api/FakeServiceImpl.java | 66 +++++++++---------- .../server/api/PetServiceImpl.java | 38 +++++------ .../server/api/StoreServiceImpl.java | 19 +++--- .../server/api/UserServiceImpl.java | 29 ++++---- .../se/.openapi-generator/FILES | 14 ++++ 11 files changed, 110 insertions(+), 89 deletions(-) diff --git a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES index 0e0a040ebbd..1b046cca4ab 100644 --- a/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES +++ b/samples/client/petstore/java-helidon-client/mp/.openapi-generator/FILES @@ -1,3 +1,4 @@ +README.md docs/AdditionalPropertiesClass.md docs/AllOfWithSingleRef.md docs/Animal.md @@ -53,6 +54,7 @@ docs/StoreApi.md docs/Tag.md docs/User.md docs/UserApi.md +pom.xml src/main/java/org/openapitools/client/JavaTimeFormatter.java src/main/java/org/openapitools/client/RFC3339DateFormat.java src/main/java/org/openapitools/client/api/AnotherFakeApi.java diff --git a/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES index f7bde3116a0..16af74d61d2 100644 --- a/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES +++ b/samples/client/petstore/java-helidon-client/se/.openapi-generator/FILES @@ -1,3 +1,4 @@ +README.md docs/AdditionalPropertiesClass.md docs/AllOfWithSingleRef.md docs/Animal.md @@ -53,6 +54,7 @@ docs/StoreApi.md docs/Tag.md docs/User.md docs/UserApi.md +pom.xml src/main/java/org/openapitools/client/ApiClient.java src/main/java/org/openapitools/client/ApiResponse.java src/main/java/org/openapitools/client/ApiResponseBase.java diff --git a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES index 3fca3cdbaaa..9fdbc1aebe2 100644 --- a/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES +++ b/samples/server/petstore/java-helidon-server/mp/.openapi-generator/FILES @@ -1,13 +1,22 @@ +README.md +pom.xml src/main/java/org/openapitools/server/JavaTimeFormatter.java src/main/java/org/openapitools/server/RFC3339DateFormat.java src/main/java/org/openapitools/server/RestApplication.java src/main/java/org/openapitools/server/api/AnotherFakeService.java +src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java src/main/java/org/openapitools/server/api/DefaultService.java +src/main/java/org/openapitools/server/api/DefaultServiceImpl.java src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java +src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java src/main/java/org/openapitools/server/api/FakeService.java +src/main/java/org/openapitools/server/api/FakeServiceImpl.java src/main/java/org/openapitools/server/api/PetService.java +src/main/java/org/openapitools/server/api/PetServiceImpl.java src/main/java/org/openapitools/server/api/StoreService.java +src/main/java/org/openapitools/server/api/StoreServiceImpl.java src/main/java/org/openapitools/server/api/UserService.java +src/main/java/org/openapitools/server/api/UserServiceImpl.java src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java src/main/java/org/openapitools/server/model/Animal.java @@ -56,6 +65,8 @@ src/main/java/org/openapitools/server/model/SingleRefType.java src/main/java/org/openapitools/server/model/SpecialModelName.java src/main/java/org/openapitools/server/model/Tag.java src/main/java/org/openapitools/server/model/User.java +src/main/java/org/openapitools/server/package-info.java src/main/resources/META-INF/beans.xml src/main/resources/META-INF/microprofile-config.properties src/main/resources/META-INF/openapi.yml +src/main/resources/logging.properties diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java index a1d4f78cf05..dba792a7926 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java @@ -15,7 +15,6 @@ package org.openapitools.server.api; import org.openapitools.server.model.Client; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; import java.io.InputStream; @@ -31,7 +30,8 @@ public class AnotherFakeServiceImpl implements AnotherFakeService { @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - public Response call123testSpecialTags(@Valid @NotNull Client client) { - return Response.ok().entity("magic!").build(); + public Client call123testSpecialTags(@Valid @NotNull Client client) { + Client result = null; // Replace with correct business logic. + return result; } } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java index c5a10220e98..c17391e7360 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java @@ -15,7 +15,6 @@ package org.openapitools.server.api; import org.openapitools.server.model.FooGetDefaultResponse; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; import java.io.InputStream; @@ -30,7 +29,8 @@ public class DefaultServiceImpl implements DefaultService { @GET @Produces({ "application/json" }) - public Response fooGet() { - return Response.ok().entity("magic!").build(); + public FooGetDefaultResponse fooGet() { + FooGetDefaultResponse result = null; // Replace with correct business logic. + return result; } } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java index 009ad116aa1..0853801d4fb 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java @@ -15,7 +15,6 @@ package org.openapitools.server.api; import org.openapitools.server.model.Client; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; import java.io.InputStream; @@ -31,7 +30,8 @@ public class FakeClassnameTags123ServiceImpl implements FakeClassnameTags123Serv @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - public Response testClassname(@Valid @NotNull Client client) { - return Response.ok().entity("magic!").build(); + public Client testClassname(@Valid @NotNull Client client) { + Client result = null; // Replace with correct business logic. + return result; } } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java index 7221b67530f..d0e402393b1 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -27,7 +27,6 @@ import org.openapitools.server.model.Pet; import org.openapitools.server.model.User; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; import java.io.InputStream; @@ -43,119 +42,116 @@ public class FakeServiceImpl implements FakeService { @GET @Path("/health") @Produces({ "application/json" }) - public Response fakeHealthGet() { - return Response.ok().entity("magic!").build(); + public HealthCheckResult fakeHealthGet() { + HealthCheckResult result = null; // Replace with correct business logic. + return result; } @GET @Path("/http-signature-test") @Consumes({ "application/json", "application/xml" }) - public Response fakeHttpSignatureTest(@Valid @NotNull Pet pet,@QueryParam("query_1") String query1,@HeaderParam("header_1") String header1) { - return Response.ok().entity("magic!").build(); + public void fakeHttpSignatureTest(@Valid @NotNull Pet pet,@QueryParam("query_1") String query1,@HeaderParam("header_1") String header1) { } @POST @Path("/outer/boolean") @Consumes({ "application/json" }) @Produces({ "*/*" }) - public Response fakeOuterBooleanSerialize(@Valid Boolean body) { - return Response.ok().entity("magic!").build(); + public Boolean fakeOuterBooleanSerialize(@Valid Boolean body) { + Boolean result = new Boolean(false); // Replace with correct business logic. + return result; } @POST @Path("/outer/composite") @Consumes({ "application/json" }) @Produces({ "*/*" }) - public Response fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite) { - return Response.ok().entity("magic!").build(); + public OuterComposite fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite) { + OuterComposite result = null; // Replace with correct business logic. + return result; } @POST @Path("/outer/number") @Consumes({ "application/json" }) @Produces({ "*/*" }) - public Response fakeOuterNumberSerialize(@Valid BigDecimal body) { - return Response.ok().entity("magic!").build(); + public BigDecimal fakeOuterNumberSerialize(@Valid BigDecimal body) { + BigDecimal result = null; // Replace with correct business logic. + return result; } @POST @Path("/outer/string") @Consumes({ "application/json" }) @Produces({ "*/*" }) - public Response fakeOuterStringSerialize(@Valid String body) { - return Response.ok().entity("magic!").build(); + public String fakeOuterStringSerialize(@Valid String body) { + String result = ""; // Replace with correct business logic. + return result; } @POST @Path("/property/enum-int") @Consumes({ "application/json" }) @Produces({ "*/*" }) - public Response fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty) { - return Response.ok().entity("magic!").build(); + public OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + OuterObjectWithEnumProperty result = null; // Replace with correct business logic. + return result; } @PUT @Path("/body-with-binary") @Consumes({ "image/png" }) - public Response testBodyWithBinary(@Valid File body) { - return Response.ok().entity("magic!").build(); + public void testBodyWithBinary(@Valid File body) { } @PUT @Path("/body-with-file-schema") @Consumes({ "application/json" }) - public Response testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass fileSchemaTestClass) { - return Response.ok().entity("magic!").build(); + public void testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass fileSchemaTestClass) { } @PUT @Path("/body-with-query-params") @Consumes({ "application/json" }) - public Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User user) { - return Response.ok().entity("magic!").build(); + public void testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User user) { } @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - public Response testClientModel(@Valid @NotNull Client client) { - return Response.ok().entity("magic!").build(); + public Client testClientModel(@Valid @NotNull Client client) { + Client result = null; // Replace with correct business logic. + return result; } @POST @Consumes({ "application/x-www-form-urlencoded" }) - public Response testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string, @FormParam(value = "binary") InputStream binaryInputStream,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") OffsetDateTime dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) { - return Response.ok().entity("magic!").build(); + public void testEndpointParameters(@FormParam(value = "number") BigDecimal number,@FormParam(value = "double") Double _double,@FormParam(value = "pattern_without_delimiter") String patternWithoutDelimiter,@FormParam(value = "byte") byte[] _byte,@FormParam(value = "integer") Integer integer,@FormParam(value = "int32") Integer int32,@FormParam(value = "int64") Long int64,@FormParam(value = "float") Float _float,@FormParam(value = "string") String string, @FormParam(value = "binary") InputStream binaryInputStream,@FormParam(value = "date") LocalDate date,@FormParam(value = "dateTime") OffsetDateTime dateTime,@FormParam(value = "password") String password,@FormParam(value = "callback") String paramCallback) { } @GET @Consumes({ "application/x-www-form-urlencoded" }) - public Response testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") String enumHeaderString,@QueryParam("enum_query_string_array") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString,@QueryParam("enum_query_integer") Integer enumQueryInteger,@QueryParam("enum_query_double") Double enumQueryDouble,@QueryParam("enum_query_model_array") List enumQueryModelArray,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { - return Response.ok().entity("magic!").build(); + public void testEnumParameters(@HeaderParam("enum_header_string_array") List enumHeaderStringArray,@HeaderParam("enum_header_string") @DefaultValue("-efg") String enumHeaderString,@QueryParam("enum_query_string_array") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") String enumQueryString,@QueryParam("enum_query_integer") Integer enumQueryInteger,@QueryParam("enum_query_double") Double enumQueryDouble,@QueryParam("enum_query_model_array") List enumQueryModelArray,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { } @DELETE - public Response testGroupParameters(@QueryParam("required_string_group") @NotNull Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull Long requiredInt64Group,@QueryParam("string_group") Integer stringGroup,@HeaderParam("boolean_group") Boolean booleanGroup,@QueryParam("int64_group") Long int64Group) { - return Response.ok().entity("magic!").build(); + public void testGroupParameters(@QueryParam("required_string_group") @NotNull Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull Long requiredInt64Group,@QueryParam("string_group") Integer stringGroup,@HeaderParam("boolean_group") Boolean booleanGroup,@QueryParam("int64_group") Long int64Group) { } @POST @Path("/inline-additionalProperties") @Consumes({ "application/json" }) - public Response testInlineAdditionalProperties(@Valid @NotNull Map requestBody) { - return Response.ok().entity("magic!").build(); + public void testInlineAdditionalProperties(@Valid @NotNull Map requestBody) { } @GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - public Response testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) { - return Response.ok().entity("magic!").build(); + public void testJsonFormData(@FormParam(value = "param") String param,@FormParam(value = "param2") String param2) { } @PUT @Path("/test-query-parameters") - public Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context,@QueryParam("allowEmpty") @NotNull String allowEmpty,@QueryParam("language") Map language) { - return Response.ok().entity("magic!").build(); + public void testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context,@QueryParam("allowEmpty") @NotNull String allowEmpty,@QueryParam("language") Map language) { } } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java index de0e280df07..6f6a14e5ec8 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java @@ -18,7 +18,6 @@ import org.openapitools.server.model.Pet; import java.util.Set; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; import java.io.InputStream; @@ -34,64 +33,65 @@ public class PetServiceImpl implements PetService { @POST @Path("/pet") @Consumes({ "application/json", "application/xml" }) - public Response addPet(@Valid @NotNull Pet pet) { - return Response.ok().entity("magic!").build(); + public void addPet(@Valid @NotNull Pet pet) { } @DELETE @Path("/pet/{petId}") - public Response deletePet(@PathParam("petId") Long petId,@HeaderParam("api_key") String apiKey) { - return Response.ok().entity("magic!").build(); + public void deletePet(@PathParam("petId") Long petId,@HeaderParam("api_key") String apiKey) { } @GET @Path("/pet/findByStatus") @Produces({ "application/xml", "application/json" }) - public Response findPetsByStatus(@QueryParam("status") @NotNull List status) { - return Response.ok().entity("magic!").build(); + public List findPetsByStatus(@QueryParam("status") @NotNull List status) { + List result = java.util.Collections.emptyList(); // Replace with correct business logic. + return result; } @GET @Path("/pet/findByTags") @Produces({ "application/xml", "application/json" }) - public Response findPetsByTags(@QueryParam("tags") @NotNull Set tags) { - return Response.ok().entity("magic!").build(); + public Set findPetsByTags(@QueryParam("tags") @NotNull Set tags) { + Set result = java.util.Collections.emptySet(); // Replace with correct business logic. + return result; } @GET @Path("/pet/{petId}") @Produces({ "application/xml", "application/json" }) - public Response getPetById(@PathParam("petId") Long petId) { - return Response.ok().entity("magic!").build(); + public Pet getPetById(@PathParam("petId") Long petId) { + Pet result = null; // Replace with correct business logic. + return result; } @PUT @Path("/pet") @Consumes({ "application/json", "application/xml" }) - public Response updatePet(@Valid @NotNull Pet pet) { - return Response.ok().entity("magic!").build(); + public void updatePet(@Valid @NotNull Pet pet) { } @POST @Path("/pet/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) - public Response updatePetWithForm(@PathParam("petId") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) { - return Response.ok().entity("magic!").build(); + public void updatePetWithForm(@PathParam("petId") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) { } @POST @Path("/pet/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - public Response uploadFile(@PathParam("petId") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream) { - return Response.ok().entity("magic!").build(); + public ModelApiResponse uploadFile(@PathParam("petId") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream) { + ModelApiResponse result = null; // Replace with correct business logic. + return result; } @POST @Path("/fake/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - public Response uploadFileWithRequiredFile(@PathParam("petId") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream,@FormParam(value = "additionalMetadata") String additionalMetadata) { - return Response.ok().entity("magic!").build(); + public ModelApiResponse uploadFileWithRequiredFile(@PathParam("petId") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream,@FormParam(value = "additionalMetadata") String additionalMetadata) { + ModelApiResponse result = null; // Replace with correct business logic. + return result; } } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java index 07e9170b326..f7e722d5f99 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/StoreServiceImpl.java @@ -16,7 +16,6 @@ import java.util.Map; import org.openapitools.server.model.Order; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; import java.io.InputStream; @@ -31,29 +30,31 @@ public class StoreServiceImpl implements StoreService { @DELETE @Path("/order/{order_id}") - public Response deleteOrder(@PathParam("order_id") String orderId) { - return Response.ok().entity("magic!").build(); + public void deleteOrder(@PathParam("order_id") String orderId) { } @GET @Path("/inventory") @Produces({ "application/json" }) - public Response getInventory() { - return Response.ok().entity("magic!").build(); + public Map getInventory() { + Map result = java.util.Collections.emptyMap(); // Replace with correct business logic. + return result; } @GET @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) - public Response getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) Long orderId) { - return Response.ok().entity("magic!").build(); + public Order getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) Long orderId) { + Order result = null; // Replace with correct business logic. + return result; } @POST @Path("/order") @Consumes({ "application/json" }) @Produces({ "application/xml", "application/json" }) - public Response placeOrder(@Valid @NotNull Order order) { - return Response.ok().entity("magic!").build(); + public Order placeOrder(@Valid @NotNull Order order) { + Order result = null; // Replace with correct business logic. + return result; } } diff --git a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java index 1f07a1199ac..b5189292c8d 100644 --- a/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java @@ -17,7 +17,6 @@ import java.time.OffsetDateTime; import org.openapitools.server.model.User; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Response; import java.io.InputStream; @@ -32,54 +31,50 @@ public class UserServiceImpl implements UserService { @POST @Consumes({ "application/json" }) - public Response createUser(@Valid @NotNull User user) { - return Response.ok().entity("magic!").build(); + public void createUser(@Valid @NotNull User user) { } @POST @Path("/createWithArray") @Consumes({ "application/json" }) - public Response createUsersWithArrayInput(@Valid @NotNull List user) { - return Response.ok().entity("magic!").build(); + public void createUsersWithArrayInput(@Valid @NotNull List user) { } @POST @Path("/createWithList") @Consumes({ "application/json" }) - public Response createUsersWithListInput(@Valid @NotNull List user) { - return Response.ok().entity("magic!").build(); + public void createUsersWithListInput(@Valid @NotNull List user) { } @DELETE @Path("/{username}") - public Response deleteUser(@PathParam("username") String username) { - return Response.ok().entity("magic!").build(); + public void deleteUser(@PathParam("username") String username) { } @GET @Path("/{username}") @Produces({ "application/xml", "application/json" }) - public Response getUserByName(@PathParam("username") String username) { - return Response.ok().entity("magic!").build(); + public User getUserByName(@PathParam("username") String username) { + User result = null; // Replace with correct business logic. + return result; } @GET @Path("/login") @Produces({ "application/xml", "application/json" }) - public Response loginUser(@QueryParam("username") @NotNull String username,@QueryParam("password") @NotNull String password) { - return Response.ok().entity("magic!").build(); + public String loginUser(@QueryParam("username") @NotNull String username,@QueryParam("password") @NotNull String password) { + String result = ""; // Replace with correct business logic. + return result; } @GET @Path("/logout") - public Response logoutUser() { - return Response.ok().entity("magic!").build(); + public void logoutUser() { } @PUT @Path("/{username}") @Consumes({ "application/json" }) - public Response updateUser(@PathParam("username") String username,@Valid @NotNull User user) { - return Response.ok().entity("magic!").build(); + public void updateUser(@PathParam("username") String username,@Valid @NotNull User user) { } } diff --git a/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES index 41a6ebc821e..93bbc6b3b01 100644 --- a/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES +++ b/samples/server/petstore/java-helidon-server/se/.openapi-generator/FILES @@ -1,12 +1,22 @@ +README.md +pom.xml +src/main/java/org/openapitools/server/Main.java src/main/java/org/openapitools/server/RFC3339DateFormat.java src/main/java/org/openapitools/server/api/AnotherFakeService.java +src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java src/main/java/org/openapitools/server/api/DefaultService.java +src/main/java/org/openapitools/server/api/DefaultServiceImpl.java src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java +src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java src/main/java/org/openapitools/server/api/FakeService.java +src/main/java/org/openapitools/server/api/FakeServiceImpl.java src/main/java/org/openapitools/server/api/JsonProvider.java src/main/java/org/openapitools/server/api/PetService.java +src/main/java/org/openapitools/server/api/PetServiceImpl.java src/main/java/org/openapitools/server/api/StoreService.java +src/main/java/org/openapitools/server/api/StoreServiceImpl.java src/main/java/org/openapitools/server/api/UserService.java +src/main/java/org/openapitools/server/api/UserServiceImpl.java src/main/java/org/openapitools/server/api/ValidatorUtils.java src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java @@ -56,4 +66,8 @@ src/main/java/org/openapitools/server/model/SingleRefType.java src/main/java/org/openapitools/server/model/SpecialModelName.java src/main/java/org/openapitools/server/model/Tag.java src/main/java/org/openapitools/server/model/User.java +src/main/java/org/openapitools/server/package-info.java src/main/resources/META-INF/openapi.yml +src/main/resources/application.yaml +src/main/resources/logging.properties +src/test/java/org/openapitools/server/MainTest.java From cec28261e1173adca3b6d6b008cefb0aeddf772a Mon Sep 17 00:00:00 2001 From: "tim.quinn@oracle.com" Date: Fri, 14 Oct 2022 10:16:51 -0500 Subject: [PATCH 18/18] Fix error in example return value for certain containers Signed-off-by: tim.quinn@oracle.com --- .../languages/JavaHelidonCommonCodegen.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java index 50519b08370..ac87b1006be 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaHelidonCommonCodegen.java @@ -19,8 +19,10 @@ package org.openapitools.codegen.languages; import java.nio.file.Paths; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.Set; import java.util.stream.Collectors; @@ -64,6 +66,14 @@ public abstract class JavaHelidonCommonCodegen extends AbstractJavaCodegen private static final String VALIDATION_ARTIFACT_PREFIX_JAVAX = ""; private static final String VALIDATION_ARTIFACT_PREFIX_JAKARTA = MICROPROFILE_ROOT_PACKAGE_JAKARTA + "."; + private static final Map EXAMPLE_RETURN_VALUES = new HashMap() { + { + put("set", "Set"); + put("array", "List"); + put("map", "Map"); + } + }; + // for generated doc static final String MICROPROFILE_ROOT_PACKAGE_DEFAULT = "Helidon 2.x and earlier: " + MICROPROFILE_ROOT_PACKAGE_JAVAX @@ -273,15 +283,13 @@ public abstract class JavaHelidonCommonCodegen extends AbstractJavaCodegen private String chooseExampleReturnTypeValue(CodegenOperation op) { + // See DefaultCodegen#handleMethodResponse to see how the various op fields related to the return type are set. if (op.returnType == null) { return ""; // won't be used anyway in the templates } - if (op.isMap) { - return "java.util.Collections.emptyMap()"; - } - if (op.isArray) { - return "java.util.Collections.emptyList()"; + if (op.returnContainer != null) { + return "java.util.Collections.empty" + EXAMPLE_RETURN_VALUES.get(op.returnContainer) + "()"; } switch (op.returnType) { case "Integer":