diff --git a/.github/workflows/samples-java-helidon-v4.yaml b/.github/workflows/samples-java-helidon-v4.yaml index b13977d4691e..2922c81247da 100644 --- a/.github/workflows/samples-java-helidon-v4.yaml +++ b/.github/workflows/samples-java-helidon-v4.yaml @@ -18,7 +18,10 @@ jobs: matrix: sample: - samples/client/petstore/java-helidon-client/v4/mp + - samples/client/petstore/java-helidon-client/v4/se - samples/server/petstore/java-helidon-server/v4/mp + - samples/server/petstore/java-helidon-server/v4/se + - samples/server/petstore/java-helidon-server/v4/se-uac version: [21] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/samples-jdk21.yaml b/.github/workflows/samples-jdk21.yaml index 9910b86a0eb5..bef7496da8c9 100644 --- a/.github/workflows/samples-jdk21.yaml +++ b/.github/workflows/samples-jdk21.yaml @@ -4,14 +4,18 @@ on: paths: # clients - samples/client/petstore/java-helidon-client/v4/mp/** + - samples/client/petstore/java-helidon-client/v4/se/** # servers - samples/server/petstore/java-helidon-server/v4/mp/** + - samples/server/petstore/java-helidon-server/v4/se/** pull_request: paths: # clients - samples/client/petstore/java-helidon-client/v4/mp/** + - samples/client/petstore/java-helidon-client/v4/se/** # servers - samples/server/petstore/java-helidon-server/v4/mp/** + - samples/server/petstore/java-helidon-server/v4/se/** jobs: build: name: Build with JDK21 @@ -22,8 +26,10 @@ jobs: sample: # clients - samples/client/petstore/java-helidon-client/v4/mp/ + - samples/client/petstore/java-helidon-client/v4/se/ # servers - samples/server/petstore/java-helidon-server/v4/mp/ + - samples/server/petstore/java-helidon-server/v4/se/ steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 diff --git a/bin/configs/java-helidon-client-mp_4.yaml b/bin/configs/java-helidon-client-mp_4.yaml index 188afa0e86b5..9d25d15f8230 100644 --- a/bin/configs/java-helidon-client-mp_4.yaml +++ b/bin/configs/java-helidon-client-mp_4.yaml @@ -3,7 +3,7 @@ library: mp outputDir: samples/client/petstore/java-helidon-client/v4/mp inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml additionalProperties: - helidonVersion: 4.0.8 + helidonVersion: 4.0.11 artifactId: petstore-helidon-client-mp hideGenerationTimestamp: "true" configureAuth: "false" diff --git a/bin/configs/java-helidon-client-se_4.yaml b/bin/configs/java-helidon-client-se_4.yaml new file mode 100644 index 000000000000..748b7db894f8 --- /dev/null +++ b/bin/configs/java-helidon-client-se_4.yaml @@ -0,0 +1,14 @@ +generatorName: java-helidon-client +library: se +outputDir: samples/client/petstore/java-helidon-client/v4/se +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +additionalProperties: + helidonVersion: 4.0.11 + artifactId: petstore-helidon-client-se + hideGenerationTimestamp: "true" + configureAuth: "false" + build: "all" + test: "spock" + requiredPropertiesInConstructor: "false" + visitable: "true" + fullProject: "true" diff --git a/bin/configs/java-helidon-server-mp_4.yaml b/bin/configs/java-helidon-server-mp_4.yaml index 40de63bc808f..fbed7514c65c 100644 --- a/bin/configs/java-helidon-server-mp_4.yaml +++ b/bin/configs/java-helidon-server-mp_4.yaml @@ -4,7 +4,7 @@ outputDir: samples/server/petstore/java-helidon-server/v4/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: - helidonVersion: 4.0.8 + helidonVersion: 4.0.11 artifactId: petstore-helidon-server-mp hideGenerationTimestamp: "true" build: "all" diff --git a/bin/configs/java-helidon-server-se_4-uac-group-by-file-path.yaml b/bin/configs/java-helidon-server-se_4-uac-group-by-file-path.yaml new file mode 100644 index 000000000000..db0dc77cefa1 --- /dev/null +++ b/bin/configs/java-helidon-server-se_4-uac-group-by-file-path.yaml @@ -0,0 +1,13 @@ +generatorName: java-helidon-server +library: se +outputDir: samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path +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: + helidonVersion: 4.0.11 + artifactId: petstore-helidon-server-se + hideGenerationTimestamp: "true" + fullProject: "true" + useAbstractClass: "true" + generatorVersion: "stable" + x-helidon-groupBy: first-path-segment diff --git a/bin/configs/java-helidon-server-se_4-uac.yaml b/bin/configs/java-helidon-server-se_4-uac.yaml new file mode 100644 index 000000000000..273d48c350d9 --- /dev/null +++ b/bin/configs/java-helidon-server-se_4-uac.yaml @@ -0,0 +1,12 @@ +generatorName: java-helidon-server +library: se +outputDir: samples/server/petstore/java-helidon-server/v4/se-uac +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: + helidonVersion: 4.0.11 + artifactId: petstore-helidon-server-se + hideGenerationTimestamp: "true" + fullProject: "true" + useAbstractClass: "true" + generatorVersion: "stable" diff --git a/bin/configs/java-helidon-server-se_4.yaml b/bin/configs/java-helidon-server-se_4.yaml new file mode 100644 index 000000000000..717faad7a235 --- /dev/null +++ b/bin/configs/java-helidon-server-se_4.yaml @@ -0,0 +1,12 @@ +generatorName: java-helidon-server +library: se +outputDir: samples/server/petstore/java-helidon-server/v4/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: + helidonVersion: 4.0.11 + artifactId: petstore-helidon-server-se + hideGenerationTimestamp: "true" + fullProject: "true" + x-helidon-useOptional: "true" + generatorVersion: "stable" diff --git a/docs/generators/java-helidon-client.md b/docs/generators/java-helidon-client.md index a274c0e0307f..c9c1e4064469 100644 --- a/docs/generators/java-helidon-client.md +++ b/docs/generators/java-helidon-client.md @@ -65,6 +65,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false| |useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |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| +|x-helidon-groupBy|Selects how to group operations into APIs|
**tags**
Use the 'tags' settings on each operation
**first-path-segment**
Use the first segment of the path
|tags| +|x-helidon-useOptional|Wrap optional parameters in an Optional (Helidon 4 and later)| |true| ## SUPPORTED VENDOR EXTENSIONS diff --git a/docs/generators/java-helidon-server.md b/docs/generators/java-helidon-server.md index a34d62118c13..5ca963a6686e 100644 --- a/docs/generators/java-helidon-server.md +++ b/docs/generators/java-helidon-server.md @@ -68,6 +68,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useJakartaEe|whether to use Jakarta EE namespace instead of javax| |false| |useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface| |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| +|x-helidon-groupBy|Selects how to group operations into APIs|
**tags**
Use the 'tags' settings on each operation
**first-path-segment**
Use the first segment of the path
|tags| +|x-helidon-useOptional|Wrap optional parameters in an Optional (Helidon 4 and later)| |true| ## SUPPORTED VENDOR EXTENSIONS 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 980f2051ade1..2762202eb8de 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 @@ -65,6 +65,7 @@ public class JavaHelidonClientCodegen extends JavaHelidonCommonCodegen { private static final String X_HELIDON_REQUIRED_IMPL_IMPORTS = "x-helidon-requiredImplImports"; private static final String X_HELIDON_IMPL_IMPORTS = "x-helidon-implImports"; + private static final String X_CLIENT_STYLE_V3 = "x-helidon-client-style-v3"; public static final String CONFIG_KEY = "configKey"; @Setter protected String configKey = null; @@ -173,6 +174,8 @@ public String apiFilename(String templateName, String tag) { public void processOpts() { super.processOpts(); + // Not intended for users to set; we compute this based on the major version. + additionalProperties.put(X_CLIENT_STYLE_V3, helidonMajorVersion == 3); convertPropertyToStringAndWriteBack(SERIALIZATION_LIBRARY, this::setSerializationLibrary); convertPropertyToStringAndWriteBack(CONFIG_KEY, this::setConfigKey); @@ -199,7 +202,12 @@ public void processOpts() { } else if (isLibrary(HELIDON_SE)) { apiTemplateFiles.put("api_impl.mustache", ".java"); importMapping.put("StringJoiner", "java.util.StringJoiner"); - importMapping.put("WebClientRequestHeaders", "io.helidon.webclient.WebClientRequestHeaders"); + if (helidonMajorVersion == 3) { + importMapping.put("WebClientRequestHeaders", "io.helidon.webclient.WebClientRequestHeaders"); + } else { + importMapping.put("ClientRequestHeaders", "io.helidon.http.ClientRequestHeaders"); + importMapping.put("HeaderNames", "io.helidon.http.HeaderNames"); + } importMapping.put("Pair", invokerPackage + ".Pair"); @@ -309,7 +317,10 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation requiredImplImports.add("Pair"); } if (op.getHasHeaderParams()) { - requiredImplImports.add("WebClientRequestHeaders"); + requiredImplImports.add(helidonMajorVersion == 3 ? "WebClientRequestHeaders" : "ClientRequestHeaders"); + if (helidonMajorVersion > 3) { + requiredImplImports.add("HeaderNames"); + } } if (op.getHasFormParams()) { requiredImplImports.add("StringJoiner"); 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 d6c261246bbe..c0b5105a8d6e 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,11 +19,13 @@ import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.net.URI; import java.net.URL; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.time.Duration; @@ -33,7 +35,9 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Scanner; import java.util.Set; +import java.util.TreeMap; import java.util.concurrent.locks.ReentrantLock; import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; @@ -42,7 +46,11 @@ import java.util.stream.Collectors; import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.servers.Server; +import lombok.Getter; +import org.apache.commons.lang3.StringUtils; import org.eclipse.aether.util.version.GenericVersionScheme; import org.eclipse.aether.version.InvalidVersionSpecificationException; import org.eclipse.aether.version.Version; @@ -51,9 +59,17 @@ import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.CodegenResponse; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.languages.features.BeanValidationFeatures; import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures; +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.CodegenConstants.DEVELOPER_EMAIL; import static org.openapitools.codegen.CodegenConstants.DEVELOPER_NAME; @@ -76,15 +92,31 @@ public abstract class JavaHelidonCommonCodegen extends AbstractJavaCodegen static final String MICROPROFILE_ROOT_DEP_PREFIX = "x-helidon-rootJavaEEDepPrefix"; static final String X_USE_MP_TESTING = "x-helidon-useMpTesting"; static final String X_USE_SMALLRYE_JANDEX_PLUGIN = "x-helidon-useSmallRyeJandexPlugin"; + static final String X_HAS_RESPONSE_PROPS = "x-helidon-hasResponseProps"; + static final String X_ALL_RESPONSE_PROPS = "x-helidon-allResponseProps"; + static final String X_OPTIONAL_RESPONSE_PROPS = "x-helidon-optionalResponseProps"; + static final String X_REQUIRED_RESPONSE_PROPS = "x-helidon-requiredResponseProps"; + static final String X_HAS_REQUIRED_RESPONSE_PROPS = "x-helidon-hasRequiredResponseProps"; + static final String X_RESULT_BUILDER_NEEDS_CTOR = "x-helidon-resultBuilderNeedsCtor"; + static final String X_IS_MULTIPART_FORM_PARAM = "x-helidon-isMultipartFormParam"; static final String X_HAS_RETURN_TYPE = "x-helidon-hasReturnType"; static final String X_RETURN_TYPE_EXAMPLE_VALUE = "x-helidon-exampleReturnTypeValue"; + static final String X_MEDIA_SUPPORT_PACKAGE_PREFIX = "x-helidon-media-support-package-prefix"; + static final String X_MEDIA_COMMON_MEDIA_TYPE_PACKAGE_PREFIX = "x-helidon-common-media-type-package-prefix"; + static final String X_USE_REACTIVE = "x-helidon-use-reactive"; + static final String X_USE_OPTIONAL = "x-helidon-use-optional"; 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"; + static final String HELIDON_ENUM_CLASS = "x-helidon-hasEnumClass"; private static final String VALIDATION_ARTIFACT_PREFIX_KEY = "x-helidon-validationArtifactPrefix"; + private static final String X_PATH_SUFFIX = "x-helidon-pathSuffix"; + private static final String X_FIXUP_PATH = "x-helidon-fixupPath"; 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(); + private final Logger LOGGER = LoggerFactory.getLogger(JavaHelidonCommonCodegen.class); + // for generated doc static final String MICROPROFILE_ROOT_PACKAGE_DEFAULT = "Helidon 2.x and earlier: " + MICROPROFILE_ROOT_PACKAGE_JAVAX @@ -93,20 +125,33 @@ public abstract class JavaHelidonCommonCodegen extends AbstractJavaCodegen static final String SERIALIZATION_LIBRARY_JACKSON = "jackson"; static final String SERIALIZATION_LIBRARY_JSONB = "jsonb"; - public static final String DEFAULT_HELIDON_VERSION = "3.0.1"; public static final String HELIDON_VERSION = "helidonVersion"; + + // Helidon 3 featured reactive style; more recent releases feature synchronous. + static final String V3_STYLE = "x-helidon-v3"; + static final String HELIDON_VERSION_DESC = "Helidon complete version identifier or major version number. " + "The specified exact Helidon release or, if specified as a major version the latest release of that major version, " + " is used in the generated code."; + static final String X_HELIDON_USE_OPTIONAL = "x-helidon-useOptional"; + static final String X_HELIDON_USE_OPTIONAL_DESC = "Wrap optional parameters in an Optional (Helidon 4 and later)"; + 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 int helidonMajorVersion; + static final String HELIDON_GROUP_BY = "x-helidon-groupBy"; + static final String HELIDON_GROUP_BY_DESC = "Selects how to group operations into APIs"; + + protected String helidonVersion; + protected int helidonMajorVersion; + protected boolean useReactive; + protected boolean useOptional = true; // effective with Helidon 4 + protected final GenericTypeDeclarations genericTypeDeclarations = new GenericTypeDeclarations(); + protected Map> tagToOperations; private String rootJavaEEPackage; private String rootJavaEEDepPrefix; @@ -114,6 +159,33 @@ public abstract class JavaHelidonCommonCodegen extends AbstractJavaCodegen private String mpTestsArtifact; private String jandexGroup; private String jandexArtifact; + private final Map knownHttpStatusMap; + protected GroupBy groupBy = GroupBy.DEFAULT; + + protected enum GroupBy { + TAGS("tags", "Use the 'tags' settings on each operation"), + FIRST_PATH_SEGMENT("first-path-segment", "Use the first segment of the path"); + + static GroupBy DEFAULT = TAGS; + + static final Map OPTION_VALUES = Arrays.stream(values()) + .collect(HashMap::new, (map, value) -> map.put(value.groupingName, value.desc), Map::putAll); + + static GroupBy from(String value) { + return Arrays.stream(values()) + .filter(candidate -> candidate.groupingName.equals(value)) + .findFirst() + .orElseThrow(); + } + + private final String groupingName; + private final String desc; + + GroupBy(String groupingName, String desc) { + this.groupingName = groupingName; + this.desc = desc; + } + } public static String defaultHelidonVersion() { return VersionUtil.instance().defaultVersion(); @@ -136,12 +208,21 @@ public JavaHelidonCommonCodegen() { .defaultValue(MICROPROFILE_ROOT_PACKAGE_DEFAULT)); cliOptions.add(new CliOption(FULL_PROJECT, FULL_PROJECT_DESC) .defaultValue("")); // depends on project state + cliOptions.add(new CliOption(X_HELIDON_USE_OPTIONAL, X_HELIDON_USE_OPTIONAL_DESC) + .defaultValue("true")); + addOption(HELIDON_GROUP_BY, HELIDON_GROUP_BY_DESC, GroupBy.DEFAULT.groupingName, GroupBy.OPTION_VALUES); + + knownHttpStatusMap = loadKnownHttpStatusMap(); } - @Override + @Override public void processOpts() { super.processOpts(); + importMapping.put("Headers", helidonMajorVersion == 3 ? "io.helidon.http.common.Headers" : "io.helidon.http.Headers"); + importMapping.put("Optional", "java.util.Optional"); + importMapping.put("Collectors", "java.util.stream.Collectors"); + String userHelidonVersion = ""; String userParentVersion = ""; @@ -169,21 +250,154 @@ public void processOpts() { setHelidonVersion(VersionUtil.instance().defaultVersion()); } + if (helidonMajorVersion > 3) { + importMapping.put("Status", "io.helidon.http.Status"); + importMapping.put("HexFormat", "java.util.HexFormat"); + } + additionalProperties.put(HELIDON_VERSION, helidonVersion); + additionalProperties.put(V3_STYLE, (helidonMajorVersion == 3)); setEEPackageAndDependencies(helidonVersion); setMpTestDependency(helidonVersion); setJandexPluginDependency(helidonVersion); + setMediaPackageInfo(); + setUseReactive(); + setUseOptional(); + convertPropertyToTypeAndWriteBack(HELIDON_GROUP_BY, GroupBy::from, (value) -> this.groupBy = value); + } + + @Override + public void addOperationToGroup(String tag, + String resourcePath, + Operation operation, + CodegenOperation co, + Map> operations) { + + if (helidonMajorVersion <= 3) { + super.addOperationToGroup(tag, resourcePath, operation, co, operations); + return; + } + /* + By convention, the operation's baseName is assigned the name of the group (API) in which it is placed. + */ + String pathPrefixWithoutLeadingSlash = StringUtils.substringBefore(StringUtils.removeStart(resourcePath, "/"), + "/"); + String groupName = (groupBy == GroupBy.TAGS) + ? tag + : sanitizeName(pathPrefixWithoutLeadingSlash); + if (groupName.isEmpty()) { + groupName = "Default"; + } + co.baseName = groupName; + // Invoke the superclass with our chosen group name as the "tag". + super.addOperationToGroup(groupName, resourcePath, operation, co, operations); } @Override public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { CodegenOperation op = super.fromOperation(path, httpMethod, operation, servers); + + op.allParams.forEach(p -> p.vendorExtensions.put(X_IS_MULTIPART_FORM_PARAM, op.isMultipart && p.isFormParam)); 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; } + @Override + public CodegenParameter fromParameter(Parameter parameter, Set imports) { + CodegenParameter result = super.fromParameter(parameter, imports); + if (!result.required && helidonMajorVersion > 3) { + imports.add("Optional"); + } + if (helidonMajorVersion > 3 && result.containerTypeMapped != null) { + imports.add(result.containerTypeMapped); + } + if (result.items != null && result.items.getRef() != null) { + result.vendorExtensions.put(HELIDON_ENUM_CLASS, true); + } + return result; + } + + @Override + public CodegenResponse fromResponse(String responseCode, ApiResponse response) { + CodegenResponse result = super.fromResponse(responseCode, response); + result.vendorExtensions.put(X_HAS_RESPONSE_PROPS, result.hasHeaders || result.dataType != null); + List allResponseProps = new ArrayList<>(result.headers); + List requiredResponseProps = new ArrayList<>(); + List optionalResponseProps = new ArrayList<>(); + if (result.returnProperty != null) { + allResponseProps.add(result.returnProperty); + } + result.vendorExtensions.put(X_ALL_RESPONSE_PROPS, allResponseProps); + for (CodegenProperty responseProp : allResponseProps) { + if (responseProp.required) { + requiredResponseProps.add(responseProp); + } else { + optionalResponseProps.add(responseProp); + } + } + + result.vendorExtensions.put(X_REQUIRED_RESPONSE_PROPS, requiredResponseProps); + result.vendorExtensions.put(X_OPTIONAL_RESPONSE_PROPS, optionalResponseProps); + result.vendorExtensions.put(X_HAS_REQUIRED_RESPONSE_PROPS, !allResponseProps.equals(optionalResponseProps)); + result.vendorExtensions.put(X_RESULT_BUILDER_NEEDS_CTOR, result.isDefault || !requiredResponseProps.isEmpty()); + + return result; + } + + @Override + public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { + /* + Scan the paths of all the operations, computing the longest common prefix. Then compute and set the path suffix + for each operation. + */ + String commonPathPrefixForApi = StringUtils.getCommonPrefix(objs.getOperations().getOperation() + .stream() + .map(op -> op.path) + .map(path -> path.charAt(0) != '/' ? "/" + path : path ) + .toArray(String[]::new)); + String commonPathPrefix; + if (commonPathPrefixForApi.equals("/")) { + commonPathPrefix = "/"; + objs.getOperations().put(X_FIXUP_PATH, "TODO - fix path or operation grouping for better performance"); + } else { + int end = commonPathPrefixForApi.charAt(commonPathPrefixForApi.length() - 1) == '/' + ? commonPathPrefixForApi.length() - 1 + : commonPathPrefixForApi.length(); + commonPathPrefix = commonPathPrefixForApi.substring(0, end); + } + + objs.getOperations().setPathPrefix(commonPathPrefix); + List mismatchedOperations = new ArrayList<>(); + objs.getOperations().getOperation().forEach(op -> { + if (commonPathPrefix.length() > 1) { + op.vendorExtensions.put(X_PATH_SUFFIX, + op.path.equals(commonPathPrefix) ? "/" : op.path.substring(commonPathPrefix.length())); + } else { + op.vendorExtensions.put(X_PATH_SUFFIX, op.path); + mismatchedOperations.add("operation = " + op.operationId + ", path = " + op.path); + }}); + + if (!mismatchedOperations.isEmpty()) { + LOGGER.warn( + "Grouping operations by tag has placed operations into API '{}' for which the generated " + + "routing works inefficiently because the operation paths do not share a common path prefix. " + + "Consider specifying the generator option '" + + HELIDON_GROUP_BY + + " {}' or changing the tag settings or path in your OpenAPI document for the following operations: {}{}", + objs.getOperations().getClassname(), + GroupBy.FIRST_PATH_SEGMENT.groupingName, + System.lineSeparator(), + mismatchedOperations); + } + return objs; + } + + protected String statusDeclaration(String code) { + return "Status." + knownHttpStatusMap.getOrDefault(code, ".create(" + code + ")"); + } + /** * Remove set of options not currently used by any Helidon generator. Should be * called during construction but only on leaf classes. @@ -236,6 +450,38 @@ protected String rootJavaEEPackage() { return rootJavaEEPackage; } + /** + * Prepares a map of predefined HTTP status code constants. + *

+ * Helidon uses its own HTTP status type, and the Helidon code predefines many HTTP status code constants but also allows + * ad hoc creation of other values based on the numeric status value. It's more efficient at runtime to use a constant + * if it exists. + *

+ * This method scans a copy of the Helidon Java file which contains the predefined constants and prepares a map + * from the string representation of the numeric code to the Helidon constant name. This table allows us, when we are + * generating the Response records for an operation, to use the Helidon predefined constant--if it exists--for the + * response code declared for an operation in the OpenAPI document. + *

+ * @return prepared map + */ + private HashMap loadKnownHttpStatusMap() { + try (InputStream is = getClass().getResourceAsStream("/java-helidon/common/Status.java")) { + if (is == null) { + throw new RuntimeException("Unable to locate /java-helidon/common/Status.java to discover known HTTP statuses"); + } + Pattern statusPattern = Pattern.compile("public static final Status (\\w+)\\s*=\\s*new\\s*Status\\((\\d+)", + Pattern.MULTILINE); + return new Scanner(is, StandardCharsets.UTF_8) + .findAll(statusPattern) + .collect(HashMap::new, + (map, match) -> map.put(match.group(2), match.group(1)), + Map::putAll); + + } catch (IOException e) { + throw new RuntimeException(e); + } + } + private void setHelidonVersion(String version) { helidonVersion = VersionUtil.instance().chooseVersion(version); setParentVersion(helidonVersion); @@ -269,6 +515,30 @@ private void setJandexPluginDependency(String version) { additionalProperties.put(X_USE_SMALLRYE_JANDEX_PLUGIN, helidonMajorVersion >= 4); } + private void setMediaPackageInfo() { + additionalProperties.put(X_MEDIA_SUPPORT_PACKAGE_PREFIX, + (helidonMajorVersion >= 4) ? "io.helidon.http.media" : "io.helidon.media"); + additionalProperties.put(X_MEDIA_COMMON_MEDIA_TYPE_PACKAGE_PREFIX, + (helidonMajorVersion >= 4) ? "io.helidon.common.media.type" : "io.helidon.common.http"); + } + + private void setUseReactive() { + useReactive = (helidonMajorVersion < 4); + additionalProperties.put(X_USE_REACTIVE, useReactive); + } + + private void setUseOptional() { + Object useOptionalSetting = additionalProperties.get(X_USE_OPTIONAL); + if (useOptionalSetting == null) { + useOptional = true; + } else if (useOptionalSetting instanceof Boolean) { + useOptional = (Boolean) useOptionalSetting; + } else if (useOptionalSetting instanceof String) { + useOptional = Boolean.parseBoolean((String) useOptionalSetting); + } + additionalProperties.put(X_USE_OPTIONAL, useOptional); + } + private String checkAndSelectRootEEPackage(String version) { String packagePrefixImpliedByVersion = usesJakartaPackages(version) ? MICROPROFILE_ROOT_PACKAGE_JAKARTA @@ -331,6 +601,18 @@ protected void removeCliOptions(String... opt) { forRemoval.forEach(cliOptions::remove); } + protected String apiFolder() { + return folder(apiPackage); + } + + protected String modelFolder() { + return folder(modelPackage); + } + + private String folder(String packageName) { + return (sourceFolder + File.separator + packageName).replace(".", java.io.File.separator); + } + private String chooseExampleReturnTypeValue(CodegenOperation op) { @@ -374,6 +656,50 @@ private String chooseExampleReturnTypeValue(CodegenOperation op) { } } + public static class GenericTypeDeclaration { + @Getter private final String collectionType; + @Getter private final String baseType; + public GenericTypeDeclaration(String collectionType, String baseType) { + this.collectionType = collectionType; + this.baseType = baseType; + } + + public boolean isMap() { + return collectionType.equals("Map"); + } + } + + /** + * Captures information about the model types for which we need GenericType declarations. + */ + public static class GenericTypeDeclarations { + + protected static final String ATTR_NAME = "x-helidon-genericTypeDeclarations"; + protected static final String HAS_ATTR_NAME = "x-helidon-hasGenericTypeDeclarations"; + + // Maps collection type (array or map) to an inner map of base type to declaration. This structure makes it easy to + // avoid duplicate declarations for the same collection and base type. + private final Map> declarations = new HashMap<>(); + + protected void register(OperationsMap opns) { + OperationMap ops = opns.getOperations(); + ops.getOperation().stream() + .flatMap(op -> op.allParams.stream()) + .filter(p -> p.isArray || p.isMap) + .forEach(p -> { + String collectionType = p.isArray ? "List" : "Map"; + declarations.computeIfAbsent(collectionType, ct -> new TreeMap<>()) + .computeIfAbsent(p.baseType, bt -> new GenericTypeDeclaration(collectionType, bt)); + }); + } + + public List genericTypeDeclarations() { + return declarations.values().stream() + .flatMap(m -> m.values().stream()) + .collect(Collectors.toList()); + } + } + /** * Logic for determining the Helidon versions available for user selection, either from helidon.io * or from local preferences or from hard-coded values as a last-chance fallback. @@ -386,13 +712,13 @@ static class VersionUtil { private static final Duration CONNECTION_TIMEOUT = Duration.ofSeconds(10); private static final Duration REQUEST_TIMEOUT = Duration.ofSeconds(5); - private static final System.Logger LOGGER = System.getLogger(VersionUtil.class.getName()); + private final System.Logger LOGGER = System.getLogger(VersionUtil.class.getName()); private static final String DEFAULT_VERSIONS = "\n" + " \n" + " 2.6.5\n" + - " 3.2.6\n" + - " 4.0.5\n" + + " 3.2.7\n" + + " 4.0.9\n" + " \n" + ""; @@ -420,7 +746,7 @@ private VersionUtil() throws BackingStoreException, IOException { } String defaultVersion() { - return DEFAULT_HELIDON_VERSION; + return versions.get(versions.size() - 1); } static int majorVersion(String fullVersion) { @@ -481,7 +807,10 @@ String chooseVersion(String requestedVersion, List candidateVersions) { } } } - return bestMatch != null ? bestMatch.toString() : null; + // The user might have requested a legal version we cannot fully validate because of a network outage + // that prevents us from retrieving the current full list of versions, for example. In such cases return the + // requested version itself as the best match. + return bestMatch != null ? bestMatch.toString() : requestedVersion; } private VersionConstraint constraint(VersionScheme versionScheme, String requestedVersion) { @@ -517,7 +846,7 @@ private VersionConstraint constraint(VersionScheme versionScheme, String request * @return list of supported versions * @throws IOException in case of error accessing the web site and reading the local file */ - private static List versions() throws IOException, BackingStoreException { + private List versions() throws IOException, BackingStoreException { HttpClient httpClient = HttpClient.newBuilder() .connectTimeout(CONNECTION_TIMEOUT) 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 4e4cceb49603..54cfe6574b0c 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 @@ -25,16 +25,23 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Set; +import java.util.stream.Stream; +import com.google.common.collect.Streams; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.Schema; +import io.swagger.v3.oas.models.parameters.Parameter; +import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.servers.Server; import lombok.Getter; 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.meta.GeneratorMetadata; @@ -54,6 +61,7 @@ public class JavaHelidonServerCodegen extends JavaHelidonCommonCodegen { public static final String USE_ABSTRACT_CLASS = "useAbstractClass"; public static final String GRADLE_PROJECT = "gradleProject"; + public static final String X_RESULT_STATUS_DECL = "x-helidon-resultStatusDecl"; protected String implFolder = "src/main/java"; @Getter protected String serializationLibrary = null; @@ -129,6 +137,22 @@ public JavaHelidonServerCodegen() { @Override public void processOpts() { super.processOpts(); + importMapping.put("InputStream", "java.io.InputStream"); + if (helidonMajorVersion > 3) { + importMapping.put("HeaderNames", "io.helidon.http.HeaderNames"); + importMapping.put("Parameters", "io.helidon.common.parameters.Parameters"); + importMapping.put("Value", "io.helidon.common.mapper.Value"); + importMapping.put("MultiPart", "io.helidon.http.media.multipart.MultiPart"); + importMapping.put("Path", "java.nio.file.Path"); + importMapping.put("Files", "java.nio.file.Files"); + importMapping.put("StandardCopyOption", "java.nio.file.StandardCopyOption"); + importMapping.put("UncheckedIOException", "java.io.UncheckedIOException"); + importMapping.put("Status", "io.helidon.http.Status"); + importMapping.put("Objects", "java.util.Objects"); + importMapping.put("Valid", "jakarta.validation.Valid"); + importMapping.put("List", "java.util.List"); + importMapping.put("Map", "java.util.Map"); + } supportingFiles.clear(); dateLibrary = "java8"; @@ -190,13 +214,15 @@ public void processOpts() { (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")); + apiFolder(), + "ValidatorUtils.java")); + if (helidonMajorVersion > 3 && useAbstractClass) { + unmodifiable.add(new SupportingFile("partsUtils.mustache", + apiFolder(), + "PartsUtils.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"); @@ -204,7 +230,15 @@ public void processOpts() { importMapping.put("IOException", "java.io.IOException"); importMapping.put("ByteArrayInputStream", "java.io.ByteArrayInputStream"); } - importMapping.put("Handler", "io.helidon.webserver.Handler"); + importMapping.put("Map", "java.util.Map"); + importMapping.put("ReadableBodyPart", // use the old ReadableBodyPart name for backward compatibility + (helidonMajorVersion <= 3) + ? "io.helidon.media.multipart.ReadableBodyPart" + : "io.helidon.http.media.multipart.ReadablePart"); + importMapping.put("Handler", "io.helidon.webserver." + (helidonMajorVersion != 3 ? "http." : "") + "Handler"); + importMapping.put("GenericType", "io.helidon.common.GenericType"); + importMapping.put("GenericTypes", modelPackage + ".GenericTypes"); + importMapping.put("Optional", "java.util.Optional"); processSupportingFiles(modifiable, unmodifiable); } else { LOGGER.error("Unknown library option (-l/--library): {}", getLibrary()); @@ -255,6 +289,13 @@ private void addApiTemplateFiles() { } } + @Override + public CodegenResponse fromResponse(String responseCode, ApiResponse response) { + var result = super.fromResponse(responseCode, response); + result.vendorExtensions.put(X_RESULT_STATUS_DECL, statusDeclaration(result.code)); + return result; + } + @Override public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, List servers) { CodegenOperation codegenOperation = super.fromOperation(path, httpMethod, operation, servers); @@ -266,8 +307,64 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation codegenOperation.imports.add("Jsonb"); codegenOperation.imports.add("JsonbBuilder"); } - if (codegenOperation.bodyParam != null) { - codegenOperation.imports.add("Handler"); + if (helidonMajorVersion > 3) { + codegenOperation.imports.add("Status"); + codegenOperation.imports.add("HexFormat"); + if (codegenOperation.allParams.stream() + .anyMatch(p -> p.isContainer)) { + codegenOperation.imports.add("Collectors"); + } + if (codegenOperation.allParams.stream() + .anyMatch(p -> p.dataType.contains("@Valid"))) { + codegenOperation.imports.add("Valid"); + } + } + if (codegenOperation.getHasBodyParam()) { + if (helidonMajorVersion == 3) { + codegenOperation.imports.add("Handler"); + } else { + if (codegenOperation.bodyParam.isContainer) { + codegenOperation.imports.add("GenericTypes"); + } + if (codegenOperation.bodyParam.isFile) { + codegenOperation.imports.add("InputStream"); + codegenOperation.imports.add("Path"); + codegenOperation.imports.add("Files"); + codegenOperation.imports.add("IOException"); + codegenOperation.imports.add("UncheckedIOException"); + codegenOperation.imports.add("Status"); + codegenOperation.imports.add("Objects"); + } + } + } + if (codegenOperation.getHasHeaderParams()) { + if (helidonMajorVersion > 3) { + codegenOperation.imports.add("Headers"); + codegenOperation.imports.add("HeaderNames"); + } + } + if (codegenOperation.isMultipart) { + if (helidonMajorVersion > 3) { + codegenOperation.imports.add("MultiPart"); + if (useAbstractClass) { + codegenOperation.formParams.forEach(fp -> { + if (!fp.required) { + codegenOperation.imports.add("Optional"); + } + }); + } + } + } + if (codegenOperation.getHasFormParams()) { + if (helidonMajorVersion > 3) { + codegenOperation.imports.add("Parameters"); + codegenOperation.imports.add("Value"); + codegenOperation.formParams.forEach(fp -> { + if (!fp.required) { + codegenOperation.imports.add("Optional"); + } + }); + } } if (codegenOperation.queryParams.size() > 0 && useAbstractClass) { codegenOperation.imports.add("List"); @@ -278,11 +375,23 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation codegenOperation.imports.add("InputStream"); codegenOperation.imports.add("ReadableBodyPart"); codegenOperation.imports.add("ArrayList"); - codegenOperation.imports.add("DataChunk"); - codegenOperation.imports.add("ByteArrayOutputStream"); + if (helidonMajorVersion <= 3) { + codegenOperation.imports.add("DataChunk"); + codegenOperation.imports.add("ByteArrayOutputStream"); + codegenOperation.imports.add("ByteArrayInputStream"); + } codegenOperation.imports.add("IOException"); codegenOperation.imports.add("UncheckedIOException"); - codegenOperation.imports.add("ByteArrayInputStream"); + if (helidonMajorVersion > 3) { + codegenOperation.imports.add("Parameters"); + } + } + if (!codegenOperation.formParams.isEmpty() && helidonMajorVersion > 3) { + // Need to add it to both the API (abstract class or interface) and the implementation for Helidon 4 and later. + codegenOperation.imports.add("ReadableBodyPart"); + } + if (codegenOperation.isMultipart && helidonMajorVersion > 3) { + codegenOperation.imports.add("Map"); } } return codegenOperation; @@ -315,11 +424,23 @@ public CodegenModel fromModel(String name, Schema model) { @Override public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List allModels) { + objs = super.postProcessOperationsWithModels(objs, allModels); OperationMap operations = objs.getOperations(); if (HELIDON_MP.equals(getLibrary())) { return AbstractJavaJAXRSServerCodegen.jaxrsPostProcessOperations(objs); } if (operations != null && HELIDON_SE.equals(getLibrary())) { + genericTypeDeclarations.register(objs); + if (HELIDON_SE.equals(getLibrary()) + && helidonMajorVersion > 3 + && !genericTypeDeclarations.genericTypeDeclarations().isEmpty()) { + additionalProperties.put(GenericTypeDeclarations.HAS_ATTR_NAME, true); + additionalProperties.put(GenericTypeDeclarations.ATTR_NAME, genericTypeDeclarations.genericTypeDeclarations()); + if (helidonMajorVersion > 3) { + supportingFiles.add(new SupportingFile("genericTypes.mustache", modelFolder(), "GenericTypes.java")); + supportingFiles.add(new SupportingFile("hcollectors.mustache", apiFolder(), "HCollectors.java")); + } + } List ops = operations.getOperation(); for (CodegenOperation operation : ops) { if (operation.formParams.size() > 0) { 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 index 6367b03ed235..543f4586e59f 100644 --- 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 @@ -3,8 +3,6 @@ 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.*; 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 index e50cb99d145f..21040c482afa 100644 --- 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 @@ -16,10 +16,16 @@ 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; +{{#jackson}}{{#x-helidon-v3}}{{! +}}import io.helidon.media.jackson.JacksonSupport; +{{/x-helidon-v3}}{{^x-helidon-v3}}{{! +}}import io.helidon.http.media.jackson.JacksonSupport; +{{/x-helidon-v3}}{{/jackson}}{{! +}}{{#x-helidon-v3}}import io.helidon.webclient.WebClient; +{{/x-helidon-v3}}{{! +}}{{^x-helidon-v3}}import io.helidon.webclient.api.WebClient; +import io.helidon.webclient.api.WebClientConfig; +{{/x-helidon-v3}} import java.net.URI; import java.net.URLEncoder; @@ -170,13 +176,13 @@ public class ApiClient { * 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 + * The builder accepts a {@link WebClient{{^x-helidon-v3}}Config{{/x-helidon-v3}}.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 WebClient{{^x-helidon-v3}}Config{{/x-helidon-v3}}.Builder webClientBuilder; private Config clientConfig; {{#jsonb}} private JsonbConfig jsonbConfig; @@ -190,19 +196,19 @@ public class ApiClient { } /** - * Sets the {@code WebClient.Builder} which the {@code ApiClient.Builder} uses. Any previous setting is discarded. + * Sets the {@code WebClient{{^x-helidon-v3}}Config{{/x-helidon-v3}}.Builder} which the {@code ApiClient.Builder} uses. Any previous setting is discarded. * - * @param webClientBuilder the {@code WebClient.Builder} to be used going forward + * @param webClientBuilder the {@code WebClient{{^x-helidon-v3}}Config{{/x-helidon-v3}}.Builder} to be used going forward * @return the updated builder */ - public Builder webClientBuilder(WebClient.Builder webClientBuilder) { + public Builder webClientBuilder(WebClient{{^x-helidon-v3}}Config{{/x-helidon-v3}}.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 + * Sets the client {@code Config} which the {@code ApiClient.Builder} uses in preparing a default {@code WebClient{{^x-helidon-v3}}Config{{/x-helidon-v3}}.Builder}. + * The builder ignores this setting if you provide your own {@code WebClient{{^x-helidon-v3}}Config{{/x-helidon-v3}}.Builder} by invoking the * {@code webClientBuilder} method. * * @param clientConfig the {@code Config} node containing client settings @@ -217,7 +223,7 @@ public class ApiClient { * @return the previously-stored web client builder or, if none, a default one using the provided or defaulted * client configuration */ - public WebClient.Builder webClientBuilder() { + public WebClient{{^x-helidon-v3}}Config{{/x-helidon-v3}}.Builder webClientBuilder() { if (webClientBuilder == null) { webClientBuilder = defaultWebClientBuilder(); } @@ -249,8 +255,8 @@ public class ApiClient { } {{/jackson}} - private WebClient.Builder defaultWebClientBuilder() { - WebClient.Builder defaultWebClientBuilder = WebClient.builder() + private WebClient{{^x-helidon-v3}}Config{{/x-helidon-v3}}.Builder defaultWebClientBuilder() { + WebClient{{^x-helidon-v3}}Config{{/x-helidon-v3}}.Builder defaultWebClientBuilder = WebClient.builder() .baseUri("{{basePath}}") .config(clientConfig()); {{#jsonb}} @@ -260,7 +266,7 @@ public class ApiClient { {{/jsonb}} {{#jackson}} defaultWebClientBuilder.addMediaSupport(objectMapper == null - ? JacksonSupport.create() + ? JacksonSupport.create({{^x-helidon-v3}}clientConfig(){{/x-helidon-v3}}) : JacksonSupport.create(objectMapper)); {{/jackson}} return defaultWebClientBuilder; 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 index b651e0b4f251..e0b7cbc84a7d 100644 --- 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 @@ -1,11 +1,15 @@ {{>licenseInfo}} package {{invokerPackage}}; -import java.util.concurrent.ExecutionException; +{{#x-helidon-v3}}import java.util.concurrent.ExecutionException; +{{/x-helidon-v3}} import io.helidon.common.GenericType; -import io.helidon.common.reactive.Single; +{{#x-helidon-v3}}import io.helidon.common.reactive.Single; import io.helidon.webclient.WebClientResponse; +{{/x-helidon-v3}}{{! +}}{{^x-helidon-v3}}import io.helidon.webclient.api.HttpClientResponse; +{{/x-helidon-v3}} {{#appName}} /** @@ -18,17 +22,17 @@ import io.helidon.webclient.WebClientResponse; {{/appName}} public interface ApiResponse { - static ApiResponse create(GenericType responseType, Single webClientResponse) { + static ApiResponse create(GenericType responseType, {{#x-helidon-v3}}Single{{/x-helidon-v3}}{{^x-helidon-v3}}HttpClientResponse{{/x-helidon-v3}} webClientResponse) { return new ApiResponseBase<>(responseType, webClientResponse); } /** - * @returns reactive access to the {@link WebClientResponse} describing the response from the server + * @returns reactive access to the {@link {{#x-helidon-v3}}Web{{/x-helidon-v3}}{{^x-helidon-v3}}Http{{/x-helidon-v3}}ClientResponse} describing the response from the server */ - Single webClientResponse(); + {{#x-helidon-v3}}Single{{/x-helidon-v3}}{{^x-helidon-v3}}HttpClientResponse{{/x-helidon-v3}} webClientResponse(); /** - * @return reactive access to the value returned in the response from the server + * @return {{#x-helidon-v3}}reactive {{/x-helidon-v3}}access to the value returned in the response from the server */ - Single result() throws ExecutionException, InterruptedException; + {{#x-helidon-v3}}Single{{/x-helidon-v3}}{{^x-helidon-v3}}T{{/x-helidon-v3}} result(){{#x-helidon-v3}} throws ExecutionException, InterruptedException{{/x-helidon-v3}}; } 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 index 31228f0dc3bb..5490929b3560 100644 --- 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 @@ -1,11 +1,15 @@ {{>licenseInfo}} package {{invokerPackage}}; -import java.util.concurrent.ExecutionException; +{{#x-helidon-v3}}import java.util.concurrent.ExecutionException; +{{/x-helidon-v3}} import io.helidon.common.GenericType; -import io.helidon.common.reactive.Single; +{{#x-helidon-v3}}import io.helidon.common.reactive.Single; import io.helidon.webclient.WebClientResponse; +{{/x-helidon-v3}}{{! +}}{{^x-helidon-v3}}import io.helidon.webclient.api.HttpClientResponse; +{{/x-helidon-v3}} {{#appName}} /** @@ -16,21 +20,21 @@ import io.helidon.webclient.WebClientResponse; {{/appName}} class ApiResponseBase implements ApiResponse { - private final Single webClientResponse; + private final {{#x-helidon-v3}}Single{{/x-helidon-v3}} webClientResponse; private final GenericType responseType; - protected ApiResponseBase(GenericType responseType, Single webClientResponse) { + protected ApiResponseBase(GenericType responseType, {{#x-helidon-v3}}Single{{/x-helidon-v3}} webClientResponse) { this.webClientResponse = webClientResponse; this.responseType = responseType; } @Override - public Single webClientResponse() { + public {{#x-helidon-v3}}Single{{/x-helidon-v3}}{{^x-helidon-v3}}HttpClientResponse{{/x-helidon-v3}} webClientResponse() { return webClientResponse; } @Override - public Single result() throws ExecutionException, InterruptedException { - return webClientResponse.get().content().as(responseType); + public {{#x-helidon-v3}}Single<{{/x-helidon-v3}}T{{#x-helidon-v3}}>{{/x-helidon-v3}} result() {{#x-helidon-v3}}throws ExecutionException, InterruptedException{{/x-helidon-v3}} { + return webClientResponse.{{#x-helidon-v3}}get().content(){{/x-helidon-v3}}{{^x-helidon-v3}}entity(){{/x-helidon-v3}}.as(responseType); } } \ No newline at end of file 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 index eab4ac23ff73..9868a9459cda 100644 --- 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 @@ -8,11 +8,11 @@ ## 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. +The generated classes use the programming model from the Helidon WebClient implementation, primarily the `WebClient` interface and its{{^x-helidon-v3}} associated {{/x-helidon-v3}} +`WebClient{{^x-helidon-v3}}Client{{/x-helidon-v3}}.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 `ApiClient` class wraps a `WebClient` instance. Similarly, the `ApiClient.Builder` class wraps the `WebClient{{^x-helidon-v3}}Config{{/x-helidon-v3}}.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. 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 index 3046b480a288..034dc0a903a6 100644 --- 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 @@ -12,14 +12,27 @@ import com.fasterxml.jackson.databind.ObjectMapper; {{/jackson}} import io.helidon.common.GenericType; -import io.helidon.common.http.MediaType; +{{#x-helidon-v3}}{{! +}}import io.helidon.common.http.MediaType; import io.helidon.common.reactive.Single; +{{/x-helidon-v3}}{{^x-helidon-v3}}{{! +}}import io.helidon.common.media.type.MediaTypes; +{{/x-helidon-v3}} import io.helidon.config.Config; -import io.helidon.media.common.MediaSupport; +{{#x-helidon-v3}}{{! +}}import io.helidon.media.common.MediaSupport; +{{/x-helidon-v3}}{{^x-helidon-v3}}{{! +}}import io.helidon.http.Method; +import io.helidon.http.media.MediaSupport; +{{/x-helidon-v3}} {{#jsonb}}import io.helidon.media.jsonb.JsonbSupport;{{/jsonb}} -{{#jackson}}import io.helidon.media.jackson.JacksonSupport;{{/jackson}} -import io.helidon.webclient.WebClientRequestBuilder; +{{#jackson}}import io.helidon{{^x-helidon-v3}}.http{{/x-helidon-v3}}.media.jackson.JacksonSupport;{{/jackson}} +{{#x-helidon-v3}}import io.helidon.webclient.WebClientRequestBuilder; import io.helidon.webclient.WebClientResponse; +{{/x-helidon-v3}}{{! +}}{{^x-helidon-v3}}import io.helidon.webclient.api.HttpClientRequest; +import io.helidon.webclient.api.HttpClientResponse; +{{/x-helidon-v3}} import {{invokerPackage}}.ApiClient; @@ -67,7 +80,7 @@ public class {{classname}}Impl implements {{classname}} { {{#requiredParams}} Objects.requireNonNull({{paramName}}, "Required parameter '{{paramName}}' not specified"); {{/requiredParams}} - WebClientRequestBuilder webClientRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#x-helidon-v3}}WebClientRequestBuilder{{/x-helidon-v3}}{{^x-helidon-v3}}HttpClientRequest{{/x-helidon-v3}} webClientRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); return {{operationId}}Submit(webClientRequestBuilder{{#allParams}}, {{paramName}}{{/allParams}}); } @@ -78,11 +91,11 @@ public class {{classname}}Impl implements {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} - * @return WebClientRequestBuilder for {{operationId}} + * @return {{#x-helidon-v3}}WebClientRequestBuilder{{/x-helidon-v3}}{{^x-helidon-v3}}HttpClientRequest{{/x-helidon-v3}} for {{operationId}} */ - protected WebClientRequestBuilder {{operationId}}RequestBuilder({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { - WebClientRequestBuilder webClientRequestBuilder = apiClient.webClient() - .method("{{httpMethod}}"); + protected {{#x-helidon-v3}}WebClientRequestBuilder{{/x-helidon-v3}}{{^x-helidon-v3}}HttpClientRequest{{/x-helidon-v3}} {{operationId}}RequestBuilder({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { + {{#x-helidon-v3}}WebClientRequestBuilder{{/x-helidon-v3}}{{^x-helidon-v3}}HttpClientRequest{{/x-helidon-v3}} webClientRequestBuilder = apiClient.webClient() + .method({{#x-helidon-v3}}"{{/x-helidon-v3}}{{^x-helidon-v3}}Method.{{/x-helidon-v3}}{{httpMethod}}{{#x-helidon-v3}}"{{/x-helidon-v3}}); {{#hasQueryParams}} List queryParams = new ArrayList<>(); @@ -119,10 +132,10 @@ public class {{classname}}Impl implements {{classname}} { {{/hasQueryParams}} {{#hasHeaderParams}} - WebClientRequestHeaders headers = webClientRequestBuilder.headers(); + {{#x-helidon-v3}}Web{{/x-helidon-v3}}ClientRequestHeaders headers = webClientRequestBuilder.headers(); {{#headerParams}} if ({{paramName}} != null) { - headers.put("{{baseName}}", {{paramName}}{{^isString}}.toString(){{/isString}}); + headers.{{#x-helidon-v3}}put{{/x-helidon-v3}}{{^x-helidon-v3}}add(HeaderNames.create{{/x-helidon-v3}}("{{baseName}}"{{^x-helidon-v3}}){{/x-helidon-v3}}, {{paramName}}{{^isString}}.toString(){{/isString}}); } {{/headerParams}} @@ -133,7 +146,7 @@ public class {{classname}}Impl implements {{classname}} { .add("{{{baseName}}}=" + {{{paramName}}}) {{/cookieParams}} .toString(); - webClientRequestBuilder.headers().add("Cookie", cookies); + webClientRequestBuilder.headers().add({{^x-helidon-v3}}HeaderNames.create({{/x-helidon-v3}}"Cookie"{{^x-helidon-v3}}){{/x-helidon-v3}}, cookies); {{/hasCookieParams}} {{#hasPathParams}} @@ -145,12 +158,12 @@ public class {{classname}}Impl implements {{classname}} { {{/hasPathParams}} webClientRequestBuilder.path({{#hasPathParams}}path{{/hasPathParams}}{{^hasPathParams}}"{{{path}}}"{{/hasPathParams}}); {{#bodyParam}} - webClientRequestBuilder.contentType(MediaType.APPLICATION_JSON); + webClientRequestBuilder.contentType(MediaType{{^x-helidon-v3}}s{{/x-helidon-v3}}.APPLICATION_JSON); {{/bodyParam}} {{#hasFormParams}} - webClientRequestBuilder.contentType(MediaType.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.contentType(MediaType{{^x-helidon-v3}}s{{/x-helidon-v3}}.APPLICATION_FORM_URLENCODED); {{/hasFormParams}} - webClientRequestBuilder.accept(MediaType.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaType{{^x-helidon-v3}}s{{/x-helidon-v3}}.APPLICATION_JSON); return webClientRequestBuilder; } @@ -165,7 +178,7 @@ public class {{classname}}Impl implements {{classname}} { {{/allParams}} * @return {@code {{>operationResponseSig}}} for the submitted request */ - protected {{>operationResponseSig}} {{operationId}}Submit(WebClientRequestBuilder webClientRequestBuilder{{#allParams}}, {{{dataType}}} {{paramName}}{{/allParams}}) { + protected {{>operationResponseSig}} {{operationId}}Submit({{#x-helidon-v3}}WebClientRequestBuilder{{/x-helidon-v3}}{{^x-helidon-v3}}HttpClientRequest{{/x-helidon-v3}} webClientRequestBuilder{{#allParams}}, {{{dataType}}} {{paramName}}{{/allParams}}) { {{#hasFormParams}} String formParams = new StringJoiner("&") {{#formParams}} @@ -173,7 +186,7 @@ public class {{classname}}Impl implements {{classname}} { {{/formParams}} .toString(); {{/hasFormParams}} - Single webClientResponse = webClientRequestBuilder.submit({{#bodyParam}}{{paramName}}{{/bodyParam}}{{#hasFormParams}}formParams{{/hasFormParams}}); + {{#x-helidon-v3}}Single{{/x-helidon-v3}}{{^x-helidon-v3}}HttpClientResponse{{/x-helidon-v3}} webClientResponse = webClientRequestBuilder.{{#x-helidon-v3}}submit{{/x-helidon-v3}}{{^x-helidon-v3}}{{#bodyParam}}submit{{/bodyParam}}{{#hasFormParams}}submit{{/hasFormParams}}{{^bodyParam}}{{^hasFormParams}}request{{/hasFormParams}}{{/bodyParam}}{{/x-helidon-v3}}({{#bodyParam}}{{paramName}}{{/bodyParam}}{{#hasFormParams}}formParams{{/hasFormParams}}); return ApiResponse.create(RESPONSE_TYPE_{{operationId}}, webClientResponse); } diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_impl_for_v4.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_impl_for_v4.mustache new file mode 100644 index 000000000000..39aacae7b945 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/api_impl_for_v4.mustache @@ -0,0 +1,183 @@ +{{>licenseInfo}} +package {{package}}; + +import java.util.Objects; +import {{invokerPackage}}.ApiResponse; + +{{#jsonb}} +import jakarta.json.bind.JsonbBuilder; +{{/jsonb}} +{{#jackson}} +import com.fasterxml.jackson.databind.ObjectMapper; +{{/jackson}} + +import io.helidon.common.GenericType; +import io.helidon.common.media.type.MediaType; +import io.helidon.config.Config; +import io.helidon.http.media.MediaSupport; +{{#jsonb}}import io.helidon.http.media.jsonb.JsonbSupport;{{/jsonb}} +{{#jackson}}import io.helidon.http.media.jackson.JacksonSupport;{{/jackson}} +import io.helidon.webclient.api.HttpClientRequest; +import io.helidon.webclient.api.HttpClientResponse; +{{#hasHeaderParams}} +import io.helidon.http.ClientRequestHeaders; +import io.helidon.http.HeaderNames; +{{/hasHeaderParams}} + +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}} + HttpClientRequest clientRequest = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + return {{operationId}}Submit(clientRequest{{#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 HttpClientRequest for {{operationId}} + */ + protected HttpClientRequest {{operationId}}HttpClientRequest({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { + HttpClientRequest clientRequest = apiClient.webClient() + .method("{{httpMethod}}"); + + {{#hasQueryParams}} + List queryParams = new 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 -> clientRequest.queryParam(p.getName(), p.getValue())); + + {{/hasQueryParams}} + {{#hasHeaderParams}} + ClientRequestHeaders headers = clientRequest.headers(); + {{#headerParams}} + if ({{paramName}} != null) { + headers.add(HeaderNames.create("{{baseName}}", {{paramName}}{{^isInteger}}{{^isString}}.toString(){{/isString}}{{/isInteger}}); + } + {{/headerParams}} + + {{/hasHeaderParams}} + {{#hasCookieParams}} + String cookies = new StringJoiner("; ") + {{#cookieParams}} + .add("{{{baseName}}}=" + {{{paramName}}}) + {{/cookieParams}} + .toString(); + clientRequest.headers().add(HeaderNames.COOKIE, cookies); + + {{/hasCookieParams}} + clientRequest.path("{{{path}}}"); + {{#pathParams}} + clientRequest.pathParam("{{{paramName}}}", {{paramName}}); + {{/pathParams}} + {/hasPathParams}} + {{#bodyParam}} + clientRequest.contentType(MediaType.APPLICATION_JSON); + {{/bodyParam}} + {{#hasFormParams}} + clientRequest.contentType(MediaType.APPLICATION_FORM_URLENCODED); + {{/hasFormParams}} + clientRequest.accept(MediaType.APPLICATION_JSON); + + return clientRequest; + } + + /** + * Initiates the request for the {{operationId}} operation. + * Optional customization point for subclasses. + * + * @param clientRequest 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 clientRequest{{#allParams}}, {{{dataType}}} {{paramName}}{{/allParams}}) { + {{#hasFormParams}} + String formParams = new StringJoiner("&") + {{#formParams}} + .add("{{{baseName}}}=" + {{paramName}}) + {{/formParams}} + .toString(); + {{/hasFormParams}} + HttpClientResponse clientResponse = clientRequest.submit({{#bodyParam}}{{paramName}}{{/bodyParam}}{{#hasFormParams}}formParams{{/hasFormParams}}); + // Single webClientResponse = clientRequest.submit({{#bodyParam}}{{paramName}}{{/bodyParam}}{{#hasFormParams}}formParams{{/hasFormParams}}); + return ApiResponse.create(RESPONSE_TYPE_{{operationId}}, clientResponse); + } + +{{/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 index 94682b05955f..500146a78c46 100644 --- 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 @@ -16,8 +16,11 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.helidon.common.reactive.Single; +{{#x-helidon-v3}}import io.helidon.common.reactive.Single; import io.helidon.webclient.WebClientResponse; +{{/x-helidon-v3}}{{^x-helidon-v3}}{{! +}}import io.helidon.webclient.api.HttpClientResponse; +{{/x-helidon-v3}} import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; 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 index 9847e7365a6e..55f7e572f8fe 100644 --- 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 @@ -45,8 +45,8 @@ {{/openApiNullable}} {{#jackson}} - io.helidon.media - helidon-media-jackson + io.helidon.{{^x-helidon-v3}}http.{{/x-helidon-v3}}media + helidon-{{^x-helidon-v3}}http-{{/x-helidon-v3}}media-jackson org.glassfish.jersey.media @@ -63,8 +63,8 @@ {{x-helidon-rootJavaEEDepPrefix}}.json.bind-api - io.helidon.media - helidon-media-jsonb + io.helidon.http.media + helidon-http1media-jsonb {{/jsonb}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/common/Status.java b/modules/openapi-generator/src/main/resources/java-helidon/common/Status.java new file mode 100644 index 000000000000..093b44e0139a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/common/Status.java @@ -0,0 +1,549 @@ +/* + * Copyright (c) 2024 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.languages; + +import java.util.Objects; + +/** + * Commonly used status codes defined by HTTP, see + * HTTP/1.1 documentation. + * Additional status codes can be added by applications + * by call {@link #create(int)} or {@link #create(int, String)} with unknown status code, or with text + * that differs from the predefined status codes. + *

+ * Although the constants are instances of this class, they can be compared using instance equality, as the only + * way to obtain an instance is through methods {@link #create(int)} {@link #create(int, String)}, which ensures + * the same instance is returned for known status codes and reason phrases. + *

+ * A good reference is the IANA list of HTTP Status Codes (we may not cover all of them in this type): + * IANA HTTP Status Codes + */ +public class Status { + /** + * 100 Continue, + * see HTTP/1.1 documentations. + */ + public static final Status CONTINUE_100 = new Status(100, "Continue", true); + /** + * 101 Switching Protocols, + * see HTTP/1.1 documentations. + */ + public static final Status SWITCHING_PROTOCOLS_101 = new Status(101, "Switching Protocols", true); + /** + * 200 OK, see HTTP/1.1 documentation. + */ + public static final Status OK_200 = new Status(200, "OK", true); + /** + * 201 Created, see HTTP/1.1 documentation. + */ + public static final Status CREATED_201 = new Status(201, "Created", true); + /** + * 202 Accepted, see HTTP/1.1 documentation + * . + */ + public static final Status ACCEPTED_202 = new Status(202, "Accepted", true); + /** + * 203 Non-Authoritative Information, see + * HTTP/1.1 documentation. + * + * @since 4.0.6 + */ + public static final Status NON_AUTHORITATIVE_INFORMATION_203 = new Status(203, "Non-Authoritative Information", true); + + /** + * 204 No Content, see + * HTTP/1.1 documentation. + */ + public static final Status NO_CONTENT_204 = new Status(204, "No Content", true); + /** + * 205 Reset Content, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status RESET_CONTENT_205 = new Status(205, "Reset Content", true); + /** + * 206 Reset Content, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status PARTIAL_CONTENT_206 = new Status(206, "Partial Content", true); + /** + * 207 Multi-Status, see + * RFC 4918 - HTTP Extensions for WebDAV. + * + * @since 4.0.6 + */ + public static final Status MULTI_STATUS_207 = new Status(207, "Multi-Status", true); + /** + * 301 Moved Permanently, see + * HTTP/1.1 documentation. + */ + public static final Status MOVED_PERMANENTLY_301 = new Status(301, "Moved Permanently", true); + /** + * 302 Found, see HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status FOUND_302 = new Status(302, "Found", true); + /** + * 303 See Other, see + * HTTP/1.1 documentation. + */ + public static final Status SEE_OTHER_303 = new Status(303, "See Other", true); + /** + * 304 Not Modified, see + * HTTP/1.1 documentation. + */ + public static final Status NOT_MODIFIED_304 = new Status(304, "Not Modified", true); + /** + * 305 Use Proxy, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status USE_PROXY_305 = new Status(305, "Use Proxy", true); + /** + * 307 Temporary Redirect, see + * HTTP/1.1 documentation. + */ + public static final Status TEMPORARY_REDIRECT_307 = new Status(307, "Temporary Redirect", true); + /** + * 308 Permanent Redirect, see + * HTTP Status Code 308 documentation. + */ + public static final Status PERMANENT_REDIRECT_308 = new Status(308, "Permanent Redirect", true); + /** + * 400 Bad Request, see + * HTTP/1.1 documentation. + */ + public static final Status BAD_REQUEST_400 = new Status(400, "Bad Request", true); + /** + * 401 Unauthorized, see + * HTTP/1.1 documentation. + */ + public static final Status UNAUTHORIZED_401 = new Status(401, "Unauthorized", true); + /** + * 402 Payment Required, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status PAYMENT_REQUIRED_402 = new Status(402, "Payment Required", true); + /** + * 403 Forbidden, see + * HTTP/1.1 documentation. + */ + public static final Status FORBIDDEN_403 = new Status(403, "Forbidden", true); + /** + * 404 Not Found, see + * HTTP/1.1 documentation. + */ + public static final Status NOT_FOUND_404 = new Status(404, "Not Found", true); + /** + * 405 Method Not Allowed, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status METHOD_NOT_ALLOWED_405 = new Status(405, "Method Not Allowed", true); + /** + * 406 Not Acceptable, see + * HTTP/1.1 documentation. + */ + public static final Status NOT_ACCEPTABLE_406 = new Status(406, "Not Acceptable", true); + /** + * 407 Proxy Authentication Required, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status PROXY_AUTHENTICATION_REQUIRED_407 = new Status(407, "Proxy Authentication Required", true); + /** + * 408 Request Timeout, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status REQUEST_TIMEOUT_408 = new Status(408, "Request Timeout", true); + /** + * 409 Conflict, see + * HTTP/1.1 documentation. + */ + public static final Status CONFLICT_409 = new Status(409, "Conflict", true); + /** + * 410 Gone, see HTTP/1.1 documentation. + */ + public static final Status GONE_410 = new Status(410, "Gone", true); + /** + * 411 Length Required, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status LENGTH_REQUIRED_411 = new Status(411, "Length Required", true); + /** + * 412 Precondition Failed, see + * HTTP/1.1 documentation. + */ + public static final Status PRECONDITION_FAILED_412 = new Status(412, "Precondition Failed", true); + /** + * 413 Request Entity Too Large, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status REQUEST_ENTITY_TOO_LARGE_413 = new Status(413, "Request Entity Too Large", true); + /** + * 414 Request-URI Too Long, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status REQUEST_URI_TOO_LONG_414 = new Status(414, "Request-URI Too Long", true); + /** + * 415 Unsupported Media Type, see + * HTTP/1.1 documentation. + */ + public static final Status UNSUPPORTED_MEDIA_TYPE_415 = new Status(415, "Unsupported Media Type", true); + /** + * 416 Requested Range Not Satisfiable, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status REQUESTED_RANGE_NOT_SATISFIABLE_416 = new Status(416, "Requested Range Not Satisfiable", true); + /** + * 417 Expectation Failed, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status EXPECTATION_FAILED_417 = new Status(417, "Expectation Failed", true); + /** + * 418 I'm a teapot, see + * Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0). + */ + public static final Status I_AM_A_TEAPOT_418 = new Status(418, "I'm a teapot", true); + /** + * Misdirected request, see + * RFC 9110 - Http Semantics. + */ + public static final Status MISDIRECTED_REQUEST_421 = new Status(421, "Misdirected Request", true); + /** + * Unprocessable content, see + * RFC 9110 - Http Semantics. + */ + public static final Status UNPROCESSABLE_CONTENT_422 = new Status(422, "Unprocessable Content", true); + /** + * Locked, see + * RFC 4918 - HTTP Extensions for WebDAV. + */ + public static final Status LOCKED_423 = new Status(423, "Locked", true); + /** + * Failed dependency, see + * RFC 4918 - HTTP Extensions for WebDAV. + */ + public static final Status FAILED_DEPENDENCY_424 = new Status(424, "Failed Dependency", true); + /** + * Upgrade required, see + * RFC 9110 - Http Semantics. + */ + public static final Status UPGRADE_REQUIRED_426 = new Status(426, "Upgrade Required", true); + /** + * Precondition required, see + * RFC 6585 - Additional HTTP Status Codes. + */ + public static final Status PRECONDITION_REQUIRED_428 = new Status(428, "Precondition Required", true); + /** + * Too many requests, see + * RFC 6585 - Additional HTTP Status Codes. + */ + public static final Status TOO_MANY_REQUESTS_429 = new Status(429, "Too Many Requests", true); + /** + * 500 Internal Server Error, see + * HTTP/1.1 documentation. + */ + public static final Status INTERNAL_SERVER_ERROR_500 = new Status(500, "Internal Server Error", true); + /** + * 501 Not Implemented, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status NOT_IMPLEMENTED_501 = new Status(501, "Not Implemented", true); + /** + * 502 Bad Gateway, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status BAD_GATEWAY_502 = new Status(502, "Bad Gateway", true); + /** + * 503 Service Unavailable, see + * HTTP/1.1 documentation. + */ + public static final Status SERVICE_UNAVAILABLE_503 = new Status(503, "Service Unavailable", true); + /** + * 504 Gateway Timeout, see + * HTTP/1.1 documentation. + * + * @since 2.0 + */ + public static final Status GATEWAY_TIMEOUT_504 = new Status(504, "Gateway Timeout", true); + /** + * 505 HTTP Version Not Supported, see + * HTTP/1.1 documentation. + * + * @since 3.0.3 + */ + public static final Status HTTP_VERSION_NOT_SUPPORTED_505 = new Status(505, "HTTP Version Not Supported", true); + /** + * 507 Insufficient Storage, see + * WebDAV documentation. + * + * @since 4.0.6 + */ + public static final Status INSUFFICIENT_STORAGE_507 = new Status(507, "Insufficient Storage", true); + /** + * 508 Loop Detected, see + * RFC 5842 - Bindings for the Constrained Application Protocol (CoAP). + * + * @since 4.0.6 + */ + public static final Status LOOP_DETECTED_508 = new Status(508, "Loop Detected", true); + + /** + * 510 Not Extended, see + * RFC 2774 - An HTTP Extension Framework. + * + * @since 4.0.6 + */ + public static final Status NOT_EXTENDED_510 = new Status(510, "Not Extended", true); + + /** + * 511 Network Authentication Required, see + * RFC 6585 - Additional HTTP Status Codes. + * + * @since 4.0.6 + */ + public static final Status NETWORK_AUTHENTICATION_REQUIRED_511 = new Status(511, "Network Authentication Required", true); + + + static { + // THIS MUST BE AFTER THE LAST CONSTANT + StatusHelper.statusesDone(); + } + + private final int code; + private final String reason; + private final Family family; + private final String codeText; + private final String stringValue; + + private JavaHelidonHttpStatus(int statusCode, String reasonPhrase, boolean instance) { + this.code = statusCode; + this.reason = reasonPhrase; + this.family = Family.of(statusCode); + this.codeText = String.valueOf(code); + this.stringValue = code + " " + reason; + + if (instance) { + StatusHelper.add(this); + } + } + + private JavaHelidonHttpStatus(int statusCode, String reasonPhrase, Family family, String codeText) { + // for custom codes + this.code = statusCode; + this.reason = reasonPhrase; + this.family = family; + this.codeText = codeText; + this.stringValue = code + " " + reason; + } + + /** + * Convert a numerical status code into the corresponding Status. + *

+ * For an unknown code, an ad-hoc {@link Status} is created. + * + * @param statusCode the numerical status code + * @return the matching Status; either a constant from this class, or an ad-hoc {@link Status} + */ + public static Status create(int statusCode) { + Status found = StatusHelper.find(statusCode); + + if (found == null) { + return createNew(Family.of(statusCode), statusCode, "", String.valueOf(statusCode)); + } + return found; + } + + /** + * Convert a numerical status code into the corresponding Status. + *

+ * It either returns an existing {@link Status} constant if possible. + * For an unknown code, or code/reason phrase combination it creates + * an ad-hoc {@link Status}. + * + * @param statusCode the numerical status code + * @param reasonPhrase the reason phrase; if {@code null} or a known reason phrase, an instance with the default + * phrase is returned; otherwise, a new instance is returned + * @return the matching Status + */ + public static Status create(int statusCode, String reasonPhrase) { + Status found = StatusHelper.find(statusCode); + if (found == null) { + return createNew(Family.of(statusCode), statusCode, reasonPhrase, String.valueOf(statusCode)); + } + if (reasonPhrase == null) { + return found; + } + if (found.reasonPhrase().equalsIgnoreCase(reasonPhrase)) { + return found; + } + return createNew(found.family(), statusCode, reasonPhrase, found.codeText()); + } + + private static Status createNew(Family family, int statusCode, String reasonPhrase, String codeText) { + return new Status(statusCode, reasonPhrase, family, codeText); + } + + /** + * Get the associated integer value representing the status code. + * + * @return the integer value representing the status code. + */ + public int code() { + return code; + } + + /** + * Get the class of status code. + * + * @return the class of status code. + */ + public Family family() { + return family; + } + + /** + * Get the reason phrase. + * + * @return the reason phrase. + */ + public String reasonPhrase() { + return reason; + } + + /** + * Text of the {@link #code()}. + * + * @return code string (number as a string) + */ + public String codeText() { + return codeText; + } + + /** + * Get the response status as string. + * + * @return the response status string in the form of a partial HTTP response status line, + * i.e. {@code "Status-Code SP Reason-Phrase"}. + */ + public String toString() { + return stringValue; + } + + /** + * Text of the status as used in HTTP/1, such as "200 OK". + * + * @return text of this status + */ + public String text() { + return stringValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Status status = (Status) o; + return code == status.code && reason.equals(status.reason); + } + + @Override + public int hashCode() { + return Objects.hash(code, reason); + } + + /** + * An enumeration representing the class of status code. Family is used + * here since class is overloaded in Java. + *

+ * Copied from JAX-RS. + */ + public enum Family { + + /** + * {@code 1xx} HTTP status codes. + */ + INFORMATIONAL, + /** + * {@code 2xx} HTTP status codes. + */ + SUCCESSFUL, + /** + * {@code 3xx} HTTP status codes. + */ + REDIRECTION, + /** + * {@code 4xx} HTTP status codes. + */ + CLIENT_ERROR, + /** + * {@code 5xx} HTTP status codes. + */ + SERVER_ERROR, + /** + * Other, unrecognized HTTP status codes. + */ + OTHER; + + /** + * Get the family for the response status code. + * + * @param statusCode response status code to get the family for. + * @return family of the response status code. + */ + public static Family of(int statusCode) { + return switch (statusCode / 100) { + case 1 -> Family.INFORMATIONAL; + case 2 -> Family.SUCCESSFUL; + case 3 -> Family.REDIRECTION; + case 4 -> Family.CLIENT_ERROR; + case 5 -> Family.SERVER_ERROR; + default -> Family.OTHER; + }; + } + } +} 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 index c44408d778bf..9c88def7bc96 100644 --- 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 @@ -5,25 +5,39 @@ package {{package}}; {{#useAbstractClass}} import java.util.Optional; +{{#x-helidon-v3}} import java.util.logging.Logger; +{{/x-helidon-v3}} +{{#x-helidon-v3}} import io.helidon.common.GenericType; import io.helidon.common.reactive.Single; +{{/x-helidon-v3}} {{/useAbstractClass}} -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerRequest; -import io.helidon.webserver.ServerResponse; -import io.helidon.webserver.Service; +import io.helidon.webserver.{{#x-helidon-v3}}Routing{{/x-helidon-v3}}{{^x-helidon-v3}}http.HttpRules{{/x-helidon-v3}}; +import io.helidon.webserver.{{^x-helidon-v3}}http.{{/x-helidon-v3}}ServerRequest; +import io.helidon.webserver.{{^x-helidon-v3}}http.{{/x-helidon-v3}}ServerResponse; +import io.helidon.webserver.{{^x-helidon-v3}}http.Http{{/x-helidon-v3}}Service; {{#operations}} -{{^useAbstractClass}}public interface {{classname}} extends Service { {{/useAbstractClass}} -{{#useAbstractClass}}public abstract class {{classname}} implements Service { +{{^x-helidon-v3}} +@io.helidon.common.Generated(value = "{{additionalProperties.generatorClass}}", + trigger = "tag = '{{baseName}}'", + version = "{{generatorVersion}}") +{{/x-helidon-v3}}{{! +}}{{^useAbstractClass}}public interface {{classname}} extends {{^x-helidon-v3}}Http{{/x-helidon-v3}}Service {{=<% %>=}}{<%#x-helidon-v3%> <%/x-helidon-v3%><%={{ }}=%> +{{/useAbstractClass}}{{! +}}{{#useAbstractClass}}public abstract class {{classname}} implements {{^x-helidon-v3}}Http{{/x-helidon-v3}}Service { - protected static final Logger LOGGER = Logger.getLogger({{classname}}.class.getName()); -{{#jackson}} +{{#x-helidon-v3}} protected static final Logger LOGGER = Logger.getLogger({{classname}}.class.getName()); +{{/x-helidon-v3}}{{! +}}{{#jackson}} protected static final ObjectMapper MAPPER = JsonProvider.objectMapper();{{/jackson}} {{#jsonb}} - protected static final Jsonb JSONB = JsonbBuilder.create();{{/jsonb}} + protected static final Jsonb JSONB = JsonbBuilder.create();{{/jsonb}}{{! +}}{{^x-helidon-v3}} +{{#operations}}{{#operation}} protected {{#lambda.titlecase}}{{operationId}}Op{{/lambda.titlecase}} {{operationId}}Op = create{{#lambda.titlecase}}{{operationId}}Op{{/lambda.titlecase}}(); +{{/operation}}{{/operations}}{{/x-helidon-v3}} {{/useAbstractClass}} /** @@ -31,48 +45,87 @@ import io.helidon.webserver.Service; * @param rules the routing rules. */ @Override - {{#useAbstractClass}}public{{/useAbstractClass}}{{^useAbstractClass}}default{{/useAbstractClass}} void update(Routing.Rules rules) { + {{#useAbstractClass}}public{{/useAbstractClass}}{{^useAbstractClass}}default{{/useAbstractClass}} void {{#x-helidon-v3}}update{{/x-helidon-v3}}{{^x-helidon-v3}}routing{{/x-helidon-v3}}({{#x-helidon-v3}}Routing.{{/x-helidon-v3}}{{^x-helidon-v3}}Http{{/x-helidon-v3}}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}}; + rules.{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}("{{#x-helidon-v3}}{{{path}}}{{/x-helidon-v3}}{{^x-helidon-v3}}{{{vendorExtensions.x-helidon-pathSuffix}}}{{/x-helidon-v3}}", {{! + + See comment below about the signatures of the generated handler methods for v3 vs. v4. + +}}{{#x-helidon-v3}}{{#bodyParam}}{{#isModel}}Handler.create({{{dataType}}}.class, {{/isModel}}this::{{{operationId}}}){{#isModel}}){{/isModel}}{{/bodyParam}}{{! +}}{{^bodyParam}}this::{{{operationId}}}){{/bodyParam}}{{/x-helidon-v3}}{{! +}}{{^x-helidon-v3}}this::{{{operationId}}}){{/x-helidon-v3}}; {{/operation}} } -{{#useAbstractClass}}{{#isFormParamsFunctions}} +{{#x-helidon-v3}}{{#useAbstractClass}}{{#isFormParamsFunctions}} {{!}}{{>formParamsFunctions}} -{{/isFormParamsFunctions}}{{/useAbstractClass}} +{{/isFormParamsFunctions}}{{/useAbstractClass}}{{/x-helidon-v3}} {{#operation}} /** * {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}}. +{{^x-helidon-v3}} * +{{/x-helidon-v3}} * @param request the server request - * @param response the server response{{#allParams}}{{#isBodyParam}}{{#isModel}} - * @param {{paramName}} {{{description}}}{{^description}}{{paramName}}{{/description}} {{/isModel}}{{/isBodyParam}}{{/allParams}} + * @param response the server response{{! +}}{{! + For v3 the interface or abstract class handler methods declare a method parameter for the body parameter--if one is + specified in the OpenAPI operation declaration--in addition to the request and response. The routing code extracts the + body parameter from the request content and passes it to the handler method. + + For v4 the generated handler methods do not declare the body parameter as a method parameter. Instead body parameters are + dealt with, as all other request parameters, by the user-provided code (when an interface is generated) or by the + generated code (when an abstract class is generated). + +}}{{#x-helidon-v3}}{{#allParams}}{{#isBodyParam}}{{#isModel}} + * @param {{paramName}} {{{description}}}{{^description}}{{paramName}}{{/description}} {{/isModel}}{{/isBodyParam}}{{/allParams}}{{/x-helidon-v3}} */ - 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}}) + {{^x-helidon-v3}}{{#useAbstractClass}}protected {{/useAbstractClass}}{{/x-helidon-v3}}void {{{operationId}}}(ServerRequest request, ServerResponse response{{#x-helidon-v3}}{{#allParams}}{{#isBodyParam}}{{#isModel}}, {{{dataType}}} {{paramName}}{{/isModel}}{{/isBodyParam}}{{/allParams}}{{/x-helidon-v3}}){{^useAbstractClass}};{{/useAbstractClass}}{{#useAbstractClass}} { {{> paramsInitial }}{{! +}}{{#x-helidon-v3}} + 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<{{#isFile}}InputStream{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}}>() { }){{/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}} +{{/x-helidon-v3}} +{{#allParams}}{{^x-helidon-v3}} + // Parameter: {{baseName}} +{{/x-helidon-v3}} +{{#x-helidon-v3}} {{/x-helidon-v3}} {{> queryParams }}{{> pathParams }}{{> headerParams}}{{> bodyParams}}{{> formParams}}{{> cookieParams}} {{/allParams}} - handle{{#lambda.titlecase}}{{{operationId}}}{{/lambda.titlecase}}(request, response{{#allParams}}, {{paramName}}{{/allParams}}); - }) +{{#x-helidon-v3}} {{/x-helidon-v3}} {{> paramsFinal }}{{! +}}{{#x-helidon-v3}} {{/x-helidon-v3}} handle{{#lambda.titlecase}}{{{operationId}}}{{/lambda.titlecase}}(request, response{{#allParams}}, {{^x-helidon-v3}} + {{/x-helidon-v3}}{{paramName}}{{/allParams}}); +{{#x-helidon-v3}} }) .exceptionally(throwable -> handleError(request, response, throwable)); +{{/x-helidon-v3}} } /** - * Handle {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}}. + * Handle {{httpMethod}} {{{path}}}{{#summary}} : {{.}}{{/summary}}.{{^x-helidon-v3}} + *{{/x-helidon-v3}} * @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}}); + {{^x-helidon-v3}}{{#useAbstractClass}}protected {{/useAbstractClass}}{{/x-helidon-v3}}abstract {{> handleMethodSignature }}; {{/useAbstractClass}} +{{#x-helidon-v3}} +{{/x-helidon-v3}} +{{/operation}} +{{#useAbstractClass}}{{#x-helidon-v3}} abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable);{{/x-helidon-v3}}{{! +}}{{^x-helidon-v3}} +{{#operation}} +{{> opHelpers }} {{/operation}} -{{#useAbstractClass}} abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable);{{! -}}{{/useAbstractClass}} -} +{{/x-helidon-v3}}{{/useAbstractClass}} +{{#useAbstractClass}} +{{^x-helidon-v3}} + @Override + public void afterStop() { + System.out.println("Service {{classname}} is down. Goodbye!"); + } + + +{{/x-helidon-v3}}{{! +}}{{/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 index b6cf71293f52..073412ffa8b2 100644 --- 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 @@ -3,17 +3,22 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} {{^useAbstractClass}} -import java.util.logging.Logger;{{/useAbstractClass}} +{{#x-helidon-v3}}import java.util.logging.Logger; -import io.helidon.webserver.ServerRequest; -import io.helidon.webserver.ServerResponse; +{{/x-helidon-v3}} +{{/useAbstractClass}} +import io.helidon.webserver.{{^x-helidon-v3}}http.{{/x-helidon-v3}}ServerRequest; +import io.helidon.webserver.{{^x-helidon-v3}}http.{{/x-helidon-v3}}ServerResponse; {{#operations}} public class {{classname}}Impl {{^useAbstractClass}}implements{{/useAbstractClass}}{{#useAbstractClass}}extends{{/useAbstractClass}} {{classname}} { +{{#x-helidon-v3}} private static final int HTTP_CODE_NOT_IMPLEMENTED = 501; +{{/x-helidon-v3}} {{^useAbstractClass}} - private static final Logger LOGGER = Logger.getLogger({{classname}}.class.getName()); +{{#x-helidon-v3}} private static final Logger LOGGER = Logger.getLogger({{classname}}.class.getName()); +{{/x-helidon-v3}} {{#jackson}} private static final ObjectMapper MAPPER = JsonProvider.objectMapper();{{/jackson}} {{#jsonb}} @@ -22,19 +27,47 @@ public class {{classname}}Impl {{^useAbstractClass}}implements{{/useAbstractClas {{#operation}} {{#useAbstractClass}} - public void handle{{#lambda.titlecase}}{{{operationId}}}{{/lambda.titlecase}}(ServerRequest request, ServerResponse response{{#allParams}}, {{>dataType}} {{paramName}}{{/allParams}}) { + {{^x-helidon-v3}}@Override + protected{{/x-helidon-v3}}{{#x-helidon-v3}}public{{/x-helidon-v3}} {{> handleMethodSignature }} { {{/useAbstractClass}} {{^useAbstractClass}} +{{#x-helidon-v3}} public void {{{operationId}}}(ServerRequest request, ServerResponse response{{#allParams}}{{#isBodyParam}}{{#isModel}}, {{{dataType}}} {{paramName}}{{/isModel}}{{/isBodyParam}}{{/allParams}}) { -{{/useAbstractClass}} - response.status(HTTP_CODE_NOT_IMPLEMENTED).send(); +{{/x-helidon-v3}} +{{^x-helidon-v3}} + @Override + public void {{{operationId}}}(ServerRequest request, ServerResponse response) { +{{! + If the user generated an interface instead of an abstract class, add a few conveniences here in the implementation class + to suggest how the developer might implement the code. + +}}{{^isMultipart}}{{#hasFormParams}} Parameters formParams = request.content().as(Parameters.class); +{{/hasFormParams}}{{/isMultipart}}{{! +}}{{#isMultipart}}{{#useAbstractClass}} Map parts = PartsUtils.partsMap(request); +{{/useAbstractClass}}{{! +}}{{^useAbstractClass}}{{! +}} MultiPart multiPart = request.content().as(MultiPart.class); +{{/useAbstractClass}}{{/isMultipart}}{{! +}}{{#useBeanValidation}} ValidatorUtils.Validator validator = ValidatorUtils.validator(); +{{/useBeanValidation}}{{! +}}{{/x-helidon-v3}}{{! +}}{{/useAbstractClass}}{{^x-helidon-v3}} +{{/x-helidon-v3}}{{! +}} response.status({{#x-helidon-v3}}HTTP_CODE_NOT_IMPLEMENTED{{/x-helidon-v3}}{{^x-helidon-v3}}Status.NOT_IMPLEMENTED_501{{/x-helidon-v3}}).send(); } {{/operation}} -{{#useAbstractClass}} +{{#useAbstractClass}}{{#x-helidon-v3}} public Void handleError(ServerRequest request, ServerResponse response, Throwable throwable) { return response.send(throwable); } -{{/useAbstractClass}} -} +{{/x-helidon-v3}}{{/useAbstractClass}}{{! +}}{{^useAbstractClass}}{{^x-helidon-v3}} + @Override + public void afterStop() { + System.out.println("Service {{classname}} is down. Goodbye!"); + } + +{{/x-helidon-v3}}{{/useAbstractClass}}{{! +}}} {{/operations}} \ No newline at end of file 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 index d0479eb939ed..80a3087ca9d9 100644 --- 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 @@ -1,4 +1,4 @@ -{{#pattern}}{{#isString}} +{{#x-helidon-v3}}{{#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}} @@ -12,5 +12,29 @@ 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 + ValidatorUtils.validateMin({{^isNumber}}new java.math.BigDecimal({{/isNumber}}{{paramName}}{{^isNumber}}){{/isNumber}}, "{{minimum}}", {{#exclusiveMinimum}}false{{/exclusiveMinimum}}{{^exclusiveMinimum}}true{{/exclusiveMinimum}});{{/minimum}}{{#maximum}} + ValidatorUtils.validateMax({{^isNumber}}new java.math.BigDecimal({{/isNumber}}{{paramName}}{{^isNumber}}){{/isNumber}}, "{{maximum}}", {{#exclusiveMaximum}}false{{/exclusiveMaximum}}{{^exclusiveMaximum}}true{{/exclusiveMaximum}});{{/maximum}}{{/isLong}}{{/isInteger}}{{! +}}{{/x-helidon-v3}}{{! +}}{{^x-helidon-v3}}{{! +}}{{#pattern}}{{#isString}}{{! +}} validator.validatePattern("{{paramName}}", {{paramName}}, "{{{pattern}}}");{{/isString}}{{/pattern}}{{#minLength}}{{#maxLength}} + validator.validateSize("{{paramName}}", {{paramName}}, {{minLength}}, {{maxLength}});{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} + validator.validateSize("{{paramName}}", {{paramName}}, {{minLength}}, null);{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} + validator.validateSize("{{paramName}}", {{paramName}}, null, {{.}});{{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} + validator.validateSize("{{paramName}}", {{paramName}}, {{minItems}}, {{maxItems}});{{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} + validator.validateSize("{{paramName}}", {{paramName}}, {{minItems}}, null);{{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} + validator.validateSize("{{paramName}}", {{paramName}}, null, {{.}});{{/maxItems}}{{/minItems}}{{#useBeanValidation}}{{#isEmail}} + //RFC 5322 for Email Validation + validator.validatePattern("{{paramName}}", {{paramName}}, "^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+$");{{/isEmail}}{{/useBeanValidation}}{{#isInteger}}{{#minimum}} + validator.validateMin("{{paramName}}", {{paramName}}, {{.}}, {{#exclusiveMinimum}}false{{/exclusiveMinimum}}{{^exclusiveMinimum}}true{{/exclusiveMinimum}});{{/minimum}}{{#maximum}} + validator.validateMax("{{paramName}}", {{paramName}}, {{.}}, {{#exclusiveMaximum}}false{{/exclusiveMaximum}}{{^exclusiveMaximum}}true{{/exclusiveMaximum}});{{/maximum}}{{/isInteger}}{{#isLong}}{{#minimum}} + validator.validateMin("{{paramName}}", {{paramName}}.intValue(), {{.}}, {{#exclusiveMinimum}}false{{/exclusiveMinimum}}{{^exclusiveMinimum}}true{{/exclusiveMinimum}});{{/minimum}}{{#maximum}} + validator.validateMax("{{paramName}}", {{paramName}}.intValue(), {{.}}, {{#exclusiveMaximum}}false{{/exclusiveMaximum}}{{^exclusiveMaximum}}true{{/exclusiveMaximum}});{{/maximum}}{{/isLong}}{{#isDouble}}{{#minimum}} + validator.validateMin("{{paramName}}", {{paramName}}, {{.}}d, {{#exclusiveMinimum}}false{{/exclusiveMinimum}}{{^exclusiveMinimum}}true{{/exclusiveMinimum}});{{/minimum}}{{#maximum}} + validator.validateMax("{{paramName}}", {{paramName}}, {{.}}d, {{#exclusiveMaximum}}false{{/exclusiveMaximum}}{{^exclusiveMaximum}}true{{/exclusiveMaximum}});{{/maximum}}{{/isDouble}}{{#isFloat}}{{#minimum}} + validator.validateMin("{{paramName}}", {{paramName}}, {{.}}f, {{#exclusiveMinimum}}false{{/exclusiveMinimum}}{{^exclusiveMinimum}}true{{/exclusiveMinimum}});{{/minimum}}{{#maximum}} + validator.validateMax("{{paramName}}", {{paramName}}, {{.}}f, {{#exclusiveMaximum}}false{{/exclusiveMaximum}}{{^exclusiveMaximum}}true{{/exclusiveMaximum}});{{/maximum}}{{/isFloat}}{{^isInteger}}{{^isLong}}{{^isDouble}}{{^isFloat}}{{#minimum}} + validator.validateMin("{{paramName}}", {{paramName}}, "{{minimum}}", {{#exclusiveMinimum}}false{{/exclusiveMinimum}}{{^exclusiveMinimum}}true{{/exclusiveMinimum}});{{/minimum}}{{#maximum}} + validator.validateMax("{{paramName}}", {{paramName}}, "{{maximum}}", {{#exclusiveMaximum}}false{{/exclusiveMaximum}}{{^exclusiveMaximum}}true{{/exclusiveMaximum}});{{/maximum}}{{/isFloat}}{{/isDouble}}{{/isLong}}{{/isInteger}}{{! +}}{{! +}}{{/x-helidon-v3}} \ 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 index b590d59fd0db..e619e4e07eed 100644 --- 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 @@ -1,2 +1,2 @@ {{#required}}{{!}} - {{!}}ValidatorUtils.checkNonNull({{paramName}});{{/required}} \ No newline at end of file + {{#x-helidon-v3}} {{!}}ValidatorUtils.checkNonNull({{/x-helidon-v3}}{{^x-helidon-v3}}validator.require("{{paramName}}", {{/x-helidon-v3}}{{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 index 60b256f885ef..bfd92708d95a 100644 --- 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 @@ -1,2 +1,2 @@ {{! PathParam is always required, no @NotNull necessary }} -ValidatorUtils.checkNonNull({{paramName}});{{#isPrimitiveType}}{{>beanValidationCore}}{{/isPrimitiveType}} \ No newline at end of file +{{#x-helidon-v3}}ValidatorUtils.checkNonNull({{/x-helidon-v3}}{{^x-helidon-v3}}validator.require("{{paramName}}", {{/x-helidon-v3}}{{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 index dfec605af6e3..d56d38a6a353 100644 --- 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 @@ -1,2 +1,2 @@ {{#required}}{{!}} - {{!}}ValidatorUtils.checkNonNull({{paramName}});{{/required}}{{#isPrimitiveType}}{{>beanValidationCore}}{{/isPrimitiveType}} \ No newline at end of file + {{#x-helidon-v3}} {{!}}ValidatorUtils.checkNonNull({{/x-helidon-v3}}{{^x-helidon-v3}}validator.require("{{paramName}}", {{/x-helidon-v3}}{{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/bodyParamDecl.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/bodyParamDecl.mustache new file mode 100644 index 000000000000..bd9c53e953ac --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/bodyParamDecl.mustache @@ -0,0 +1,5 @@ +{{! + Assumed Mustache context is one EntrySet element from the media-type-name-to-CodegenMediaType map + at operation->requestBody->content. +}}{{! +}}{{>paramDeclType}} {{paramName}}{{#lambda.helidonMediaTypeSuffix}}{{key}}{{/lambda.helidonMediaTypeSuffix}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/bodyParamValue.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/bodyParamValue.mustache new file mode 100644 index 000000000000..97213b2acdb4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/bodyParamValue.mustache @@ -0,0 +1,3 @@ +request.content().hasEntity() + ? {{^required}}Optional.of({{/required}}request.content().{{#isFile}}inputStream(){{/isFile}}{{^isFile}}as({{> paramValueAs }}){{/isFile}}{{> paramValueAsSuffix }}{{^required}}){{/required}} + : {{^isContainer}}{{^required}}Optional.empty(){{/required}}{{#required}}null{{/required}}{{/isContainer}}{{#isContainer}}{{containerTypeMapped}}.of(){{/isContainer}} \ 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 index 7994e23e023c..25b69fdc0aee 100644 --- 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 @@ -1 +1,4 @@ -{{#isBodyParam}}ValidatorUtils.checkNonNull({{paramName}});{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}{{^x-helidon-v3}}{{> paramDecl }} = {{> paramMethodInvocation }};{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} +{{/x-helidon-v3}} +{{#x-helidon-v3}}ValidatorUtils.checkNonNull({{paramName}}); +{{/x-helidon-v3}}{{/isBodyParam}} \ 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 index cc2a3d0d4dfd..cd720dc8740f 100644 --- 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 @@ -1,4 +1,6 @@ -{{#isPrimitiveType}}{{^isFile}}{{{dataType}}}{{/isFile}}{{#isFile}}InputStream{{/isFile}}{{/isPrimitiveType}}{{! +{{! + Used for v3 only. +}}{{#isPrimitiveType}}{{^isFile}}{{{dataType}}}{{/isFile}}{{#isFile}}InputStream{{/isFile}}{{/isPrimitiveType}}{{! }}{{^isPrimitiveType}}{{! }}{{#isArray}}{{! }}{{#isBodyParam}}{{{dataType}}}{{/isBodyParam}}{{! diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formOrBodyParamDeclType.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formOrBodyParamDeclType.mustache new file mode 100644 index 000000000000..ceebc618a460 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/formOrBodyParamDeclType.mustache @@ -0,0 +1 @@ +{{#isFile}}{{#isArray}}List<{{/isArray}}{{^isBodyParam}}byte[]{{/isBodyParam}}{{#isBodyParam}}InputStream{{/isBodyParam}}{{#isArray}}>{{/isArray}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} \ No newline at end of file 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 index 82c0f5d715ca..370939f31843 100644 --- 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 @@ -1 +1,6 @@ -{{#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 +{{! + + Starting with v4 we process each part in multipart content as a form param because that's how the generator presents parts. + +}}{{#isFormParam}}{{> paramDecl}} = {{>paramValue}}{{#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 index f4e382d48102..bbc0f5fbca90 100644 --- 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 @@ -1,11 +1,17 @@ -private void processNonFileFormField(String name, Map> nonFileFormContent, ReadableBodyPart part) { +private void processNonFileFormField(String name, Map> nonFileFormContent, Readable{{#x-helidon-v3}}Body{{/x-helidon-v3}}Part part) { List content = nonFileFormContent.computeIfAbsent(name, key -> new ArrayList<>()); - part.content().as(String.class).thenAccept(content::add); +{{#x-helidon-v3}} part.content().as(String.class).thenAccept(content::add); +{{/x-helidon-v3}} +{{^x-helidon-v3}} content.add(part.as(String.class)); +{{/x-helidon-v3}} } - - private void processFileFormField(String name, Map> fileFormContent, ReadableBodyPart part) { - List content = fileFormContent.computeIfAbsent(name, key -> new ArrayList<>()); - part.content().map(DataChunk::bytes) +{{! + Helidon 4 changed ReadableBodyPart to ReadablePart and, for Helidon 4, we save the entire part (which can now include + the optional filename and part headers) as well as the InputStream instead of just the InputStream as in Helidon 3. +}} + private void processFileFormField(String name, Map> fileFormContent, Readable{{#x-helidon-v3}}Body{{/x-helidon-v3}}Part part) { + {{^x-helidon-v3}} {{/x-helidon-v3}}List<{{#x-helidon-v3}}InputStream{{/x-helidon-v3}}{{^x-helidon-v3}}ReadablePart{{/x-helidon-v3}}> content = fileFormContent.computeIfAbsent(name, key -> new ArrayList<>()); +{{#x-helidon-v3}} part.content().map(DataChunk::bytes) .collect(ByteArrayOutputStream::new, (stream, bytes) -> { try { stream.write(bytes); @@ -14,4 +20,7 @@ private void processNonFileFormField(String name, Map> nonF } }) .thenAccept(byteStream -> content.add(new ByteArrayInputStream(byteStream.toByteArray()))); - } \ No newline at end of file +{{/x-helidon-v3}}{{! +}}{{^x-helidon-v3}} content.add(part); +{{/x-helidon-v3}} + } 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 index 08d90802b6c2..f3d3d075f4ec 100644 --- 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 @@ -1,4 +1,5 @@ -Map> nonFileFormContent = new HashMap<>(); +{{#x-helidon-v3}}{{! +}}Map> nonFileFormContent = new HashMap<>(); Map> fileFormContent = new HashMap<>(); Single formSingle = request.content().asStream(ReadableBodyPart.class) .forEach(part -> { @@ -8,4 +9,12 @@ Map> nonFileFormContent = new HashMap<>(); }}{{#isFile}}processFileFormField(name, fileFormContent, part);{{/isFile}} }{{/formParams}} part.drain(); - }); \ No newline at end of file + }); +{{/x-helidon-v3}}{{! +}}{{^x-helidon-v3}} +{{^isMultipart}}{{#hasFormParams}}{{! +}} Parameters formParams = request.content().as(Parameters.class); +{{/hasFormParams}}{{/isMultipart}}{{! +}}{{#isMultipart}}{{! +}} Map parts = PartsUtils.partsMap(request); +{{/isMultipart}}{{/x-helidon-v3}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/genericTypes.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/genericTypes.mustache new file mode 100644 index 000000000000..468c6696baea --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/genericTypes.mustache @@ -0,0 +1,12 @@ +package {{modelPackage}}; + +import java.util.List; +import java.util.Map; + +import io.helidon.common.GenericType; + +public interface GenericTypes { +{{#x-helidon-genericTypeDeclarations}} + GenericType<{{collectionType}}<{{#isMap}}String, {{/isMap}}{{baseType}}>> TYPE__{{collectionType}}_{{baseType}} = new GenericType<>() {}; +{{/x-helidon-genericTypeDeclarations}} +} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/handleMethodSignature.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/handleMethodSignature.mustache new file mode 100644 index 000000000000..11062e771b79 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/handleMethodSignature.mustache @@ -0,0 +1,2 @@ +void handle{{#lambda.titlecase}}{{{operationId}}}{{/lambda.titlecase}}(ServerRequest request, ServerResponse response{{#allParams}}, {{^x-helidon-v3}} + {{/x-helidon-v3}}{{>paramDecl}}{{/allParams}}) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/handlerUtils.mustache.save b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/handlerUtils.mustache.save new file mode 100644 index 000000000000..c6eb2357ea6e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/handlerUtils.mustache.save @@ -0,0 +1,70 @@ +package {{apiPackage}}; + +import java.util.logging.Logger; + +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +/** + * Utility methods related to handlers for Helidon 4+ support. + */ +class HandlerUtils { + + private static final Logger LOGGER = Logger.getLogger(HandlerUtils.class.getName()); + + private HandlerUtils() { + } + + /** + * Handler which accepts a request, response, and a body parameter type and, if the body part is declared as required, + * enforces that. + * + * @param type of the body parameter + */ + static class Handler implements io.helidon.webserver.http.Handler { + + private final Class type; + private final boolean isRequired; + private final Op op; + + Handler(Class type, boolean isRequired, Op op) { + this.type = type; + this.isRequired = isRequired; + this.op = op; + } + + /** + * Returns a handler which extracts a body parameter from the content and, if the parameter is required, enforces that. + * + * @param type type of the body parameter + * @param isRequired whether the body parameter is declared as required + * @param op operation the handler is to invoke with the request, response, and body parameter + * @param type of the body parameter + * @return the new handler + */ + static Handler create(Class type, boolean isRequired, Handler.Op op) { + return new Handler<>(type, isRequired, op); + } + + @Override + public void handle(ServerRequest serverRequest, ServerResponse serverResponse) + throws Exception { + ValidatorUtils.Validator validator = isRequired ? ValidatorUtils.validator() : null; + T body = serverRequest.content().as(type); + if (isRequired) { + validator.require("body", body); + validator.execute(); + } + op.apply(serverRequest, serverResponse, body); + } + + /** + * An operation to which the handler delegates upon receipt of a request and extraction of the body parameter. + * + * @param type of the body parameter + */ + interface Op { + void apply(ServerRequest request, ServerResponse response, T body); + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/hcollectors.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/hcollectors.mustache new file mode 100644 index 000000000000..c00214ac3de7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/hcollectors.mustache @@ -0,0 +1,217 @@ +package {{apiPackage}}; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.BiConsumer; +import java.util.function.BinaryOperator; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collector; + +import io.helidon.common.GenericType; +import io.helidon.http.Headers; +import io.helidon.http.WritableHeaders; +import io.helidon.http.media.EntityReader; +import io.helidon.http.media.FormParamsSupport; +import io.helidon.http.media.MediaSupport; + +/** + * Collectors with particular features useful from the generated code. + */ +@io.helidon.common.Generated(value = "{{additionalProperties.generatorClass}}", + trigger = "utility", + version = "{{generatorVersion}}") +public final class HCollectors { + + private static final MediaSupport FORM_PARAMS_SUPPORT = FormParamsSupport.create(); + private static final Headers EMPTY_HEADERS = WritableHeaders.create(); + + /** + * Returns a new {@link java.util.stream.Collector} that applies a default value in the absence of provided values and returns + * the resulting {@link java.util.List}. + * + * @param baseDefault default value expressed in the base type of the parameter + * @param converter transforms the default value from the base type to the result type + * @param base type + * @param result type + * @return new collector + */ + static Collector> toDefaultedList(BT baseDefault, Function converter) { + return new DefaultableListCollector<>(baseDefault, converter); + } + + static Collector> noOpMap() { + + return new NoOpMapCollector(); + } + + /** + * Decodes URL encoded string as binary data. + *

+ * Inspired hugely by java.net.URLDecoder. + *

+ * + * @param s URL encoded string + * @return binary data encoded by the string + */ + static byte[] decodeBinaryFormParam(String s) { + boolean needToChange = false; + int numChars = s.length(); + int i = 0; + + char c; + ByteArrayOutputStream output = new ByteArrayOutputStream(); + byte[] bytes = null; + while (i < numChars) { + c = s.charAt(i); + switch (c) { + case '+': + output.write(' '); + i++; + needToChange = true; + break; + case '%': + /* + * Starting with this instance of %, process all + * consecutive substrings of the form %xy. Each + * substring %xy will yield a byte. Convert all + * consecutive bytes obtained this way to whatever + * character(s) they represent in the provided + * encoding. + */ + + try { + + // (numChars-i)/3 is an upper bound for the number + // of remaining bytes + if (bytes == null) + bytes = new byte[(numChars-i)/3]; + int pos = 0; + + while ( ((i+2) < numChars) && + (c=='%')) { + int v = Integer.parseInt(s, i + 1, i + 3, 16); + if (v < 0) + throw new IllegalArgumentException( + "URLDecoder: Illegal hex characters in escape " + + "(%) pattern - negative value"); + bytes[pos++] = (byte) v; + i+= 3; + if (i < numChars) + c = s.charAt(i); + } + + // A trailing, incomplete byte encoding such as + // "%x" will cause an exception to be thrown + + if ((i < numChars) && (c=='%')) + throw new IllegalArgumentException( + "URLDecoder: Incomplete trailing escape (%) pattern"); + + output.write(bytes, 0, pos); + } catch (NumberFormatException e) { + throw new IllegalArgumentException( + "URLDecoder: Illegal hex characters in escape (%) pattern - " + + e.getMessage()); + } + needToChange = true; + break; + default: + output.write(c); + i++; + break; + } + } + + return output.toByteArray(); + } + + private static class NoOpMapCollector implements Collector, Map> { + + @Override + public Supplier> supplier() { + return LinkedHashMap::new; + } + + @Override + public BiConsumer, String> accumulator() { + return (map, expr) -> {}; + } + + @Override + public BinaryOperator> combiner() { + return (a, b) -> a; + } + + @Override + public Function, Map> finisher() { + return Function.identity(); + } + + @Override + public Set characteristics() { + return Set.of(); + } + } + + private abstract static class AbstractListCollector implements Collector, List> { + + @Override + public Supplier> supplier() { + return ArrayList::new; + } + + @Override + public BiConsumer, T> accumulator() { + return List::add; + } + + @Override + public BinaryOperator> combiner() { + return (l1, l2) -> { + l2.addAll(l1); + return l2; + }; + } + + @Override + public Set characteristics() { + return Set.of(); + } + } + + /** + * {@link java.util.stream.Collector} for streams of the base type (values from the request, often strings} + * applying a converter to the desired result type and supplying a default value if there are no base values. + * + * @param base type (often string) + * @param result type + */ + private static class DefaultableListCollector extends AbstractListCollector { + + private final BT baseDefault; + private final Function converter; + + DefaultableListCollector(BT baseDefault, Function converter) { + this.baseDefault = baseDefault; + this.converter = converter; + } + + @Override + public Function, List> finisher() { + return l -> { + if (l.isEmpty()) { + l.add(converter.apply(baseDefault)); + } + return l; + }; + } + } +} \ 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 index 89fb5e8f51b5..0959730cd612 100644 --- 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 @@ -1 +1 @@ -{{#isHeaderParam}}{{>dataType}} {{paramName}} = {{>paramValue}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{>paramDecl}} = {{>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/main.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/main.mustache index 575d3704448a..ca4e2b1b49dc 100644 --- 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 @@ -2,22 +2,35 @@ package {{invokerPackage}}; {{#apiInfo}}{{#apis}}{{#operations}} import {{package}}.{{classname}}Impl;{{/operations}}{{/apis}}{{/apiInfo}} -import io.helidon.common.LogConfig; +import io.helidon{{^x-helidon-v3}}.logging{{/x-helidon-v3}}.common.LogConfig; +{{#x-helidon-v3}} import io.helidon.common.reactive.Single; +{{/x-helidon-v3}} import io.helidon.config.Config; +{{#x-helidon-v3}} import io.helidon.health.HealthSupport; import io.helidon.health.checks.HealthChecks; import io.helidon.media.jsonp.JsonpSupport; +{{/x-helidon-v3}} {{#jsonb}} +{{#x-helidon-v3}} import io.helidon.media.jsonb.JsonbSupport; +{{/x-helidon-v3}} {{/jsonb}} {{#jackson}} +{{#x-helidon-v3}} import io.helidon.media.jackson.JacksonSupport; import {{apiPackage}}.JsonProvider; +{{/x-helidon-v3}} {{/jackson}} +{{#x-helidon-v3}} import io.helidon.metrics.MetricsSupport; import io.helidon.openapi.OpenAPISupport; import io.helidon.webserver.Routing; +{{/x-helidon-v3}} +{{^x-helidon-v3}} +import io.helidon.webserver.http.HttpRouting; +{{/x-helidon-v3}} import io.helidon.webserver.WebServer; /** @@ -43,14 +56,18 @@ public final class Main { * Start the server. * @return the created {@link WebServer} instance */ - static Single startServer() { + static {{#x-helidon-v3}}Single<{{/x-helidon-v3}}WebServer{{#x-helidon-v3}}>{{/x-helidon-v3}} startServer() { // load logging configuration LogConfig.configureRuntime(); // By default this will pick up application.yaml from the classpath Config config = Config.create(); +{{^x-helidon-v3}} + Config.global(config); +{{/x-helidon-v3}} +{{#x-helidon-v3}} WebServer server = WebServer.builder(createRouting(config)) .config(config.get("server")) .addMediaSupport(JsonpSupport.create()) @@ -74,10 +91,21 @@ public final class Main { System.err.println("Startup failed: " + t.getMessage()); t.printStackTrace(System.err); }); +{{/x-helidon-v3}} +{{^x-helidon-v3}} + WebServer webserver = WebServer.builder() + .config(config.get("server")) + .routing(Main::routing) + .build() + .start(); + + System.out.println("WEB server is up! {{{basePath}}}"); +{{/x-helidon-v3}} return webserver; } +{{#x-helidon-v3}} /** * Creates new {@link Routing}. * @@ -98,4 +126,14 @@ public final class Main { .register("/", new {{classname}}Impl()){{/operations}}{{/apis}}{{/apiInfo}} .build(); } +{{/x-helidon-v3}} +{{^x-helidon-v3}} + /** + * Updates HTTP routing and implicitly registers observe providers. + */ + static void routing(HttpRouting.Builder routing) { + routing{{#apiInfo}}{{#apis}}{{#operations}} + .register("{{#x-helidon-v3}}/{{/x-helidon-v3}}{{{pathPrefix}}}", new {{classname}}Impl()){{^x-helidon-v3}}{{#x-helidon-fixupPath}}/* {{.}} */{{/x-helidon-fixupPath}}{{/x-helidon-v3}}{{/operations}}{{/apis}}{{/apiInfo}}; + } +{{/x-helidon-v3}} } 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 index 78c4e89b5890..6310fef32eba 100644 --- 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 @@ -1,28 +1,47 @@ package {{invokerPackage}}; import java.util.Collections; -import java.util.concurrent.TimeUnit; +{{#x-helidon-v3}}{{! +}}import java.util.concurrent.TimeUnit; +{{/x-helidon-v3}} import {{rootJavaEEPackage}}.json.Json; import {{rootJavaEEPackage}}.json.JsonBuilderFactory; -import io.helidon.media.jsonp.JsonpSupport; -import io.helidon.webclient.WebClient; +{{#x-helidon-v3}}import io.helidon.media.jsonp.JsonpSupport; +{{/x-helidon-v3}} +{{#x-helidon-v3}}{{! +}}import io.helidon.webclient.WebClient; import io.helidon.webserver.WebServer; +{{/x-helidon-v3}} +{{^x-helidon-v3}}{{! +}}import io.helidon.webclient.http1.Http1Client; +import io.helidon.webserver.http.HttpRouting; +import io.helidon.webserver.testing.junit5.ServerTest; +import io.helidon.webserver.testing.junit5.SetUpRoute; +{{/x-helidon-v3}} -import org.junit.jupiter.api.AfterAll; +{{#x-helidon-v3}}{{! +}}import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; +{{/x-helidon-v3}} import org.junit.jupiter.api.Test; -@Disabled +{{#x-helidon-v3}}@Disabled +{{/x-helidon-v3}} +{{^x-helidon-v3}}@ServerTest +{{/x-helidon-v3}} public class MainTest { - private static WebServer webServer; +{{#x-helidon-v3}}{{! +}} private static WebServer webServer; private static WebClient webClient; +{{/x-helidon-v3}} private static final JsonBuilderFactory JSON_BUILDER = Json.createBuilderFactory(Collections.emptyMap()); - @BeforeAll +{{#x-helidon-v3}}{{! +}} @BeforeAll public static void startTheServer() throws Exception { webServer = Main.startServer().await(); @@ -40,6 +59,23 @@ public class MainTest { .get(10, TimeUnit.SECONDS); } } +{{/x-helidon-v3}}{{! +}}{{^x-helidon-v3}} + + private Http1Client client; + + MainTest(Http1Client client) { + this.client = client; + } + + @SetUpRoute + static void routing(HttpRouting.Builder builder) { + Main.routing(builder); + } + + + +{{/x-helidon-v3}} @Test public void test() throws Exception { diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/opHeaderResultDecl.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/opHeaderResultDecl.mustache new file mode 100644 index 000000000000..681ef49d7d7f --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/opHeaderResultDecl.mustache @@ -0,0 +1,3 @@ +{{! + Declares a field for an operation's header result. +}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/opHelpers.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/opHelpers.mustache new file mode 100644 index 000000000000..e5d6a6e8a84b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/opHelpers.mustache @@ -0,0 +1,187 @@ + /** + * Returns a new instance of the class which handles parameters to and responses from the {{operationId}} operation. + *

+ * Developers can override this method if they extend the {{classname}} class. + *

+ * + * @return new {{#lambda.titlecase}}{{operationId}}{{/lambda.titlecase}} + */ + protected {{#lambda.titlecase}}{{operationId}}Op{{/lambda.titlecase}} create{{#lambda.titlecase}}{{operationId}}Op{{/lambda.titlecase}}() { + return new {{#lambda.titlecase}}{{operationId}}Op{{/lambda.titlecase}}(); + } + +{{! + Declares an inner class for each operation which collects: + * overridable methods for preparing each parameter from the request + * an interface which defines the possible return groups (body or header results and status). +}} + /** + * Helper elements for the {{=<% %>=}}{@code <%operationId%>}<%={{ }}=%> operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class {{#lambda.titlecase}}{{operationId}}Op{{/lambda.titlecase}} { +{{#allParams}} + + /** + * Prepares the {{paramName}} parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter +{{#isFormParameter}}{{^isMultipart}}{{! +}} * @param formParams {@link io.helidon.common.parameters.Parameters} containing all form parameters +{{/isMultipart}}{{/isFormParameter}}{{#vendorExtensions.x-helidon-isMultipartFormParam}}{{! +}} * @param parts {@code Map} of part names to {@link io.helidon.http.media.multipart.ReadablePart} for each part +{{/vendorExtensions.x-helidon-isMultipartFormParam}}{{! +}} * @param validator {@link {{apiPackage}}.ValidatorUtils.Validator} for validating all parameters to the operation + * @return {{paramName}} parameter value + */ + protected {{> paramDeclType }} {{> paramMethodName }}(ServerRequest request, {{#isFormParam}}{{^isMultipart}}Parameters formParams, {{/isMultipart}}{{#isMultipart}}Map parts, {{/isMultipart}}{{/isFormParam}}ValidatorUtils.Validator validator) { + return {{^isBodyParam}}{{> paramValueExpr}}{{/isBodyParam}}{{#isBodyParam}}{{> bodyParamValue }};{{/isBodyParam}} + } +{{/allParams}} +{{#responses}} + + /** + * {{#isDefault}}Default result{{/isDefault}}{{^isDefault}}Response for HTTP status code {{=<% %>=}}{@code <%code%>}<%={{ }}=%>{{/isDefault}}.{{! +}}{{#isDefault}} + * + * @param status (required) Status value to be sent with this default result{{/isDefault}}{{! +}}{{#vendorExtensions.x-helidon-hasResponseProps}}{{! +}}{{^isDefault}} + *{{/isDefault}}{{! +}}{{#vendorExtensions.x-helidon-allResponseProps}} + * @param {{name}} {{#required}}(required) {{/required}}{{description}}{{/vendorExtensions.x-helidon-allResponseProps}}{{/vendorExtensions.x-helidon-hasResponseProps}} + */ + record {{> resultRecordTypeName }}({{#isDefault}}Status status{{#vendorExtensions.x-helidon-hasResponseProps}}, {{/vendorExtensions.x-helidon-hasResponseProps}}{{! +}}{{/isDefault}}{{#vendorExtensions.x-helidon-allResponseProps}}{{^-first}}, + {{/-first}}{{> opResultParamDecl}}{{/vendorExtensions.x-helidon-allResponseProps}}{{! +}}) { + + /** + * Creates a response builder for the {{#isDefault}}default{{/isDefault}}{{^isDefault}}status {{=<% %>=}}{@code <%code%>}<%={{ }}=%>{{/isDefault}} response + * for the {{operationId}} operation{{#x-helidon-hasRequiredResponseProps}}, accepting all the required response values{{/x-helidon-hasRequiredResponseProps}}{{^x-helidon-hasRequiredResponseProps}}; there are no required result values{{/x-helidon-hasRequiredResponseProps}} for this response. + *{{! +}}{{#vendorExtensions.x-helidon-requiredResponseProps}} + * @param {{name}} returned {{#isHeader}}header{{/isHeader}}{{^isHeader}}entity{{/isHeader}}{{/vendorExtensions.x-helidon-requiredResponseProps}} + * @return new builder for status {{code}} + */ + static Builder builder({{#isDefault}}Status status{{#vendorExtensions.x-helidon-hasRequiredResponseProps}}, + {{/vendorExtensions.x-helidon-hasRequiredResponseProps}}{{/isDefault}}{{#vendorExtensions.x-helidon-requiredResponseProps}}{{^-first}}, + {{/-first}}{{> opResultParamDecl }}{{/vendorExtensions.x-helidon-requiredResponseProps}}) { + return new Builder({{#isDefault}}status{{#vendorExtensions.x-helidon-hasRequiredResponseProps}}, + {{/vendorExtensions.x-helidon-hasRequiredResponseProps}}{{/isDefault}}{{#vendorExtensions.x-helidon-requiredResponseProps}}{{^-first}}, + {{/-first}}{{name}}{{/vendorExtensions.x-helidon-requiredResponseProps}}); + } + + /** + * Builder for the {{> resultRecordTypeName}} result. + */ + static class Builder implements io.helidon.common.Builder resultRecordTypeName }}> { +{{#vendorExtensions.x-helidon-allResponseProps}}{{#-first}} +{{/-first}}{{! +}} private {{#required}}final {{/required}}{{> opResultParamDecl }};{{/vendorExtensions.x-helidon-allResponseProps}} +{{#vendorExtensions.x-helidon-resultBuilderNeedsCtor}}{{! +}}{{#isDefault}}{{! +}} private final Status status; +{{/isDefault}} + Builder({{#isDefault}}Status status{{#vendorExtensions.x-helidon-hasRequiredResponseProps}}, + {{/vendorExtensions.x-helidon-hasRequiredResponseProps}}{{/isDefault}}{{#vendorExtensions.x-helidon-requiredResponseProps}}{{^-first}}, + {{/-first}}{{> opResultParamDecl }}{{/vendorExtensions.x-helidon-requiredResponseProps}}) { +{{#isDefault}}{{! +}} this.status = status;{{/isDefault}} +{{#vendorExtensions.x-helidon-requiredResponseProps}}{{! +}} this.{{name}} = {{name}};{{/vendorExtensions.x-helidon-requiredResponseProps}} + } +{{/vendorExtensions.x-helidon-resultBuilderNeedsCtor}} + @Override + public {{> resultRecordTypeName}} build() { + return new {{> resultRecordTypeName}}({{#isDefault}}status{{#vendorExtensions.x-helidon-hasResponseProps}}, + {{/vendorExtensions.x-helidon-hasResponseProps}}{{/isDefault}}{{#vendorExtensions.x-helidon-allResponseProps}}{{^-first}}, + {{/-first}}{{name}}{{/vendorExtensions.x-helidon-allResponseProps}}); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + }{{#vendorExtensions.x-helidon-optionalResponseProps}} + + /** + * Sets the value for the optional return property {{=<% %>=}}{@code <%name%>}<%={{ }}=%>. + * @param {{name}} {{description}} + * @return updated result builder + */ + Builder {{name}}({{> opResultParamDecl }}) { + this.{{name}} = {{name}}; + return this; + }{{/vendorExtensions.x-helidon-optionalResponseProps}} + } +{{! + Suppress the generated constructor if it would duplicate the implied canonical constructor. +}}{{! +}}{{#vendorExtensions.x-helidon-hasRequiredResponseProps}} +{{> opResultRecordCtor }}{{! +}}{{/vendorExtensions.x-helidon-hasRequiredResponseProps}}{{! +}}{{^vendorExtensions.x-helidon-hasRequiredResponseProps}}{{#isDefault}} + {{> opResultRecordCtor }}{{! +}}{{/isDefault}}{{/vendorExtensions.x-helidon-hasRequiredResponseProps}} + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status({{^isDefault}}{{vendorExtensions.x-helidon-resultStatusDecl}}{{/isDefault}}{{#isDefault}}status{{/isDefault}});{{! +}}{{#headers}}{{! +}} if ({{name}} != null) { + _serverResponse.header("{{baseName}}", {{name}}{{^isString}}.toString(){{/isString}}); + }{{/headers}}{{! +}}{{#returnProperty}}{{! +}}{{^required}} + if ({{name}} != null) { {{! +}}{{/required}}{{! +}}{{^isFile}} +{{^required}} {{/required}}{{! +}} _serverResponse.send({{name}});{{! +}}{{^required}} + } else { + _serverResponse.send(); + }{{! +}}{{/required}}{{! +}}{{/isFile}}{{! +}}{{#isFile}} +{{^required}} {{/required}}{{! +}} _serverResponse.contentLength({{name}}.transferTo(_serverResponse.outputStream()));{{! +}}{{^required}} + }{{! +}}{{/required}}{{! +}} _serverResponse.send();{{! +}}{{/isFile}}{{! +}}{{/returnProperty}}{{! +}}{{^dataType}} + _serverResponse.send();{{! +}}{{/dataType}}{{! +}} + } + } +{{/responses}} + } diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/opResultParamDecl.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/opResultParamDecl.mustache new file mode 100644 index 000000000000..23a4bff67ecd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/opResultParamDecl.mustache @@ -0,0 +1,3 @@ +{{! + Declaration (type and name) of a result property. +}}{{^isFile}}{{{dataType}}}{{/isFile}}{{#isFile}}InputStream{{/isFile}} {{name}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/opResultRecordCtor.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/opResultRecordCtor.mustache new file mode 100644 index 000000000000..76ec2924d361 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/opResultRecordCtor.mustache @@ -0,0 +1,24 @@ + /** + * Constructor for a result for the {{#isDefault}}default{{/isDefault}}{{^isDefault}}status {{code}}{{/isDefault}} result + * for the {{operationId}} operation, verifying non-null values for required return data. + *{{! +}}{{#vendorExtensions.x-helidon-allResponseProps}} + * @param {{name}} returned {{#isHeader}}header{{/isHeader}}{{^isHeader}}entity{{/isHeader}}{{/vendorExtensions.x-helidon-allResponseProps}} + */ + public {{> resultRecordTypeName }}({{#isDefault}}Status status{{#vendorExtensions.x-helidon-hasResponseProps}}, {{/vendorExtensions.x-helidon-hasResponseProps}}{{! +}}{{/isDefault}}{{#vendorExtensions.x-helidon-allResponseProps}}{{^-first}}, + {{/-first}}{{> opResultParamDecl }}{{/vendorExtensions.x-helidon-allResponseProps}}) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); +{{#isDefault}} + validator.require("status for default response", status); +{{/isDefault}} +{{#vendorExtensions.x-helidon-requiredResponseProps}} + validator.require("required result {{#isHeader}}header{{/isHeader}}{{^isHeader}}entity{{/isHeader}} {{name}}", {{name}});{{/vendorExtensions.x-helidon-requiredResponseProps}}{{! +}} validator.execute(); +{{#isDefault}} + this.status = status; +{{/isDefault}} +{{#vendorExtensions.x-helidon-allResponseProps}}{{! +}} this.{{name}} = {{name}}; +{{/vendorExtensions.x-helidon-allResponseProps}} + } diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramDecl.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramDecl.mustache new file mode 100644 index 000000000000..fbaa88a49f43 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramDecl.mustache @@ -0,0 +1,10 @@ +{{! + Declares a parameter, including the correct datatype and parameter name. Suitable for declaring a variable or + method parameter. +}}{{#x-helidon-v3}}{{>dataType}} {{paramName}}{{/x-helidon-v3}}{{! + +}}{{^x-helidon-v3}}{{^isBodyParam}}{{! + }}{{> paramDeclType }} {{paramName}}{{! +}}{{/isBodyParam}}{{#isBodyParam}}{{! + }}{{> bodyParamDecl }}{{/isBodyParam}}{{! +}}{{/x-helidon-v3}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramDeclType.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramDeclType.mustache new file mode 100644 index 000000000000..b954234cfe30 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramDeclType.mustache @@ -0,0 +1,14 @@ +{{! + Type declaration of a parameter for v4 and later. + + Non-container parameters declared in the OpenAPI document as not required become Optional; all other declarations + are just the dataType. + +}}{{^x-helidon-v3}}{{! + }}{{^required}}{{^isContainer}}{{#x-helidon-use-optional}}Optional<{{/x-helidon-use-optional}}{{/isContainer}}{{/required}}{{! +}}{{#vendorExtensions.x-helidon-isMultipartFormParam}}ReadablePart{{/vendorExtensions.x-helidon-isMultipartFormParam}}{{! +}}{{^vendorExtensions.x-helidon-isMultipartFormParam}}{{#isFormParam}}{{> formOrBodyParamDeclType }}{{/isFormParam}}{{! +}}{{^isFormParam}}{{#isBodyParam}}{{> formOrBodyParamDeclType }}{{/isBodyParam}}{{^isBodyParam}}{{{dataType}}}{{/isBodyParam}}{{/isFormParam}}{{! +}}{{/vendorExtensions.x-helidon-isMultipartFormParam}}{{! +}}{{^required}}{{^isContainer}}{{#x-helidon-use-optional}}>{{/x-helidon-use-optional}}{{/isContainer}}{{/required}}{{! +}}{{/x-helidon-v3}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramMethodInvocation.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramMethodInvocation.mustache new file mode 100644 index 000000000000..334efee6d0e1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramMethodInvocation.mustache @@ -0,0 +1 @@ +{{operationId}}Op.{{> paramMethodName}}(request, {{^isMultipart}}{{#isFormParam}}formParams, {{/isFormParam}}{{/isMultipart}}{{#vendorExtensions.x-helidon-isMultipartFormParam}}parts, {{/vendorExtensions.x-helidon-isMultipartFormParam}}validator) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramMethodName.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramMethodName.mustache new file mode 100644 index 000000000000..1adee60e5f89 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramMethodName.mustache @@ -0,0 +1 @@ +{{paramName}} \ No newline at end of file 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 index 52ad10dd603a..ff39de4c9f69 100644 --- 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 @@ -1,4 +1,5 @@ -{{#isPathParam}}Optional.ofNullable(request.path().param("{{baseName}}")){{/isPathParam}}{{! +{{#x-helidon-v3}}{{! +}}{{#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}}{{! @@ -11,4 +12,7 @@ }}{{#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 +}}.orElse(null); +{{/x-helidon-v3}}{{! +}}{{^x-helidon-v3}}{{> paramMethodInvocation }}; +{{/x-helidon-v3}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValueAs.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValueAs.mustache new file mode 100644 index 000000000000..3961e59a3845 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValueAs.mustache @@ -0,0 +1,5 @@ +{{#isContainer}}GenericTypes.TYPE__{{containerTypeMapped}}_{{baseType}}{{/isContainer}}{{! +}}{{^isContainer}}{{! + }}{{#isFormParam}}{{^isMultipart}}Parameters.class{{/isMultipart}}{{#isMultipart}}{{{dataType}}}.class{{/isMultipart}}{{/isFormParam}}{{! + }}{{^isFormParam}}{{{dataType}}}.class{{/isFormParam}}{{! +}}{{/isContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValueAsSuffix.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValueAsSuffix.mustache new file mode 100644 index 000000000000..8f6dbc256132 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValueAsSuffix.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValueConverter.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValueConverter.mustache new file mode 100644 index 000000000000..877eaaa65448 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValueConverter.mustache @@ -0,0 +1,14 @@ +{{^vendorExtensions.x-helidon-hasEnumClass}}{{! +}}{{^isString}}{{#isDecimal}}BigDecimal::new{{/isDecimal}}{{! +}}{{#isNumber}}BigDecimal::new{{/isNumber}}{{! +}}{{#isDate}}LocalDate::parse{{/isDate}}{{#isDateTime}}OffsetDateTime::parse{{/isDateTime}}{{! +}}{{#isByteArray}}HexFormat.of()::parseHex{{/isByteArray}}{{! +}}{{^isDecimal}}{{^isNumber}}{{^isDate}}{{^isDateTime}}{{^isByteArray}}{{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{{dataType}}}{{/isContainer}}::valueOf{{/isByteArray}}{{/isDateTime}}{{/isDate}}{{/isNumber}}{{/isDecimal}}{{/isString}}{{! +}}{{#isString}}String::valueOf{{/isString}}{{! +}}{{/vendorExtensions.x-helidon-hasEnumClass}}{{! +}}{{! + + Some enums are specified using a $ref to a type; to those the code adds the x-helidon-hasEnumClass boolean set to true. + Others are described in-line in the OpenAPI document and those do not have x-helidon-hasEnumClass. + +}}{{#vendorExtensions.x-helidon-hasEnumClass}}{{baseType}}::fromValue{{/vendorExtensions.x-helidon-hasEnumClass}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValueExpr.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValueExpr.mustache new file mode 100644 index 000000000000..e7f797d33b28 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramValueExpr.mustache @@ -0,0 +1,69 @@ +{{^x-helidon-v3}}{{! + + Most non-body parameter values are handled largely the same regardless of their origin (path, query, cookie, header). + Wrap a single-valued parameter in an Optional only if it is NOT declared as required; otherwise insist that it be present. + + The Helidon 4 API exposes path, query, and cookie values as Value objects but header values as Strings, so deal with + them slightly differently. +}}{{#vendorExtensions.x-helidon-isMultipartFormParam}}{{^required}}{{^isContainer}}Optional.ofNullable({{/isContainer}}{{/required}}parts.get("{{baseName}}"){{^required}}{{^isContainer}}){{/isContainer}}{{/required}}{{! +}}{{/vendorExtensions.x-helidon-isMultipartFormParam}}{{! +}}{{^vendorExtensions.x-helidon-isMultipartFormParam}}{{^isFormParam}}request{{/isFormParam}}{{! +}}{{#isFormParam}}formParams{{/isFormParam}}{{! +}}{{#isPathParam}}.path() + .pathParameters(){{! +}}{{/isPathParam}}{{! +}}{{#isQueryParam}}.query(){{! +}}{{/isQueryParam}}{{! +}}{{#isCookieParam}}.headers() + .cookies(){{! +}}{{/isCookieParam}}{{! +}}{{#isHeaderParam}}.headers(){{! +}}{{/isHeaderParam}}{{! + We have generated code to access the object from which we'll get either the first value or all the values given a name. + Headers use "values" which accepts a HeaderName while the other objects use "all" which accepts a String to gather all of + potentially multiple values. All types use "first" to retrieve only the first value with the name. +}}{{#isContainer}}{{! +}}{{#isHeaderParam}} + .values(HeaderNames.create("{{baseName}}")){{! +}}{{/isHeaderParam}}{{! +}}{{^isHeaderParam}} + .all("{{baseName}}"){{! +}}{{/isHeaderParam}} + .stream(){{! +}}{{/isContainer}}{{! +}}{{^isContainer}} + .first({{#isHeaderParam}}HeaderNames.create({{/isHeaderParam}}"{{baseName}}"{{#isHeaderParam}}){{/isHeaderParam}}){{! +}}{{^isHeaderParam}} + .asOptional(){{/isHeaderParam}}{{! +}}{{#defaultValue}} + .or(() -> Optional.of("{{defaultValue}}")){{/defaultValue}}{{! +}}{{/isContainer}}{{! +}}{{^isFile}}{{^isString}} + .map({{>paramValueConverter}}){{! +}}{{/isString}}{{/isFile}}{{! +}}{{#isFormParam}}{{#isFile}} + .map(HCollectors::decodeBinaryFormParam){{/isFile}}{{/isFormParam}}{{! +}}{{^vendorExtensions.x-helidon-hasEnumClass}}{{#isEnum}} + .map(v -> validator.check("{{baseName}}", + v, + List.of({{#allowableValues}}{{#enumVars}}{{^-first}}, + {{/-first}}{{{value}}}{{/enumVars}}{{/allowableValues}}))){{! +}}{{/isEnum}}{{/vendorExtensions.x-helidon-hasEnumClass}}{{! +}}{{#required}}{{^isContainer}}{{! + We use orElse(null) here even if there is a default value that was applied (in string form) above. This allows us to plug + in the default value earlier, as a string, before any conversion to the desired datatype, so we do not have to also convert + the default value if we wanted to use it in the orElse. +}} + .orElse(null){{/isContainer}}{{/required}}{{! +}}{{#isContainer}}{{! +}}{{#defaultValue}} + .collect(HCollectors.toDefaultedList("{{defaultValue}}", + {{>paramValueConverter}})){{! +}}{{/defaultValue}}{{^defaultValue}}{{^isMap}} + .collect(Collectors.to{{containerTypeMapped}}()){{/isMap}}{{! +}}{{#isMap}} + // TODO - Developer must override this method and provide the correct mapping. + .collect(HCollectors.noOpMap()){{/isMap}}{{! +}}{{/defaultValue}}{{! +}}{{/isContainer}}{{/vendorExtensions.x-helidon-isMultipartFormParam}};{{! +}}{{/x-helidon-v3}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramsFinal.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramsFinal.mustache new file mode 100644 index 000000000000..b7b4fcc9dca1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramsFinal.mustache @@ -0,0 +1,3 @@ +{{^x-helidon-v3}}{{#hasParams}}validator.execute(); + +{{/hasParams}}{{/x-helidon-v3}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramsInitial.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramsInitial.mustache new file mode 100644 index 000000000000..41b995792f37 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/paramsInitial.mustache @@ -0,0 +1,9 @@ +{{^x-helidon-v3}}{{#hasParams}} + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); +{{/hasParams}}{{^hasParams}} + +{{/hasParams}}{{/x-helidon-v3}}{{! +}}{{#hasFormParams}} + {{> formParamsInitial }}{{/hasFormParams}}{{! +}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/partsUtils.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/partsUtils.mustache new file mode 100644 index 000000000000..dd9bdff31df4 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/partsUtils.mustache @@ -0,0 +1,92 @@ +{{! + For v4 and later. +}} +package {{apiPackage}}; + +import java.io.IOException; +import java.io.File; +import java.io.InputStream; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Optional; + +import io.helidon.common.GenericType; +import io.helidon.http.media.multipart.MultiPart; +import io.helidon.http.media.multipart.ReadablePart; +import io.helidon.webserver.http.ServerRequest; + +@io.helidon.common.Generated(value = "{{additionalProperties.generatorClass}}", + trigger = "utility", + version = "{{generatorVersion}}") +class PartsUtils { + + private final Map parts = new LinkedHashMap<>(); + + static Map partsMap(ServerRequest request) { + Map parts = new LinkedHashMap<>(); + request.content().as(MultiPart.class).forEachRemaining(part -> parts.put(part.name(), part)); + return parts; + } + + static PartsUtils create(ServerRequest request) { + return new PartsUtils(request); + } + + private PartsUtils(ServerRequest request) { + request.content().as(MultiPart.class).forEachRemaining(part -> parts.put(part.name(), part)); + } + + T part(String partName, Class type, T defaultValue) { + ReadablePart part = parts.get(partName); + if (part == null) { + return defaultValue; + } + return part.as(type); + } + + Optional partOpt(String partName, Class type, T defaultValue) { + return Optional.ofNullable(part(partName, type, defaultValue)); + } + + T part(String partName, GenericType type, T defaultValue) { + ReadablePart part = parts.get(partName); + if (part == null) { + return defaultValue; + } + return part.as(type); + } + + Optional partOpt(String partName, GenericType type, T defaultValue) { + return Optional.ofNullable(part(partName, type, defaultValue)); + } + + InputStream inputStreamPart(String partName) { + ReadablePart part = parts.get(partName); + if (part == null) { + return null; + } + return part.inputStream(); + } + + Optional inputStreamPartOpt(String partName) { + return Optional.ofNullable(inputStreamPart(partName)); + } + + File filePart(String partName, Path directory) { + ReadablePart part = parts.get(partName); + if (part == null) { + return null; + } + try (InputStream inputStream = part.inputStream()) { + Path path = directory.resolve(part.fileName().orElse(partName)); + inputStream.transferTo(Files.newOutputStream(path, StandardOpenOption.CREATE_NEW)); + return path.toFile(); + } catch (IOException ex) { + throw new UncheckedIOException(ex); + } + } +} 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 index 14464296f11d..2dc61249dc5c 100644 --- 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 @@ -1,2 +1,2 @@ -{{#isPathParam}}{{> dataType }} {{paramName}} = {{> paramValue }}{{#useBeanValidation}} - {{>beanValidationPathParams}}{{/useBeanValidation}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{> paramDecl }} = {{> paramValue }}{{#useBeanValidation}} + {{#x-helidon-v3}} {{/x-helidon-v3}}{{>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 index abc5e56ca789..13cc9493f30d 100644 --- 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 @@ -43,7 +43,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens // JSON-B / Jackson } - /** +{{#hasVars}} /** * Create {{classname}}. * {{#vars}} @@ -58,7 +58,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{#vars}} this.{{name}} = {{name}}; {{/vars}} - } + }{{/hasVars}} {{#vars}}{{#vendorExtensions.x-has-readonly-properties}}{{#jsonb}} @JsonbCreator 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 index 0425ee16e957..0e36257e5111 100644 --- 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 @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 io.helidon.applications @@ -34,17 +34,31 @@ helidon-webserver - io.helidon.media - helidon-media-jsonp + io.helidon.{{^x-helidon-v3}}http.{{/x-helidon-v3}}media + helidon-{{^x-helidon-v3}}http-{{/x-helidon-v3}}media-jsonp - +{{^x-helidon-v3}}{{! +}} + io.helidon.http.media + helidon-http-media-multipart + +{{/x-helidon-v3}}{{! +}}{{#x-helidon-v3}}{{! +}} io.helidon.media helidon-media-multipart - +{{/x-helidon-v3}}{{! +}} io.helidon.config helidon-config-yaml + {{^x-helidon-v3}} + + io.helidon.webserver.observe + helidon-webserver-observe-health + + {{/x-helidon-v3}} io.helidon.health helidon-health @@ -53,10 +67,28 @@ io.helidon.health helidon-health-checks + {{^x-helidon-v3}} + + io.helidon.webserver.observe + helidon-webserver-observe-metrics + + + io.helidon.metrics + helidon-metrics-system-meters + runtime + + + io.helidon.logging + helidon-logging-jul + runtime + + {{/x-helidon-v3}} + {{#x-helidon-v3}} io.helidon.metrics helidon-metrics + {{/x-helidon-v3}} io.helidon.openapi helidon-openapi @@ -70,15 +102,14 @@ {{/openApiNullable}} {{#jackson}} - io.helidon.media - helidon-media-jackson + io.helidon.{{^x-helidon-v3}}http.{{/x-helidon-v3}}media + helidon-{{^x-helidon-v3}}http-{{/x-helidon-v3}}media-jackson {{/jackson}} {{#jsonb}} - io.helidon.media - helidon-media-jsonb - ${helidon.version} + io.helidon.{{#x-helidon-v3}}http.{{/x-helidon-v3}}media + helidon-{{#x-helidon-v3}}http-{{/x-helidon-v3}}media-jsonb {{/jsonb}} @@ -91,6 +122,13 @@ helidon-webclient test +{{^x-helidon-v3}} + + io.helidon.webserver.testing.junit5 + helidon-webserver-testing-junit5 + test + +{{/x-helidon-v3}} 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 index 6b2769645186..cdfce1e1d1eb 100644 --- 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 @@ -1 +1 @@ -{{#isQueryParam}}{{>dataType}} {{paramName}} = {{>paramValue}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{>paramDecl}} = {{>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/resultRecordTypeName.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/resultRecordTypeName.mustache new file mode 100644 index 000000000000..0b7fe46cfc53 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/se/resultRecordTypeName.mustache @@ -0,0 +1,3 @@ +{{! + Compute the record type for a result. +}}{{^isDefault}}Response{{code}}{{/isDefault}}{{#isDefault}}Default{{/isDefault}} \ 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 index 323407d0c142..ee4baa916d90 100644 --- 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 @@ -3,8 +3,19 @@ package {{apiPackage}}; import java.lang.reflect.Array; import java.math.BigDecimal; import java.util.Collection; +{{^x-helidon-v3}} +import java.util.List; +{{/x-helidon-v3}} import java.util.Map; import java.util.Objects; +{{^x-helidon-v3}} +import java.util.Optional; + +import io.helidon.common.Errors; +import io.helidon.common.mapper.OptionalValue; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +{{/x-helidon-v3}} import {{rootJavaEEPackage}}.validation.ValidationException; @@ -109,4 +120,301 @@ public final class ValidatorUtils { throw new ValidationException(e); } } -} \ No newline at end of file +{{^x-helidon-v3}}{{! +}} + public static T nonEmpty(T arg) { + try { + return Objects.requireNonNull(arg, "Required value is missing"); + } catch (NullPointerException npe) { + throw new ValidationException(npe); + } + } + + public static T nonEmpty(Optional opt) { + if (opt.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return opt.get(); + } + + public static T nonEmpty(OptionalValue ov) { + if (ov.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return ov.get(); + } + + public static > M nonEmpty(M map) { + if (map.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return map; + } + + public static > C nonEmpty(C coll) { + if (coll.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return coll; + } + + static Validator validator() { + return new Validator(); + } + + public static class Validator { + + private final Errors.Collector errorsCollector = Errors.collector(); + + T check(String paramName, T paramValue, List validValues) { + if (!validValues.contains(paramValue)) { + errorsCollector.fatal(String.format("Invalid value %s = '%s' not among %s", + paramName, + paramValue, + validValues)); + } + return paramValue; + } + + T require(String paramName, T paramValue) { + if (paramValue == null || ((paramValue instanceof Optional opt) && opt.isEmpty())) { + errorsCollector.fatal(String.format("Missing required param: %s", paramName)); + } + return paramValue; + } + + List require(String paramName, List paramValues) { + if (paramValues.isEmpty()) { + errorsCollector.fatal(String.format("Empty required parameter: %s", paramName)); + } + return paramValues; + } + + T require(String paramName, Optional optionalValue) { + if (optionalValue.isEmpty()) { + errorsCollector.fatal(String.format("Empty required parameter: %s", paramName)); + } + return optionalValue.orElse(null); + } + + boolean validateMin(String paramName, Long value, Long min, boolean isExclusive) { + boolean result = value == null || value > min || !isExclusive && value.equals(min); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %d violates %sminimum %d", + paramName, + value, + isExclusive ? "exclusive " : "", + min)); + } + return result; + } + + boolean validateMin(String paramName, Optional value, Long min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Integer value, Integer min, boolean isExclusive) { + return validateMin(paramName, Long.valueOf(value), Long.valueOf(min), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Integer min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Short value, Short min, boolean isExclusive) { + return validateMin(paramName, value.intValue(), min.intValue(), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Short min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Byte value, Byte min, boolean isExclusive) { + return validateMin(paramName, value.intValue(), min.intValue(), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Byte min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Double value, Double min, boolean isExclusive) { + return validateMin(paramName, new BigDecimal(value), new BigDecimal(min), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Double min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Float value, Float min, boolean isExclusive) { + boolean result = value == null || value.compareTo(min) > 0 || isExclusive && value.equals(min); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %sminimum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + min)); + } + return result; + } + + boolean validateMin(String paramName, Optional value, Float min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, BigDecimal value, String min, boolean isExclusive) { + return validateMin(paramName, value, new BigDecimal(min), isExclusive); + } + + boolean validateMin(String paramName, BigDecimal value, BigDecimal min, boolean isExclusive) { + boolean result = value == null || value.compareTo(min) > 0 || !isExclusive && value.equals(min); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %sminimum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + min)); + } + return result; + } + + boolean validateMin(String paramName, Optional value, String min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMax(String paramName, Long value, Long max, boolean isExclusive) { + boolean result = value == null || value < max || !isExclusive && value.equals(max); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %d violates %smaximum %d", + paramName, + value, + isExclusive ? "exclusive " : "", + max)); + } + return result; + } + + boolean validateMax(String paramName, Optional value, Long max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Integer value, Integer max, boolean isExclusive) { + return validateMax(paramName, Long.valueOf(value), Long.valueOf(max), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Integer max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Short value, Short max, boolean isExclusive) { + return validateMax(paramName, value.intValue(), max.intValue(), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Short max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Byte value, Byte max, boolean isExclusive) { + return validateMax(paramName, value.intValue(), max.intValue(), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Byte max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Double value, Double max, boolean isExclusive) { + return validateMax(paramName, new BigDecimal(value), new BigDecimal(max), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Double max, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Float value, Float max, boolean isExclusive) { + boolean result = value == null || value.compareTo(max) < 0 || isExclusive && value.equals(max); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %smaximum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + max)); + } + return result; + } + + boolean validateMax(String paramName, Optional value, Float max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, BigDecimal value, String max, boolean isExclusive) { + return validateMax(paramName, value, new BigDecimal(max), isExclusive); + } + + boolean validateMax(String paramName, BigDecimal value, BigDecimal max, boolean isExclusive) { + boolean result = value == null || value.compareTo(max) < 0 || !isExclusive && value.equals(max); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %smaximum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + max)); + } + return result; + } + + boolean validateMax(String paramName, Optional value, String max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validatePattern(String paramName, String value, String pattern) { + boolean result = value == null || value.matches(pattern); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s '%s' does not match pattern '%s'", + paramName, + value, + pattern)); + } + return result; + } + + boolean validatePattern(String paramName, Optional value, String pattern) { + return value.isEmpty() || validatePattern(pattern, value.get(), pattern); + } + + boolean validateSize(String paramName, Object value, Integer min, Integer max) { + if (value == null) { + return true; + } + int size = switch (value) { + case Map map -> map.size(); + case CharSequence cs -> cs.length(); + case Collection coll -> coll.size(); + default -> value.getClass().isArray() ? Array.getLength(value) : -1; + }; + if (size == -1) { + errorsCollector.fatal(String.format("Parameter %s with type %s unrecognized for validating size", + paramName, + value.getClass().getName())); + return false; + } + if (min != null) { + validateMin(paramName, size, min, false); + } + if (max != null) { + validateMax(paramName, size, max, false); + } + return true; + } + + boolean validateSize(String paramName, Optional value, Integer min, Integer max) { + return value.isEmpty() || validateSize(paramName, value.get(), min, max); + } + + void execute() { + Errors errors = errorsCollector.collect(); + if (errors.hasFatal()) { + throw new ValidationException("Validation errors: " + errors); + } + } + } +} +{{/x-helidon-v3}}{{#x-helidon-v3}}}{{/x-helidon-v3}} \ No newline at end of file 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 index cd238eb6615c..24a86c58dd5f 100644 --- a/modules/openapi-generator/src/main/resources/java-helidon/server/logging.mustache +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/logging.mustache @@ -3,10 +3,13 @@ # For more information see $JAVA_HOME/jre/lib/logging.properties # Send messages to the console -handlers=io.helidon.common.HelidonConsoleHandler +{{#x-helidon-v3}}handlers=io.helidon.common.HelidonConsoleHandler +{{/x-helidon-v3}}{{^x-helidon-v3}}handlers=java.util.logging.ConsoleHandler +{{/x-helidon-v3}} -# 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 +{{#x-helidon-v3}}# HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread +{{/x-helidon-v3}}{{! +}}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 diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/HelidonCommonCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/HelidonCommonCodegenTest.java index 09f1dabd8624..32e487e85434 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/HelidonCommonCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/languages/HelidonCommonCodegenTest.java @@ -38,4 +38,14 @@ public class HelidonCommonCodegenTest { assertThat(test.chooseVersion("1.2.2", List.of("3.2.1", "3.2.0", "2.0.4", "1.2.3", "1.2.2", "1.1.0"))) .isEqualTo("1.2.2"); } + + @Test + void testVersionNotInDefaultListWithNoNetwork() { + // Simulate a network failure so the full list of valid versions is inaccessible and the user selects a version + // that is not in the cached values or the hard-coded list. + assertThat(test.chooseVersion("4.0.8", List.of("1.2.3", "2.5.6", "3.2.7", "4.0.9"))) + .isEqualTo("4.0.8"); + } + + } diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index c2a678cc0f0d..a7487dbee6df 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; @@ -26,6 +24,8 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; /** * OpenAPI Petstore diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/DefaultApi.java index a53eaf73dafc..8b0960a6cf8c 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/FakeApi.java index 717ed9436919..fda6b183e193 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/FakeApi.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; @@ -33,7 +31,9 @@ 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; diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index aaeb4a55e40e..7087d3d3feeb 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; @@ -26,6 +24,8 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; /** * OpenAPI Petstore diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/PetApi.java index 0248f2e6912b..e70db50695c1 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/PetApi.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; @@ -26,6 +24,8 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; 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; diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/StoreApi.java index b6f3f383a4d2..0cd5575da51d 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/StoreApi.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; @@ -25,6 +23,8 @@ import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import java.util.List; +import java.util.Map; import org.openapitools.client.model.Order; /** diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/UserApi.java index 48e64286d877..aafebd981867 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/main/java/org/openapitools/client/api/UserApi.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; @@ -25,6 +23,8 @@ import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import java.util.List; +import java.util.Map; import java.time.OffsetDateTime; import org.openapitools.client.model.User; diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index ce1d8264fb55..3eaac5b8dc4a 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -14,6 +14,8 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java index 1a717f22c910..f79f958ddc6b 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -21,7 +21,9 @@ 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; diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index bc5ecc084035..0c3bc1a74491 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -14,6 +14,8 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/PetApiTest.java index 66959d421f7c..d46f8200a121 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -14,6 +14,8 @@ 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; diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java index f9a8bd7ab11b..8ed276477e4f 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.api; +import java.util.List; +import java.util.Map; import org.openapitools.client.model.Order; import org.junit.jupiter.api.BeforeAll; diff --git a/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/UserApiTest.java index dfbfc41d41b7..7fe05d5067a7 100644 --- a/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java-helidon-client/v3/mp/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.api; +import java.util.List; +import java.util.Map; import java.time.OffsetDateTime; import org.openapitools.client.model.User; diff --git a/samples/client/petstore/java-helidon-client/v4/mp/pom.xml b/samples/client/petstore/java-helidon-client/v4/mp/pom.xml index f9d8a53e5a65..9199e0eff464 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/pom.xml +++ b/samples/client/petstore/java-helidon-client/v4/mp/pom.xml @@ -6,7 +6,7 @@ io.helidon.applications helidon-mp - 4.0.8 + 4.0.11 petstore-helidon-client-mp diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index c2a678cc0f0d..a7487dbee6df 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; @@ -26,6 +24,8 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; /** * OpenAPI Petstore diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/DefaultApi.java index a53eaf73dafc..8b0960a6cf8c 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeApi.java index 717ed9436919..62cc34c3e484 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeApi.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; @@ -33,8 +31,11 @@ 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 java.util.Optional; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index aaeb4a55e40e..7087d3d3feeb 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; @@ -26,6 +24,8 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; /** * OpenAPI Petstore diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/PetApi.java index 0248f2e6912b..04d31a358118 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/PetApi.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; @@ -26,7 +24,10 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; import java.io.File; +import java.util.List; +import java.util.Map; import org.openapitools.client.model.ModelApiResponse; +import java.util.Optional; import org.openapitools.client.model.Pet; import java.util.Set; diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/StoreApi.java index b6f3f383a4d2..0cd5575da51d 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/StoreApi.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; @@ -25,6 +23,8 @@ import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import java.util.List; +import java.util.Map; import org.openapitools.client.model.Order; /** diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/UserApi.java index 48e64286d877..5c698e54050b 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/main/java/org/openapitools/client/api/UserApi.java @@ -14,8 +14,6 @@ import java.io.InputStream; import java.io.OutputStream; -import java.util.List; -import java.util.Map; import java.util.Set; import jakarta.ws.rs.*; @@ -25,7 +23,10 @@ import org.eclipse.microprofile.rest.client.annotation.RegisterProvider; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import java.util.List; +import java.util.Map; import java.time.OffsetDateTime; +import java.util.Optional; import org.openapitools.client.model.User; /** diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index ce1d8264fb55..3eaac5b8dc4a 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -14,6 +14,8 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java index 1a717f22c910..03f7519e1129 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -21,8 +21,11 @@ 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 java.util.Optional; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterObjectWithEnumProperty; import org.openapitools.client.model.Pet; diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index bc5ecc084035..0c3bc1a74491 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -14,6 +14,8 @@ package org.openapitools.client.api; import org.openapitools.client.model.Client; +import java.util.List; +import java.util.Map; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/PetApiTest.java index 66959d421f7c..1cb0ee19384d 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -14,7 +14,10 @@ package org.openapitools.client.api; import java.io.File; +import java.util.List; +import java.util.Map; import org.openapitools.client.model.ModelApiResponse; +import java.util.Optional; import org.openapitools.client.model.Pet; import java.util.Set; diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java index f9a8bd7ab11b..8ed276477e4f 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.api; +import java.util.List; +import java.util.Map; import org.openapitools.client.model.Order; import org.junit.jupiter.api.BeforeAll; diff --git a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/UserApiTest.java index dfbfc41d41b7..c43ee444205e 100644 --- a/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java-helidon-client/v4/mp/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -13,7 +13,10 @@ package org.openapitools.client.api; +import java.util.List; +import java.util.Map; import java.time.OffsetDateTime; +import java.util.Optional; import org.openapitools.client.model.User; import org.junit.jupiter.api.BeforeAll; diff --git a/samples/client/petstore/java-helidon-client/v4/se/.openapi-generator-ignore b/samples/client/petstore/java-helidon-client/v4/se/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/.openapi-generator/FILES b/samples/client/petstore/java-helidon-client/v4/se/.openapi-generator/FILES new file mode 100644 index 000000000000..29efd849bdd4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/.openapi-generator/FILES @@ -0,0 +1,129 @@ +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/Category.md +docs/ChildWithNullable.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeBigDecimalMap200Response.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/ParentWithNullable.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/SingleRefType.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.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/Category.java +src/main/java/org/openapitools/client/model/ChildWithNullable.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/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/FakeBigDecimalMap200Response.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/ParentWithNullable.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/TestInlineFreeformAdditionalPropertiesRequest.java +src/main/java/org/openapitools/client/model/User.java diff --git a/samples/client/petstore/java-helidon-client/v4/se/.openapi-generator/VERSION b/samples/client/petstore/java-helidon-client/v4/se/.openapi-generator/VERSION new file mode 100644 index 000000000000..6116b14d2c59 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/client/petstore/java-helidon-client/v4/se/README.md b/samples/client/petstore/java-helidon-client/v4/se/README.md new file mode 100644 index 000000000000..4f5205c68135 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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 associated +`WebClientClient.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 `WebClientConfig.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/v4/se/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java-helidon-client/v4/se/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..fe69a56eebf4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/AllOfWithSingleRef.md b/samples/client/petstore/java-helidon-client/v4/se/docs/AllOfWithSingleRef.md new file mode 100644 index 000000000000..4146d56a372b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/docs/AllOfWithSingleRef.md @@ -0,0 +1,14 @@ + + +# AllOfWithSingleRef + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**username** | **String** | | [optional] | +|**singleRefType** | **SingleRefType** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/se/docs/Animal.md b/samples/client/petstore/java-helidon-client/v4/se/docs/Animal.md new file mode 100644 index 000000000000..d9b32f14c88a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/AnotherFakeApi.md b/samples/client/petstore/java-helidon-client/v4/se/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..73c966d2d549 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java-helidon-client/v4/se/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..0188db3eb131 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java-helidon-client/v4/se/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..a5753530aada --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/ArrayTest.md b/samples/client/petstore/java-helidon-client/v4/se/docs/ArrayTest.md new file mode 100644 index 000000000000..36077c9df300 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/Capitalization.md b/samples/client/petstore/java-helidon-client/v4/se/docs/Capitalization.md new file mode 100644 index 000000000000..82a812711de2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/Cat.md b/samples/client/petstore/java-helidon-client/v4/se/docs/Cat.md new file mode 100644 index 000000000000..390dd519c8ce --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/Category.md b/samples/client/petstore/java-helidon-client/v4/se/docs/Category.md new file mode 100644 index 000000000000..ab6d1ec334dc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/ChildWithNullable.md b/samples/client/petstore/java-helidon-client/v4/se/docs/ChildWithNullable.md new file mode 100644 index 000000000000..73c0dd6d4737 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/docs/ChildWithNullable.md @@ -0,0 +1,13 @@ + + +# ChildWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**otherProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/se/docs/ClassModel.md b/samples/client/petstore/java-helidon-client/v4/se/docs/ClassModel.md new file mode 100644 index 000000000000..af46dea1f6c8 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/Client.md b/samples/client/petstore/java-helidon-client/v4/se/docs/Client.md new file mode 100644 index 000000000000..ef07b4ab8b9d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/DefaultApi.md b/samples/client/petstore/java-helidon-client/v4/se/docs/DefaultApi.md new file mode 100644 index 000000000000..2c56e1f90e54 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/DeprecatedObject.md b/samples/client/petstore/java-helidon-client/v4/se/docs/DeprecatedObject.md new file mode 100644 index 000000000000..48de1d624425 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/Dog.md b/samples/client/petstore/java-helidon-client/v4/se/docs/Dog.md new file mode 100644 index 000000000000..972c981c0d05 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/EnumArrays.md b/samples/client/petstore/java-helidon-client/v4/se/docs/EnumArrays.md new file mode 100644 index 000000000000..b2222d5beb25 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/EnumClass.md b/samples/client/petstore/java-helidon-client/v4/se/docs/EnumClass.md new file mode 100644 index 000000000000..b314590a7591 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/EnumTest.md b/samples/client/petstore/java-helidon-client/v4/se/docs/EnumTest.md new file mode 100644 index 000000000000..380a2aef0bc3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/FakeApi.md b/samples/client/petstore/java-helidon-client/v4/se/docs/FakeApi.md new file mode 100644 index 000000000000..37a949ea0508 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/docs/FakeApi.md @@ -0,0 +1,1541 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | | +| [**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 | | +| [**testAdditionalPropertiesReference**](FakeApi.md#testAdditionalPropertiesReference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**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 | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testInlineFreeformAdditionalProperties) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | +| [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data | +| [**testNullable**](FakeApi.md#testNullable) | **POST** /fake/nullable | test nullable parent property | +| [**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | | +| [**testStringMapReference**](FakeApi.md#testStringMapReference) | **POST** /fake/stringMap-reference | test referenced string map | + + + +## fakeBigDecimalMap + +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### 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 { + FakeBigDecimalMap200Response result = apiInstance.fakeBigDecimalMap(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeBigDecimalMap"); + 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 + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## 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) | - | + + +## testAdditionalPropertiesReference + +> testAdditionalPropertiesReference(requestBody) + +test referenced 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 = null; // Map | request body + try { + apiInstance.testAdditionalPropertiesReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testAdditionalPropertiesReference"); + 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, Object>**](Object.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 | - | + + +## 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** | Something 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 | - | + + +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form 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); + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body + try { + apiInstance.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineFreeformAdditionalProperties"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [**TestInlineFreeformAdditionalPropertiesRequest**](TestInlineFreeformAdditionalPropertiesRequest.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 | - | + + +## testNullable + +> testNullable(childWithNullable) + +test nullable parent property + + + +### 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); + ChildWithNullable childWithNullable = new ChildWithNullable(); // ChildWithNullable | request body + try { + apiInstance.testNullable(childWithNullable); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testNullable"); + 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 | +|------------- | ------------- | ------------- | -------------| +| **childWithNullable** | [**ChildWithNullable**](ChildWithNullable.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 | - | + + +## 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 | - | + + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### 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.testStringMapReference(requestBody); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testStringMapReference"); + 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 | - | + diff --git a/samples/client/petstore/java-helidon-client/v4/se/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/java-helidon-client/v4/se/docs/FakeBigDecimalMap200Response.md new file mode 100644 index 000000000000..475be1d2d738 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/docs/FakeBigDecimalMap200Response.md @@ -0,0 +1,14 @@ + + +# FakeBigDecimalMap200Response + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someId** | **BigDecimal** | | [optional] | +|**someMap** | **Map<String, BigDecimal>** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/se/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java-helidon-client/v4/se/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..e4ff70ed909b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/FileSchemaTestClass.md b/samples/client/petstore/java-helidon-client/v4/se/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..85d1a0636694 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/Foo.md b/samples/client/petstore/java-helidon-client/v4/se/docs/Foo.md new file mode 100644 index 000000000000..6b3f0556528a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/FooGetDefaultResponse.md b/samples/client/petstore/java-helidon-client/v4/se/docs/FooGetDefaultResponse.md new file mode 100644 index 000000000000..ff3d7a3a56c3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/FormatTest.md b/samples/client/petstore/java-helidon-client/v4/se/docs/FormatTest.md new file mode 100644 index 000000000000..01b8c777ae06 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/HasOnlyReadOnly.md b/samples/client/petstore/java-helidon-client/v4/se/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..29da5205dbba --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/HealthCheckResult.md b/samples/client/petstore/java-helidon-client/v4/se/docs/HealthCheckResult.md new file mode 100644 index 000000000000..4885e6f1cada --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/MapTest.md b/samples/client/petstore/java-helidon-client/v4/se/docs/MapTest.md new file mode 100644 index 000000000000..54380188e1d6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java-helidon-client/v4/se/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..a5ddf0faa6a9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/Model200Response.md b/samples/client/petstore/java-helidon-client/v4/se/docs/Model200Response.md new file mode 100644 index 000000000000..109411580c62 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/ModelApiResponse.md b/samples/client/petstore/java-helidon-client/v4/se/docs/ModelApiResponse.md new file mode 100644 index 000000000000..e374c2dd2dec --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/ModelFile.md b/samples/client/petstore/java-helidon-client/v4/se/docs/ModelFile.md new file mode 100644 index 000000000000..adcde984f527 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/ModelList.md b/samples/client/petstore/java-helidon-client/v4/se/docs/ModelList.md new file mode 100644 index 000000000000..f93ab7dde8d4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/ModelReturn.md b/samples/client/petstore/java-helidon-client/v4/se/docs/ModelReturn.md new file mode 100644 index 000000000000..0bd356861eb7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/Name.md b/samples/client/petstore/java-helidon-client/v4/se/docs/Name.md new file mode 100644 index 000000000000..c901d9435309 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/NullableClass.md b/samples/client/petstore/java-helidon-client/v4/se/docs/NullableClass.md new file mode 100644 index 000000000000..fa98c5c6d984 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/NumberOnly.md b/samples/client/petstore/java-helidon-client/v4/se/docs/NumberOnly.md new file mode 100644 index 000000000000..b8ed1a4cfae1 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/java-helidon-client/v4/se/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..f1cf571f4c09 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/Order.md b/samples/client/petstore/java-helidon-client/v4/se/docs/Order.md new file mode 100644 index 000000000000..27af32855c5c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/OuterComposite.md b/samples/client/petstore/java-helidon-client/v4/se/docs/OuterComposite.md new file mode 100644 index 000000000000..98b56e0763ff --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/OuterEnum.md b/samples/client/petstore/java-helidon-client/v4/se/docs/OuterEnum.md new file mode 100644 index 000000000000..1f9b723eb8e7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java-helidon-client/v4/se/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..cbc7f4ba54d2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/OuterEnumInteger.md b/samples/client/petstore/java-helidon-client/v4/se/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..f71dea30ad00 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java-helidon-client/v4/se/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..99e6389f4278 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/java-helidon-client/v4/se/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..0fafaaa27154 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/ParentWithNullable.md b/samples/client/petstore/java-helidon-client/v4/se/docs/ParentWithNullable.md new file mode 100644 index 000000000000..e4d322985632 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/docs/ParentWithNullable.md @@ -0,0 +1,22 @@ + + +# ParentWithNullable + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | [**TypeEnum**](#TypeEnum) | | [optional] | +|**nullableProperty** | **String** | | [optional] | + + + +## Enum: TypeEnum + +| Name | Value | +|---- | -----| +| CHILD_WITH_NULLABLE | "ChildWithNullable" | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/se/docs/Pet.md b/samples/client/petstore/java-helidon-client/v4/se/docs/Pet.md new file mode 100644 index 000000000000..54af77a9f5a7 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/PetApi.md b/samples/client/petstore/java-helidon-client/v4/se/docs/PetApi.md new file mode 100644 index 000000000000..e2515d9bb9bb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/ReadOnlyFirst.md b/samples/client/petstore/java-helidon-client/v4/se/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..ad6af7ee155f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/SingleRefType.md b/samples/client/petstore/java-helidon-client/v4/se/docs/SingleRefType.md new file mode 100644 index 000000000000..cc269bb871fd --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/SpecialModelName.md b/samples/client/petstore/java-helidon-client/v4/se/docs/SpecialModelName.md new file mode 100644 index 000000000000..4b6a06e36224 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/StoreApi.md b/samples/client/petstore/java-helidon-client/v4/se/docs/StoreApi.md new file mode 100644 index 000000000000..ce91137cc6f4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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 generate 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/v4/se/docs/Tag.md b/samples/client/petstore/java-helidon-client/v4/se/docs/Tag.md new file mode 100644 index 000000000000..5088b2dd1c31 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/java-helidon-client/v4/se/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 000000000000..dc066e6c7dac --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,13 @@ + + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**someProperty** | **String** | | [optional] | + + + diff --git a/samples/client/petstore/java-helidon-client/v4/se/docs/User.md b/samples/client/petstore/java-helidon-client/v4/se/docs/User.md new file mode 100644 index 000000000000..08813e4b10b4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/docs/UserApi.md b/samples/client/petstore/java-helidon-client/v4/se/docs/UserApi.md new file mode 100644 index 000000000000..305fd6e66dfb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/pom.xml b/samples/client/petstore/java-helidon-client/v4/se/pom.xml new file mode 100644 index 000000000000..758079524502 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + org.openapitools + + io.helidon.applications + helidon-se + 4.0.11 + + + 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 + + + 0.2.6 + + + + + io.helidon.webclient + helidon-webclient + + + io.helidon.config + helidon-config + + + jakarta.json + jakarta.json-api + + + org.openapitools + jackson-databind-nullable + ${version.jackson.databind.nullable} + + + io.helidon.http.media + helidon-http-media-jackson + + + org.glassfish.jersey.media + jersey-media-json-jackson + + + 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/v4/se/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 000000000000..7ce535e9b569 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,242 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.http.media.jackson.JacksonSupport; +import io.helidon.webclient.api.WebClient; +import io.helidon.webclient.api.WebClientConfig; + +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 WebClientConfig.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 WebClientConfig.Builder webClientBuilder; + private Config clientConfig; + private ObjectMapper objectMapper; + + public ApiClient build() { + return new ApiClient(this); + } + + /** + * Sets the {@code WebClientConfig.Builder} which the {@code ApiClient.Builder} uses. Any previous setting is discarded. + * + * @param webClientBuilder the {@code WebClientConfig.Builder} to be used going forward + * @return the updated builder + */ + public Builder webClientBuilder(WebClientConfig.Builder webClientBuilder) { + this.webClientBuilder = webClientBuilder; + return this; + } + + /** + * Sets the client {@code Config} which the {@code ApiClient.Builder} uses in preparing a default {@code WebClientConfig.Builder}. + * The builder ignores this setting if you provide your own {@code WebClientConfig.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 WebClientConfig.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 WebClientConfig.Builder defaultWebClientBuilder() { + WebClientConfig.Builder defaultWebClientBuilder = WebClient.builder() + .baseUri("http://petstore.swagger.io:80/v2") + .config(clientConfig()); + defaultWebClientBuilder.addMediaSupport(objectMapper == null + ? JacksonSupport.create(clientConfig()) + : 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/v4/se/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 000000000000..aefae6cc99ff --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/ApiResponse.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.client; + + +import io.helidon.common.GenericType; +import io.helidon.webclient.api.HttpClientResponse; + +/** + * 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, HttpClientResponse webClientResponse) { + return new ApiResponseBase<>(responseType, webClientResponse); + } + + /** + * @returns reactive access to the {@link HttpClientResponse} describing the response from the server + */ + HttpClientResponse webClientResponse(); + + /** + * @return access to the value returned in the response from the server + */ + T result(); +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/ApiResponseBase.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/ApiResponseBase.java new file mode 100644 index 000000000000..739a0c0a0b68 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/ApiResponseBase.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 io.helidon.common.GenericType; +import io.helidon.webclient.api.HttpClientResponse; + +/** + * Implementation of a generic-typed response. + * + * @param type of the return value from the generated API method + */ +class ApiResponseBase implements ApiResponse { + + private final HttpClientResponse webClientResponse; + private final GenericType responseType; + + protected ApiResponseBase(GenericType responseType, HttpClientResponse webClientResponse) { + this.webClientResponse = webClientResponse; + this.responseType = responseType; + } + + @Override + public HttpClientResponse webClientResponse() { + return webClientResponse; + } + + @Override + public T result() { + return webClientResponse.entity().as(responseType); + } +} \ No newline at end of file diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 000000000000..50dd6b1cd2e0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 000000000000..dd96c18c0d39 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 000000000000..f1f0fe1f3d57 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/AnotherFakeApiImpl.java new file mode 100644 index 000000000000..156ea9de8d71 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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.media.type.MediaTypes; +import io.helidon.config.Config; +import io.helidon.http.Method; +import io.helidon.http.media.MediaSupport; + +import io.helidon.http.media.jackson.JacksonSupport; +import io.helidon.webclient.api.HttpClientRequest; +import io.helidon.webclient.api.HttpClientResponse; + +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"); + HttpClientRequest 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 HttpClientRequest for call123testSpecialTags + */ + protected HttpClientRequest call123testSpecialTagsRequestBuilder(Client client) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.PATCH); + + webClientRequestBuilder.path("/another-fake/dummy"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Client client) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(client); + return ApiResponse.create(RESPONSE_TYPE_call123testSpecialTags, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 000000000000..75f45b2d8891 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/api/DefaultApiImpl.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/DefaultApiImpl.java new file mode 100644 index 000000000000..3b8938d73e11 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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.media.type.MediaTypes; +import io.helidon.config.Config; +import io.helidon.http.Method; +import io.helidon.http.media.MediaSupport; + +import io.helidon.http.media.jackson.JacksonSupport; +import io.helidon.webclient.api.HttpClientRequest; +import io.helidon.webclient.api.HttpClientResponse; + +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() { + HttpClientRequest webClientRequestBuilder = fooGetRequestBuilder(); + return fooGetSubmit(webClientRequestBuilder); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the fooGet operation. + * Optional customization point for subclasses. + * + * @return HttpClientRequest for fooGet + */ + protected HttpClientRequest fooGetRequestBuilder() { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.GET); + + webClientRequestBuilder.path("/foo"); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_fooGet, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 000000000000..54def85a491c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,184 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.ChildWithNullable; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +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 java.util.Optional; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +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 { + + ApiResponse fakeBigDecimalMap(); + + /** + * 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); + + /** + * test referenced additionalProperties + * + * @param requestBody request body (required) + * @return {@code ApiResponse} + */ + ApiResponse testAdditionalPropertiesReference(Map requestBody); + + 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 inline free-form additionalProperties + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return {@code ApiResponse} + */ + ApiResponse testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return {@code ApiResponse} + */ + ApiResponse testJsonFormData(String param, String param2); + + /** + * test nullable parent property + * + * @param childWithNullable request body (required) + * @return {@code ApiResponse} + */ + ApiResponse testNullable(ChildWithNullable childWithNullable); + + ApiResponse testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language); + + /** + * test referenced string map + * + * @param requestBody request body (required) + * @return {@code ApiResponse} + */ + ApiResponse testStringMapReference(Map requestBody); + +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java new file mode 100644 index 000000000000..de72f948f8fe --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/FakeApiImpl.java @@ -0,0 +1,1083 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.media.type.MediaTypes; +import io.helidon.config.Config; +import io.helidon.http.Method; +import io.helidon.http.media.MediaSupport; + +import io.helidon.http.media.jackson.JacksonSupport; +import io.helidon.webclient.api.HttpClientRequest; +import io.helidon.webclient.api.HttpClientResponse; + +import org.openapitools.client.ApiClient; + +import java.math.BigDecimal; +import org.openapitools.client.model.ChildWithNullable; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +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 java.util.Optional; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +import org.openapitools.client.model.User; +import java.util.ArrayList; +import io.helidon.http.ClientRequestHeaders; +import io.helidon.http.HeaderNames; +import org.openapitools.client.Pair; +import java.util.StringJoiner; + +/** + * OpenAPI Petstore + * + *

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_fakeBigDecimalMap = ResponseType.create(FakeBigDecimalMap200Response.class); + 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_testAdditionalPropertiesReference = ResponseType.create(Void.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_testInlineFreeformAdditionalProperties = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testJsonFormData = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testNullable = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testQueryParameterCollectionFormat = ResponseType.create(Void.class); + protected static final GenericType RESPONSE_TYPE_testStringMapReference = 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 fakeBigDecimalMap() { + HttpClientRequest webClientRequestBuilder = fakeBigDecimalMapRequestBuilder(); + return fakeBigDecimalMapSubmit(webClientRequestBuilder); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the fakeBigDecimalMap operation. + * Optional customization point for subclasses. + * + * @return HttpClientRequest for fakeBigDecimalMap + */ + protected HttpClientRequest fakeBigDecimalMapRequestBuilder() { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.GET); + + webClientRequestBuilder.path("/fake/BigDecimalMap"); + webClientRequestBuilder.accept(MediaTypes.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the fakeBigDecimalMap 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 fakeBigDecimalMapSubmit(HttpClientRequest webClientRequestBuilder) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_fakeBigDecimalMap, webClientResponse); + } + + @Override + public ApiResponse fakeHealthGet() { + HttpClientRequest webClientRequestBuilder = fakeHealthGetRequestBuilder(); + return fakeHealthGetSubmit(webClientRequestBuilder); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the fakeHealthGet operation. + * Optional customization point for subclasses. + * + * @return HttpClientRequest for fakeHealthGet + */ + protected HttpClientRequest fakeHealthGetRequestBuilder() { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.GET); + + webClientRequestBuilder.path("/fake/health"); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + 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"); + HttpClientRequest 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 HttpClientRequest for fakeHttpSignatureTest + */ + protected HttpClientRequest fakeHttpSignatureTestRequestBuilder(Pet pet, String query1, String header1) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.GET); + + List queryParams = new ArrayList<>(); + queryParams.addAll(ApiClient.parameterToPairs("query_1", query1)); + queryParams.forEach(p -> webClientRequestBuilder.queryParam(p.getName(), p.getValue())); + + ClientRequestHeaders headers = webClientRequestBuilder.headers(); + if (header1 != null) { + headers.add(HeaderNames.create("header_1"), header1); + } + + webClientRequestBuilder.path("/fake/http-signature-test"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Pet pet, String query1, String header1) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(pet); + return ApiResponse.create(RESPONSE_TYPE_fakeHttpSignatureTest, webClientResponse); + } + + @Override + public ApiResponse fakeOuterBooleanSerialize(Boolean body) { + HttpClientRequest 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 HttpClientRequest for fakeOuterBooleanSerialize + */ + protected HttpClientRequest fakeOuterBooleanSerializeRequestBuilder(Boolean body) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/fake/outer/boolean"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Boolean body) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(body); + return ApiResponse.create(RESPONSE_TYPE_fakeOuterBooleanSerialize, webClientResponse); + } + + @Override + public ApiResponse fakeOuterCompositeSerialize(OuterComposite outerComposite) { + HttpClientRequest 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 HttpClientRequest for fakeOuterCompositeSerialize + */ + protected HttpClientRequest fakeOuterCompositeSerializeRequestBuilder(OuterComposite outerComposite) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/fake/outer/composite"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, OuterComposite outerComposite) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(outerComposite); + return ApiResponse.create(RESPONSE_TYPE_fakeOuterCompositeSerialize, webClientResponse); + } + + @Override + public ApiResponse fakeOuterNumberSerialize(BigDecimal body) { + HttpClientRequest 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 HttpClientRequest for fakeOuterNumberSerialize + */ + protected HttpClientRequest fakeOuterNumberSerializeRequestBuilder(BigDecimal body) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/fake/outer/number"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, BigDecimal body) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(body); + return ApiResponse.create(RESPONSE_TYPE_fakeOuterNumberSerialize, webClientResponse); + } + + @Override + public ApiResponse fakeOuterStringSerialize(String body) { + HttpClientRequest 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 HttpClientRequest for fakeOuterStringSerialize + */ + protected HttpClientRequest fakeOuterStringSerializeRequestBuilder(String body) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/fake/outer/string"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, String body) { + HttpClientResponse 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"); + HttpClientRequest 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 HttpClientRequest for fakePropertyEnumIntegerSerialize + */ + protected HttpClientRequest fakePropertyEnumIntegerSerializeRequestBuilder(OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/fake/property/enum-int"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(outerObjectWithEnumProperty); + return ApiResponse.create(RESPONSE_TYPE_fakePropertyEnumIntegerSerialize, webClientResponse); + } + + @Override + public ApiResponse testAdditionalPropertiesReference(Map requestBody) { + Objects.requireNonNull(requestBody, "Required parameter 'requestBody' not specified"); + HttpClientRequest webClientRequestBuilder = testAdditionalPropertiesReferenceRequestBuilder(requestBody); + return testAdditionalPropertiesReferenceSubmit(webClientRequestBuilder, requestBody); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testAdditionalPropertiesReference operation. + * Optional customization point for subclasses. + * + * @param requestBody request body (required) + * @return HttpClientRequest for testAdditionalPropertiesReference + */ + protected HttpClientRequest testAdditionalPropertiesReferenceRequestBuilder(Map requestBody) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/fake/additionalProperties-reference"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testAdditionalPropertiesReference 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 testAdditionalPropertiesReferenceSubmit(HttpClientRequest webClientRequestBuilder, Map requestBody) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(requestBody); + return ApiResponse.create(RESPONSE_TYPE_testAdditionalPropertiesReference, webClientResponse); + } + + @Override + public ApiResponse testBodyWithBinary(File body) { + Objects.requireNonNull(body, "Required parameter 'body' not specified"); + HttpClientRequest 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 HttpClientRequest for testBodyWithBinary + */ + protected HttpClientRequest testBodyWithBinaryRequestBuilder(File body) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.PUT); + + webClientRequestBuilder.path("/fake/body-with-binary"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, File body) { + HttpClientResponse 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"); + HttpClientRequest webClientRequestBuilder = testBodyWithFileSchemaRequestBuilder(fileSchemaTestClass); + return testBodyWithFileSchemaSubmit(webClientRequestBuilder, fileSchemaTestClass); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testBodyWithFileSchema operation. + * Optional customization point for subclasses. + * + * @param fileSchemaTestClass (required) + * @return HttpClientRequest for testBodyWithFileSchema + */ + protected HttpClientRequest testBodyWithFileSchemaRequestBuilder(FileSchemaTestClass fileSchemaTestClass) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.PUT); + + webClientRequestBuilder.path("/fake/body-with-file-schema"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, FileSchemaTestClass fileSchemaTestClass) { + HttpClientResponse 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"); + HttpClientRequest 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 HttpClientRequest for testBodyWithQueryParams + */ + protected HttpClientRequest testBodyWithQueryParamsRequestBuilder(String query, User user) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(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(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, String query, User user) { + HttpClientResponse 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"); + HttpClientRequest 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 HttpClientRequest for testClientModel + */ + protected HttpClientRequest testClientModelRequestBuilder(Client client) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.PATCH); + + webClientRequestBuilder.path("/fake"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Client client) { + HttpClientResponse 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"); + HttpClientRequest 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 HttpClientRequest for testEndpointParameters + */ + protected HttpClientRequest 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) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/fake"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest 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(); + HttpClientResponse 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) { + HttpClientRequest 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 HttpClientRequest for testEnumParameters + */ + protected HttpClientRequest testEnumParametersRequestBuilder(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(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())); + + ClientRequestHeaders headers = webClientRequestBuilder.headers(); + if (enumHeaderStringArray != null) { + headers.add(HeaderNames.create("enum_header_string_array"), enumHeaderStringArray.toString()); + } + if (enumHeaderString != null) { + headers.add(HeaderNames.create("enum_header_string"), enumHeaderString); + } + + webClientRequestBuilder.path("/fake"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest 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(); + HttpClientResponse 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"); + HttpClientRequest 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 HttpClientRequest for testGroupParameters + */ + protected HttpClientRequest testGroupParametersRequestBuilder(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(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())); + + ClientRequestHeaders headers = webClientRequestBuilder.headers(); + if (requiredBooleanGroup != null) { + headers.add(HeaderNames.create("required_boolean_group"), requiredBooleanGroup.toString()); + } + if (booleanGroup != null) { + headers.add(HeaderNames.create("boolean_group"), booleanGroup.toString()); + } + + webClientRequestBuilder.path("/fake"); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_testGroupParameters, webClientResponse); + } + + @Override + public ApiResponse testInlineAdditionalProperties(Map requestBody) { + Objects.requireNonNull(requestBody, "Required parameter 'requestBody' not specified"); + HttpClientRequest 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 HttpClientRequest for testInlineAdditionalProperties + */ + protected HttpClientRequest testInlineAdditionalPropertiesRequestBuilder(Map requestBody) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/fake/inline-additionalProperties"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Map requestBody) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(requestBody); + return ApiResponse.create(RESPONSE_TYPE_testInlineAdditionalProperties, webClientResponse); + } + + @Override + public ApiResponse testInlineFreeformAdditionalProperties(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + Objects.requireNonNull(testInlineFreeformAdditionalPropertiesRequest, "Required parameter 'testInlineFreeformAdditionalPropertiesRequest' not specified"); + HttpClientRequest webClientRequestBuilder = testInlineFreeformAdditionalPropertiesRequestBuilder(testInlineFreeformAdditionalPropertiesRequest); + return testInlineFreeformAdditionalPropertiesSubmit(webClientRequestBuilder, testInlineFreeformAdditionalPropertiesRequest); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testInlineFreeformAdditionalProperties operation. + * Optional customization point for subclasses. + * + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return HttpClientRequest for testInlineFreeformAdditionalProperties + */ + protected HttpClientRequest testInlineFreeformAdditionalPropertiesRequestBuilder(TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/fake/inline-freeform-additionalProperties"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testInlineFreeformAdditionalProperties operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param testInlineFreeformAdditionalPropertiesRequest request body (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testInlineFreeformAdditionalPropertiesSubmit(HttpClientRequest webClientRequestBuilder, TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(testInlineFreeformAdditionalPropertiesRequest); + return ApiResponse.create(RESPONSE_TYPE_testInlineFreeformAdditionalProperties, 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"); + HttpClientRequest 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 HttpClientRequest for testJsonFormData + */ + protected HttpClientRequest testJsonFormDataRequestBuilder(String param, String param2) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.GET); + + webClientRequestBuilder.path("/fake/jsonFormData"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, String param, String param2) { + String formParams = new StringJoiner("&") + .add("param=" + param) + .add("param2=" + param2) + .toString(); + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(formParams); + return ApiResponse.create(RESPONSE_TYPE_testJsonFormData, webClientResponse); + } + + @Override + public ApiResponse testNullable(ChildWithNullable childWithNullable) { + Objects.requireNonNull(childWithNullable, "Required parameter 'childWithNullable' not specified"); + HttpClientRequest webClientRequestBuilder = testNullableRequestBuilder(childWithNullable); + return testNullableSubmit(webClientRequestBuilder, childWithNullable); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testNullable operation. + * Optional customization point for subclasses. + * + * @param childWithNullable request body (required) + * @return HttpClientRequest for testNullable + */ + protected HttpClientRequest testNullableRequestBuilder(ChildWithNullable childWithNullable) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/fake/nullable"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testNullable operation. + * Optional customization point for subclasses. + * + * @param webClientRequestBuilder the request builder to use for submitting the request + * @param childWithNullable request body (required) + * @return {@code ApiResponse} for the submitted request + */ + protected ApiResponse testNullableSubmit(HttpClientRequest webClientRequestBuilder, ChildWithNullable childWithNullable) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(childWithNullable); + return ApiResponse.create(RESPONSE_TYPE_testNullable, 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"); + HttpClientRequest 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 HttpClientRequest for testQueryParameterCollectionFormat + */ + protected HttpClientRequest testQueryParameterCollectionFormatRequestBuilder(List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(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(MediaTypes.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(HttpClientRequest webClientRequestBuilder, List pipe, List ioutil, List http, List url, List context, String allowEmpty, Map language) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_testQueryParameterCollectionFormat, webClientResponse); + } + + @Override + public ApiResponse testStringMapReference(Map requestBody) { + Objects.requireNonNull(requestBody, "Required parameter 'requestBody' not specified"); + HttpClientRequest webClientRequestBuilder = testStringMapReferenceRequestBuilder(requestBody); + return testStringMapReferenceSubmit(webClientRequestBuilder, requestBody); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the testStringMapReference operation. + * Optional customization point for subclasses. + * + * @param requestBody request body (required) + * @return HttpClientRequest for testStringMapReference + */ + protected HttpClientRequest testStringMapReferenceRequestBuilder(Map requestBody) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/fake/stringMap-reference"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.APPLICATION_JSON); + + return webClientRequestBuilder; + } + + /** + * Initiates the request for the testStringMapReference 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 testStringMapReferenceSubmit(HttpClientRequest webClientRequestBuilder, Map requestBody) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(requestBody); + return ApiResponse.create(RESPONSE_TYPE_testStringMapReference, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 000000000000..83e7415b6f46 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/FakeClassnameTags123ApiImpl.java new file mode 100644 index 000000000000..2b5a033ed69f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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.media.type.MediaTypes; +import io.helidon.config.Config; +import io.helidon.http.Method; +import io.helidon.http.media.MediaSupport; + +import io.helidon.http.media.jackson.JacksonSupport; +import io.helidon.webclient.api.HttpClientRequest; +import io.helidon.webclient.api.HttpClientResponse; + +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"); + HttpClientRequest 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 HttpClientRequest for testClassname + */ + protected HttpClientRequest testClassnameRequestBuilder(Client client) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.PATCH); + + webClientRequestBuilder.path("/fake_classname_test"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Client client) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(client); + return ApiResponse.create(RESPONSE_TYPE_testClassname, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 000000000000..7731763f5934 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,112 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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 java.util.Optional; +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/v4/se/src/main/java/org/openapitools/client/api/PetApiImpl.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/PetApiImpl.java new file mode 100644 index 000000000000..d8e33fe1fd3c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/PetApiImpl.java @@ -0,0 +1,465 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.media.type.MediaTypes; +import io.helidon.config.Config; +import io.helidon.http.Method; +import io.helidon.http.media.MediaSupport; + +import io.helidon.http.media.jackson.JacksonSupport; +import io.helidon.webclient.api.HttpClientRequest; +import io.helidon.webclient.api.HttpClientResponse; + +import org.openapitools.client.ApiClient; + +import java.io.File; +import java.util.List; +import java.util.Map; +import org.openapitools.client.model.ModelApiResponse; +import java.util.Optional; +import org.openapitools.client.model.Pet; +import java.util.Set; +import java.util.ArrayList; +import io.helidon.http.ClientRequestHeaders; +import io.helidon.http.HeaderNames; +import org.openapitools.client.Pair; +import java.util.StringJoiner; + +/** + * OpenAPI Petstore + * + *

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"); + HttpClientRequest 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 HttpClientRequest for addPet + */ + protected HttpClientRequest addPetRequestBuilder(Pet pet) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/pet"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Pet pet) { + HttpClientResponse 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"); + HttpClientRequest 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 HttpClientRequest for deletePet + */ + protected HttpClientRequest deletePetRequestBuilder(Long petId, String apiKey) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.DELETE); + + ClientRequestHeaders headers = webClientRequestBuilder.headers(); + if (apiKey != null) { + headers.add(HeaderNames.create("api_key"), apiKey); + } + + String path = "/pet/{petId}" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + webClientRequestBuilder.path(path); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Long petId, String apiKey) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_deletePet, webClientResponse); + } + + @Override + public ApiResponse> findPetsByStatus(List status) { + Objects.requireNonNull(status, "Required parameter 'status' not specified"); + HttpClientRequest 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 HttpClientRequest for findPetsByStatus + */ + protected HttpClientRequest findPetsByStatusRequestBuilder(List status) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(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(MediaTypes.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(HttpClientRequest webClientRequestBuilder, List status) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_findPetsByStatus, webClientResponse); + } + + @Deprecated + @Override + public ApiResponse> findPetsByTags(Set tags) { + Objects.requireNonNull(tags, "Required parameter 'tags' not specified"); + HttpClientRequest 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 HttpClientRequest for findPetsByTags + */ + protected HttpClientRequest findPetsByTagsRequestBuilder(Set tags) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(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(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Set tags) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_findPetsByTags, webClientResponse); + } + + @Override + public ApiResponse getPetById(Long petId) { + Objects.requireNonNull(petId, "Required parameter 'petId' not specified"); + HttpClientRequest 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 HttpClientRequest for getPetById + */ + protected HttpClientRequest getPetByIdRequestBuilder(Long petId) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.GET); + + String path = "/pet/{petId}" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + webClientRequestBuilder.path(path); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Long petId) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_getPetById, webClientResponse); + } + + @Override + public ApiResponse updatePet(Pet pet) { + Objects.requireNonNull(pet, "Required parameter 'pet' not specified"); + HttpClientRequest 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 HttpClientRequest for updatePet + */ + protected HttpClientRequest updatePetRequestBuilder(Pet pet) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.PUT); + + webClientRequestBuilder.path("/pet"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Pet pet) { + HttpClientResponse 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"); + HttpClientRequest 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 HttpClientRequest for updatePetWithForm + */ + protected HttpClientRequest updatePetWithFormRequestBuilder(Long petId, String name, String status) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + String path = "/pet/{petId}" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + webClientRequestBuilder.path(path); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Long petId, String name, String status) { + String formParams = new StringJoiner("&") + .add("name=" + name) + .add("status=" + status) + .toString(); + HttpClientResponse 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"); + HttpClientRequest 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 HttpClientRequest for uploadFile + */ + protected HttpClientRequest uploadFileRequestBuilder(Long petId, String additionalMetadata, File _file) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + String path = "/pet/{petId}/uploadImage" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + webClientRequestBuilder.path(path); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Long petId, String additionalMetadata, File _file) { + String formParams = new StringJoiner("&") + .add("additionalMetadata=" + additionalMetadata) + .add("file=" + _file) + .toString(); + HttpClientResponse 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"); + HttpClientRequest 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 HttpClientRequest for uploadFileWithRequiredFile + */ + protected HttpClientRequest uploadFileWithRequiredFileRequestBuilder(Long petId, File requiredFile, String additionalMetadata) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + String path = "/fake/{petId}/uploadImageWithRequiredFile" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + webClientRequestBuilder.path(path); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_FORM_URLENCODED); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Long petId, File requiredFile, String additionalMetadata) { + String formParams = new StringJoiner("&") + .add("additionalMetadata=" + additionalMetadata) + .add("requiredFile=" + requiredFile) + .toString(); + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(formParams); + return ApiResponse.create(RESPONSE_TYPE_uploadFileWithRequiredFile, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/ResponseType.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/ResponseType.java new file mode 100644 index 000000000000..74f7f4d9a8e9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 000000000000..a71be4f7616f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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 generate 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/v4/se/src/main/java/org/openapitools/client/api/StoreApiImpl.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/StoreApiImpl.java new file mode 100644 index 000000000000..cc027f66a17b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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.media.type.MediaTypes; +import io.helidon.config.Config; +import io.helidon.http.Method; +import io.helidon.http.media.MediaSupport; + +import io.helidon.http.media.jackson.JacksonSupport; +import io.helidon.webclient.api.HttpClientRequest; +import io.helidon.webclient.api.HttpClientResponse; + +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"); + HttpClientRequest 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 HttpClientRequest for deleteOrder + */ + protected HttpClientRequest deleteOrderRequestBuilder(String orderId) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.DELETE); + + String path = "/store/order/{order_id}" + .replace("{order_id}", ApiClient.urlEncode(orderId)); + webClientRequestBuilder.path(path); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, String orderId) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_deleteOrder, webClientResponse); + } + + @Override + public ApiResponse> getInventory() { + HttpClientRequest webClientRequestBuilder = getInventoryRequestBuilder(); + return getInventorySubmit(webClientRequestBuilder); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the getInventory operation. + * Optional customization point for subclasses. + * + * @return HttpClientRequest for getInventory + */ + protected HttpClientRequest getInventoryRequestBuilder() { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.GET); + + webClientRequestBuilder.path("/store/inventory"); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_getInventory, webClientResponse); + } + + @Override + public ApiResponse getOrderById(Long orderId) { + Objects.requireNonNull(orderId, "Required parameter 'orderId' not specified"); + HttpClientRequest 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 HttpClientRequest for getOrderById + */ + protected HttpClientRequest getOrderByIdRequestBuilder(Long orderId) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.GET); + + String path = "/store/order/{order_id}" + .replace("{order_id}", ApiClient.urlEncode(orderId.toString())); + webClientRequestBuilder.path(path); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Long orderId) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_getOrderById, webClientResponse); + } + + @Override + public ApiResponse placeOrder(Order order) { + Objects.requireNonNull(order, "Required parameter 'order' not specified"); + HttpClientRequest 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 HttpClientRequest for placeOrder + */ + protected HttpClientRequest placeOrderRequestBuilder(Order order) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/store/order"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, Order order) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(order); + return ApiResponse.create(RESPONSE_TYPE_placeOrder, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 000000000000..c826790659b6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/UserApi.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.api; + +import org.openapitools.client.ApiResponse; +import java.util.List; +import java.util.Map; +import java.time.OffsetDateTime; +import java.util.Optional; +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/v4/se/src/main/java/org/openapitools/client/api/UserApiImpl.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/UserApiImpl.java new file mode 100644 index 000000000000..b145b4879a88 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/api/UserApiImpl.java @@ -0,0 +1,384 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.media.type.MediaTypes; +import io.helidon.config.Config; +import io.helidon.http.Method; +import io.helidon.http.media.MediaSupport; + +import io.helidon.http.media.jackson.JacksonSupport; +import io.helidon.webclient.api.HttpClientRequest; +import io.helidon.webclient.api.HttpClientResponse; + +import org.openapitools.client.ApiClient; + +import java.util.List; +import java.util.Map; +import java.time.OffsetDateTime; +import java.util.Optional; +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"); + HttpClientRequest 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 HttpClientRequest for createUser + */ + protected HttpClientRequest createUserRequestBuilder(User user) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/user"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, User user) { + HttpClientResponse 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"); + HttpClientRequest 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 HttpClientRequest for createUsersWithArrayInput + */ + protected HttpClientRequest createUsersWithArrayInputRequestBuilder(List user) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/user/createWithArray"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, List user) { + HttpClientResponse 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"); + HttpClientRequest 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 HttpClientRequest for createUsersWithListInput + */ + protected HttpClientRequest createUsersWithListInputRequestBuilder(List user) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.POST); + + webClientRequestBuilder.path("/user/createWithList"); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, List user) { + HttpClientResponse 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"); + HttpClientRequest 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 HttpClientRequest for deleteUser + */ + protected HttpClientRequest deleteUserRequestBuilder(String username) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.DELETE); + + String path = "/user/{username}" + .replace("{username}", ApiClient.urlEncode(username)); + webClientRequestBuilder.path(path); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, String username) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_deleteUser, webClientResponse); + } + + @Override + public ApiResponse getUserByName(String username) { + Objects.requireNonNull(username, "Required parameter 'username' not specified"); + HttpClientRequest 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 HttpClientRequest for getUserByName + */ + protected HttpClientRequest getUserByNameRequestBuilder(String username) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.GET); + + String path = "/user/{username}" + .replace("{username}", ApiClient.urlEncode(username)); + webClientRequestBuilder.path(path); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, String username) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + 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"); + HttpClientRequest 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 HttpClientRequest for loginUser + */ + protected HttpClientRequest loginUserRequestBuilder(String username, String password) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(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(MediaTypes.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(HttpClientRequest webClientRequestBuilder, String username, String password) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + return ApiResponse.create(RESPONSE_TYPE_loginUser, webClientResponse); + } + + @Override + public ApiResponse logoutUser() { + HttpClientRequest webClientRequestBuilder = logoutUserRequestBuilder(); + return logoutUserSubmit(webClientRequestBuilder); + } + + /** + * Creates a {@code WebClientRequestBuilder} for the logoutUser operation. + * Optional customization point for subclasses. + * + * @return HttpClientRequest for logoutUser + */ + protected HttpClientRequest logoutUserRequestBuilder() { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.GET); + + webClientRequestBuilder.path("/user/logout"); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder) { + HttpClientResponse webClientResponse = webClientRequestBuilder.request(); + 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"); + HttpClientRequest 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 HttpClientRequest for updateUser + */ + protected HttpClientRequest updateUserRequestBuilder(String username, User user) { + HttpClientRequest webClientRequestBuilder = apiClient.webClient() + .method(Method.PUT); + + String path = "/user/{username}" + .replace("{username}", ApiClient.urlEncode(username)); + webClientRequestBuilder.path(path); + webClientRequestBuilder.contentType(MediaTypes.APPLICATION_JSON); + webClientRequestBuilder.accept(MediaTypes.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(HttpClientRequest webClientRequestBuilder, String username, User user) { + HttpClientResponse webClientResponse = webClientRequestBuilder.submit(user); + return ApiResponse.create(RESPONSE_TYPE_updateUser, webClientResponse); + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 000000000000..abc3d296fa39 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java new file mode 100644 index 000000000000..cb7b8b0a6811 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 000000000000..52742a478bb8 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Animal.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.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; + + + + +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/v4/se/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 000000000000..80114154d940 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,82 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.Arrays; +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/v4/se/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 000000000000..b06f05338a4e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,82 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.Arrays; +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/v4/se/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 000000000000..d9ee320b0bdd --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ArrayTest.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.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.Arrays; +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/v4/se/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 000000000000..f6d3fde93d48 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 000000000000..be9c69545616 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 000000000000..8da990111047 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ChildWithNullable.java new file mode 100644 index 000000000000..90b2f7ceb09b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ChildWithNullable.java @@ -0,0 +1,78 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.ParentWithNullable; +import org.openapitools.jackson.nullable.JsonNullable; + + + + +public class ChildWithNullable extends ParentWithNullable { + + private String otherProperty; + + /** + * Get otherProperty + * @return otherProperty + **/ + public String getOtherProperty() { + return otherProperty; + } + + /** + * Set otherProperty + **/ + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + public ChildWithNullable otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).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/v4/se/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 000000000000..de44db959bc3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 000000000000..0ad715df8def --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/DeprecatedObject.java new file mode 100644 index 000000000000..aaaed8e7f3e4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 000000000000..069dab8392d5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 000000000000..38d88dc16fd8 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/EnumArrays.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.util.ArrayList; +import java.util.Arrays; +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/v4/se/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 000000000000..eed52272f705 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 000000000000..538f09adcede --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,325 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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 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/v4/se/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java new file mode 100644 index 000000000000..f671eb33e5ca --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.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.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + + + + +public class FakeBigDecimalMap200Response { + + private BigDecimal someId; + + private Map someMap = null; + + /** + * Get someId + * @return someId + **/ + public BigDecimal getSomeId() { + return someId; + } + + /** + * Set someId + **/ + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + public FakeBigDecimalMap200Response someId(BigDecimal someId) { + this.someId = someId; + return this; + } + + /** + * Get someMap + * @return someMap + **/ + public Map getSomeMap() { + return someMap; + } + + /** + * Set someMap + **/ + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + public FakeBigDecimalMap200Response someMap(Map someMap) { + this.someMap = someMap; + return this; + } + + public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) { + this.someMap.put(key, someMapItem); + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).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/v4/se/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 000000000000..f867e747aaba --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,105 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.Arrays; +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/v4/se/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Foo.java new file mode 100644 index 000000000000..fcafaf7682c1 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java new file mode 100644 index 000000000000..27971dae9168 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 000000000000..1f3fc84b65ae --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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("*").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/v4/se/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 000000000000..72566c02dde9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 000000000000..35e104b4b12f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/HealthCheckResult.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; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +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/v4/se/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 000000000000..ec54a8ae4210 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 000000000000..de307d1e2860 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 000000000000..393f65f83e93 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 000000000000..881fc2677d27 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 000000000000..3c1cf785ea51 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 000000000000..0c2e7ffb39d2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 000000000000..7d948f62e2ce --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 000000000000..ba07eb915237 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 000000000000..91af4dd3894f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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.Arrays; +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 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/v4/se/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 000000000000..5d493bccf260 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java new file mode 100644 index 000000000000..254b7df22cb4 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,158 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.Arrays; +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/v4/se/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 000000000000..84ce8e3fa1fb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 000000000000..6ba3d1712d42 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 000000000000..9fe96db3f6ef --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 000000000000..f5b732f784f0 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 000000000000..0ca88b32ee6c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 000000000000..06f9fe6c371e --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java new file mode 100644 index 000000000000..b25e8e37ae7f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ParentWithNullable.java new file mode 100644 index 000000000000..d22980be614c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ParentWithNullable.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.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.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.NoSuchElementException; + + + + +public class ParentWithNullable { + +public enum TypeEnum { + + CHILD_WITH_NULLABLE(String.valueOf("ChildWithNullable")); + + String value; + + TypeEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + +} + + private TypeEnum type; + + private String nullableProperty; + + /** + * Get type + * @return type + **/ + public TypeEnum getType() { + return type; + } + + /** + * Set type + **/ + public void setType(TypeEnum type) { + this.type = type; + } + + public ParentWithNullable type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get nullableProperty + * @return nullableProperty + **/ + public String getNullableProperty() { + return nullableProperty; + } + + /** + * Set nullableProperty + **/ + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + public ParentWithNullable nullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).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/v4/se/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 000000000000..3960d4372775 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,231 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.Arrays; +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/v4/se/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 000000000000..15344cbf0dc1 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/SingleRefType.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/SingleRefType.java new file mode 100644 index 000000000000..d46fc6c116ff --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 000000000000..af5166268f75 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 000000000000..1dee37e39368 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 000000000000..e46c4bb382de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.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.util.HashMap; +import java.util.Map; + + + + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + private String someProperty; + + /** + * Get someProperty + * @return someProperty + **/ + public String getSomeProperty() { + return someProperty; + } + + /** + * Set someProperty + **/ + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; + return this; + } + + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).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/v4/se/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java-helidon-client/v4/se/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 000000000000..c088a4d15d58 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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/v4/se/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 000000000000..a283ee18455f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.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.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.webclient.api.HttpClientResponse; + +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/v4/se/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 000000000000..5bb6e9cbc576 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/api/DefaultApiTest.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.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.webclient.api.HttpClientResponse; + +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/v4/se/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 000000000000..825177de858a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,531 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.ChildWithNullable; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.EnumClass; +import org.openapitools.client.model.FakeBigDecimalMap200Response; +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 java.util.Optional; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterObjectWithEnumProperty; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.TestInlineFreeformAdditionalPropertiesRequest; +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.webclient.api.HttpClientResponse; + +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); + } + + /** + * + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + */ + @Test + public void fakeBigDecimalMapTest() { + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.fakeBigDecimalMap(); + //response.webClientResponse().await(); + // TODO - check for appropriate return status + // assertThat("Return status", response.get().status().code(), is(expectedStatus)); + + // TODO: test validations + } + + /** + * 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 + } + + /** + * test referenced additionalProperties + * + */ + @Test + public void testAdditionalPropertiesReferenceTest() { + // 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.testAdditionalPropertiesReference(requestBody); + //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 inline free-form additionalProperties + * + */ + @Test + public void testInlineFreeformAdditionalPropertiesTest() { + // TODO - assign values to the input arguments. + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest); + //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 + } + + /** + * test nullable parent property + * + */ + @Test + public void testNullableTest() { + // TODO - assign values to the input arguments. + ChildWithNullable childWithNullable = null; + + // TODO - uncomment the following two lines to invoke the service with valid parameters. + //ApiResponse response = api.testNullable(childWithNullable); + //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 + } + + /** + * test referenced string map + * + */ + @Test + public void testStringMapReferenceTest() { + // 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.testStringMapReference(requestBody); + //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/v4/se/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 000000000000..ec5fbf6196dc --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.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.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.webclient.api.HttpClientResponse; + +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/v4/se/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 000000000000..c9b70e744f53 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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 java.util.Optional; +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.webclient.api.HttpClientResponse; + +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/v4/se/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 000000000000..77d97103ae0f --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,125 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.webclient.api.HttpClientResponse; + +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 generate 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/v4/se/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 000000000000..c11a49d6959d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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 java.util.Optional; +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.webclient.api.HttpClientResponse; + +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/v4/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..7f291540411c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.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 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/v4/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java new file mode 100644 index 000000000000..709ed248c3d9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.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.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/v4/se/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 000000000000..fb63d5826c2a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/AnimalTest.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.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.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/v4/se/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..c101bb32ced9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..9d0fb9edf4c5 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 000000000000..5383565a80f9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 000000000000..9197586ba936 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,86 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 000000000000..4b42f739457b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/CatTest.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.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/v4/se/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 000000000000..56aac4351d0b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ChildWithNullableTest.java new file mode 100644 index 000000000000..68acb8c52349 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ChildWithNullableTest.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.ParentWithNullable; +import org.openapitools.jackson.nullable.JsonNullable; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChildWithNullable + */ +public class ChildWithNullableTest { + private final ChildWithNullable model = new ChildWithNullable(); + + /** + * Model tests for ChildWithNullable + */ + @Test + public void testChildWithNullable() { + // TODO: test ChildWithNullable + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + public void nullablePropertyTest() { + // TODO: test nullableProperty + } + + /** + * Test the property 'otherProperty' + */ + @Test + public void otherPropertyTest() { + // TODO: test otherProperty + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 000000000000..1811595c423c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 000000000000..91cf48da9728 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java new file mode 100644 index 000000000000..6164386e74ce --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 000000000000..db2d706f7c0d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/DogTest.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.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/v4/se/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 000000000000..92c16197a699 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 000000000000..fcc2b4149366 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,31 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 000000000000..d0e89364e960 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,109 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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 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/v4/se/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.java new file mode 100644 index 000000000000..f7674730f578 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/FakeBigDecimalMap200ResponseTest.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.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeBigDecimalMap200Response + */ +public class FakeBigDecimalMap200ResponseTest { + private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); + + /** + * Model tests for FakeBigDecimalMap200Response + */ + @Test + public void testFakeBigDecimalMap200Response() { + // TODO: test FakeBigDecimalMap200Response + } + + /** + * Test the property 'someId' + */ + @Test + public void someIdTest() { + // TODO: test someId + } + + /** + * Test the property 'someMap' + */ + @Test + public void someMapTest() { + // TODO: test someMap + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 000000000000..bf5207891042 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java new file mode 100644 index 000000000000..46605ccd4626 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.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.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/v4/se/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 000000000000..2fefdd231024 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 000000000000..a6acb49c3658 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,171 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 000000000000..09c18c0a0828 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 000000000000..3efed3019acf --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/HealthCheckResultTest.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.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 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/v4/se/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 000000000000..9ccbfde67656 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,72 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..785ef99658f2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.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.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/v4/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 000000000000..4014471af257 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 000000000000..2e3d402ff278 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,62 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 000000000000..bd6ef6800225 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 000000000000..b8ec3ecd7bc6 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 000000000000..e1d4e18788b3 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 000000000000..396f82dc6438 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,70 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 000000000000..694c5a49fce2 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/NullableClassTest.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.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +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 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/v4/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 000000000000..40f55c0d0d09 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/NumberOnlyTest.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 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/v4/se/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 000000000000..7b8cf33e6e72 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 000000000000..7521c5e58060 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OrderTest.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 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/v4/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 000000000000..37dc9deb32ff --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OuterCompositeTest.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 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/v4/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 000000000000..3700a01dcd65 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,31 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 000000000000..1d2f7440113a --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,31 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 000000000000..f12081aad690 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,31 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 000000000000..b65122cea122 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,31 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 000000000000..9bafdc4b5d84 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.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.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/v4/se/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ParentWithNullableTest.java new file mode 100644 index 000000000000..a0fe79ed444b --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ParentWithNullableTest.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.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.NoSuchElementException; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for ParentWithNullable + */ +public class ParentWithNullableTest { + private final ParentWithNullable model = new ParentWithNullable(); + + /** + * Model tests for ParentWithNullable + */ + @Test + public void testParentWithNullable() { + // TODO: test ParentWithNullable + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + public void nullablePropertyTest() { + // TODO: test nullableProperty + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 000000000000..0f2970f254bb --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 000000000000..3bbb4d28ac4c --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java new file mode 100644 index 000000000000..ed805286a016 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -0,0 +1,31 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 000000000000..2aa6eaf5ab2d --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 000000000000..e203d6bf42b9 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,54 @@ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 000000000000..4283de111c35 --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequestTest.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.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 000000000000..c8827f4e71de --- /dev/null +++ b/samples/client/petstore/java-helidon-client/v4/se/src/test/java/org/openapitools/client/model/UserTest.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.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/v3/se/pom.xml b/samples/server/petstore/java-helidon-server/v3/se/pom.xml index 99fa7a06554c..7495f2d0086b 100644 --- a/samples/server/petstore/java-helidon-server/v3/se/pom.xml +++ b/samples/server/petstore/java-helidon-server/v3/se/pom.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 io.helidon.applications diff --git a/samples/server/petstore/java-helidon-server/v4/mp/pom.xml b/samples/server/petstore/java-helidon-server/v4/mp/pom.xml index ea36907a9a2a..68f2fdddc7cf 100644 --- a/samples/server/petstore/java-helidon-server/v4/mp/pom.xml +++ b/samples/server/petstore/java-helidon-server/v4/mp/pom.xml @@ -6,7 +6,7 @@ io.helidon.applications helidon-mp - 4.0.8 + 4.0.11 petstore-helidon-server-mp diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeService.java index 236977b9464e..e2df7b157691 100644 --- a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeService.java +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeService.java @@ -24,6 +24,7 @@ import java.time.LocalDate; import java.util.Map; import java.time.OffsetDateTime; +import java.util.Optional; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; import org.openapitools.server.model.Pet; diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java index 09cf90adaba3..7443531ed0d1 100644 --- a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -24,6 +24,7 @@ import java.time.LocalDate; import java.util.Map; import java.time.OffsetDateTime; +import java.util.Optional; import org.openapitools.server.model.OuterComposite; import org.openapitools.server.model.OuterObjectWithEnumProperty; import org.openapitools.server.model.Pet; diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetService.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetService.java index 578943790453..cbf050bda505 100644 --- a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetService.java +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetService.java @@ -15,6 +15,7 @@ import java.io.File; import java.util.List; import org.openapitools.server.model.ModelApiResponse; +import java.util.Optional; import org.openapitools.server.model.Pet; import java.util.Set; diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java index 0a9b19a88e0e..de65c6f18840 100644 --- a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/PetServiceImpl.java @@ -15,6 +15,7 @@ import java.io.File; import java.util.List; import org.openapitools.server.model.ModelApiResponse; +import java.util.Optional; import org.openapitools.server.model.Pet; import java.util.Set; diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserService.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserService.java index 8684cf38b569..2524f25f3e28 100644 --- a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserService.java +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserService.java @@ -14,6 +14,7 @@ import java.util.List; import java.time.OffsetDateTime; +import java.util.Optional; import org.openapitools.server.model.User; import jakarta.ws.rs.*; diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java index 0e7ba5af3086..9fa1c0a5294e 100644 --- a/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/java/org/openapitools/server/api/UserServiceImpl.java @@ -14,6 +14,7 @@ import java.util.List; import java.time.OffsetDateTime; +import java.util.Optional; import org.openapitools.server.model.User; import jakarta.ws.rs.*; diff --git a/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/logging.properties b/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/logging.properties index cd238eb6615c..c9bc271dee7a 100644 --- a/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/logging.properties +++ b/samples/server/petstore/java-helidon-server/v4/mp/src/main/resources/logging.properties @@ -3,9 +3,8 @@ # For more information see $JAVA_HOME/jre/lib/logging.properties # Send messages to the console -handlers=io.helidon.common.HelidonConsoleHandler +handlers=java.util.logging.ConsoleHandler -# 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 diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/.openapi-generator-ignore b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/.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/v4/se-uac-group-by-file-path/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/.openapi-generator/FILES new file mode 100644 index 000000000000..ac95ee0f3726 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/.openapi-generator/FILES @@ -0,0 +1,88 @@ +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/FakeClassnameTestService.java +src/main/java/org/openapitools/server/api/FakeClassnameTestServiceImpl.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/FooService.java +src/main/java/org/openapitools/server/api/FooServiceImpl.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/JsonProvider.java +src/main/java/org/openapitools/server/api/PartsUtils.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/Category.java +src/main/java/org/openapitools/server/model/ChildWithNullable.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/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/FakeBigDecimalMap200Response.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/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.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/ParentWithNullable.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/TestInlineFreeformAdditionalPropertiesRequest.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 diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/.openapi-generator/VERSION b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/.openapi-generator/VERSION new file mode 100644 index 000000000000..6116b14d2c59 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/README.md b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/README.md new file mode 100644 index 000000000000..696bd42249ed --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/README.md @@ -0,0 +1,79 @@ +# 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/fake/BigDecimalMap +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 POST http://petstore.swagger.io:80/v2/fake/additionalProperties-reference +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 POST http://petstore.swagger.io:80/v2/fake/inline-freeform-additionalProperties +curl -X GET http://petstore.swagger.io:80/v2/fake/jsonFormData +curl -X POST http://petstore.swagger.io:80/v2/fake/nullable +curl -X PUT http://petstore.swagger.io:80/v2/fake/test-query-parameters +curl -X POST http://petstore.swagger.io:80/v2/fake/stringMap-reference +curl -X POST http://petstore.swagger.io:80/v2/fake/{petId}/uploadImageWithRequiredFile +curl -X PATCH http://petstore.swagger.io:80/v2/fake_classname_test +curl -X GET http://petstore.swagger.io:80/v2/foo +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 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/v4/se-uac-group-by-file-path/pom.xml b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/pom.xml new file mode 100644 index 000000000000..6a843edad14f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/pom.xml @@ -0,0 +1,122 @@ + + + 4.0.0 + + io.helidon.applications + helidon-se + 4.0.11 + + + 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.6 + + + + + jakarta.validation + jakarta.validation-api + + + io.helidon.webserver + helidon-webserver + + + io.helidon.http.media + helidon-http-media-jsonp + + + io.helidon.http.media + helidon-http-media-multipart + + + io.helidon.config + helidon-config-yaml + + + io.helidon.webserver.observe + helidon-webserver-observe-health + + + io.helidon.health + helidon-health + + + io.helidon.health + helidon-health-checks + + + io.helidon.webserver.observe + helidon-webserver-observe-metrics + + + io.helidon.metrics + helidon-metrics-system-meters + runtime + + + io.helidon.logging + helidon-logging-jul + runtime + + + io.helidon.openapi + helidon-openapi + + + org.openapitools + jackson-databind-nullable + ${version.jackson.databind.nullable} + + + io.helidon.http.media + helidon-http-media-jackson + + + org.junit.jupiter + junit-jupiter-api + test + + + io.helidon.webclient + helidon-webclient + test + + + io.helidon.webserver.testing.junit5 + helidon-webserver-testing-junit5 + 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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/Main.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/Main.java new file mode 100644 index 000000000000..6e7ab4366943 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/Main.java @@ -0,0 +1,72 @@ +package org.openapitools.server; + +import org.openapitools.server.api.AnotherFakeServiceImpl; +import org.openapitools.server.api.FakeServiceImpl; +import org.openapitools.server.api.FakeClassnameTestServiceImpl; +import org.openapitools.server.api.FooServiceImpl; +import org.openapitools.server.api.PetServiceImpl; +import org.openapitools.server.api.StoreServiceImpl; +import org.openapitools.server.api.UserServiceImpl; + +import io.helidon.logging.common.LogConfig; +import io.helidon.config.Config; +import io.helidon.webserver.http.HttpRouting; +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 WebServer startServer() { + + // load logging configuration + LogConfig.configureRuntime(); + + // By default this will pick up application.yaml from the classpath + Config config = Config.create(); + Config.global(config); + + WebServer webserver = WebServer.builder() + .config(config.get("server")) + .routing(Main::routing) + .build() + .start(); + + System.out.println("WEB server is up! http://petstore.swagger.io:80/v2"); + + return webserver; + } + + /** + * Updates HTTP routing and implicitly registers observe providers. + */ + static void routing(HttpRouting.Builder routing) { + routing + .register("/another-fake/dummy", new AnotherFakeServiceImpl()) + .register("/fake", new FakeServiceImpl()) + .register("/fake_classname_test", new FakeClassnameTestServiceImpl()) + .register("/foo", new FooServiceImpl()) + .register("/pet", new PetServiceImpl()) + .register("/store", new StoreServiceImpl()) + .register("/user", new UserServiceImpl()); + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/RFC3339DateFormat.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/RFC3339DateFormat.java new file mode 100644 index 000000000000..f47f2f7f9837 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/AnotherFakeService.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/AnotherFakeService.java new file mode 100644 index 000000000000..8891d3e2609e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/AnotherFakeService.java @@ -0,0 +1,185 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'another_fake'", + version = "stable") +public abstract class AnotherFakeService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected Call123testSpecialTagsOp call123testSpecialTagsOp = createCall123testSpecialTagsOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.patch("/", this::call123testSpecialTags); + } + + + /** + * PATCH /another-fake/dummy : To test special tags. + * + * @param request the server request + * @param response the server response + */ + protected void call123testSpecialTags(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Client + Client client = call123testSpecialTagsOp.client(request, validator); + validator.require("client", client); + + validator.execute(); + + handleCall123testSpecialTags(request, response, + client); + } + + /** + * Handle PATCH /another-fake/dummy : To test special tags. + * + * @param request the server request + * @param response the server response + * @param client client model + */ + protected abstract void handleCall123testSpecialTags(ServerRequest request, ServerResponse response, + Client client); + + /** + * Returns a new instance of the class which handles parameters to and responses from the call123testSpecialTags operation. + *

+ * Developers can override this method if they extend the AnotherFakeService class. + *

+ * + * @return new Call123testSpecialTags + */ + protected Call123testSpecialTagsOp createCall123testSpecialTagsOp() { + return new Call123testSpecialTagsOp(); + } + + /** + * Helper elements for the {@code call123testSpecialTags} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class Call123testSpecialTagsOp { + + /** + * Prepares the client parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return client parameter value + */ + protected Client client(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Client.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Client response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the call123testSpecialTags operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Client response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Client response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service AnotherFakeService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java new file mode 100644 index 000000000000..0b96717f4294 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java @@ -0,0 +1,19 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class AnotherFakeServiceImpl extends AnotherFakeService { + + @Override + protected void handleCall123testSpecialTags(ServerRequest request, ServerResponse response, + Client client) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FakeClassnameTestService.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FakeClassnameTestService.java new file mode 100644 index 000000000000..8b670b9e28d8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FakeClassnameTestService.java @@ -0,0 +1,185 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'fake_classname_test'", + version = "stable") +public abstract class FakeClassnameTestService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected TestClassnameOp testClassnameOp = createTestClassnameOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.patch("/", this::testClassname); + } + + + /** + * PATCH /fake_classname_test : To test class name in snake case. + * + * @param request the server request + * @param response the server response + */ + protected void testClassname(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Client + Client client = testClassnameOp.client(request, validator); + validator.require("client", client); + + validator.execute(); + + handleTestClassname(request, response, + client); + } + + /** + * Handle 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 + */ + protected abstract void handleTestClassname(ServerRequest request, ServerResponse response, + Client client); + + /** + * Returns a new instance of the class which handles parameters to and responses from the testClassname operation. + *

+ * Developers can override this method if they extend the FakeClassnameTestService class. + *

+ * + * @return new TestClassname + */ + protected TestClassnameOp createTestClassnameOp() { + return new TestClassnameOp(); + } + + /** + * Helper elements for the {@code testClassname} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestClassnameOp { + + /** + * Prepares the client parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return client parameter value + */ + protected Client client(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Client.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Client response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the testClassname operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Client response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Client response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service FakeClassnameTestService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FakeClassnameTestServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FakeClassnameTestServiceImpl.java new file mode 100644 index 000000000000..f16bcc6f4941 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FakeClassnameTestServiceImpl.java @@ -0,0 +1,19 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class FakeClassnameTestServiceImpl extends FakeClassnameTestService { + + @Override + protected void handleTestClassname(ServerRequest request, ServerResponse response, + Client client) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FakeService.java new file mode 100644 index 000000000000..6caa30314595 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FakeService.java @@ -0,0 +1,4083 @@ +package org.openapitools.server.api; + +import java.util.ArrayList; +import java.math.BigDecimal; +import org.openapitools.server.model.ChildWithNullable; +import org.openapitools.server.model.Client; +import java.util.stream.Collectors; +import org.openapitools.server.model.EnumClass; +import org.openapitools.server.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.server.model.FileSchemaTestClass; +import java.nio.file.Files; +import org.openapitools.server.model.GenericTypes; +import java.util.HashMap; +import io.helidon.http.HeaderNames; +import io.helidon.http.Headers; +import org.openapitools.server.model.HealthCheckResult; +import java.util.HexFormat; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.server.model.ModelApiResponse; +import io.helidon.http.media.multipart.MultiPart; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Objects; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.server.model.OuterComposite; +import org.openapitools.server.model.OuterObjectWithEnumProperty; +import io.helidon.common.parameters.Parameters; +import java.nio.file.Path; +import org.openapitools.server.model.Pet; +import io.helidon.http.media.multipart.ReadablePart; +import io.helidon.http.Status; +import org.openapitools.server.model.TestInlineFreeformAdditionalPropertiesRequest; +import java.io.UncheckedIOException; +import org.openapitools.server.model.User; +import io.helidon.common.mapper.Value; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'fake'", + version = "stable") +public abstract class FakeService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected FakeBigDecimalMapOp fakeBigDecimalMapOp = createFakeBigDecimalMapOp(); + protected FakeHealthGetOp fakeHealthGetOp = createFakeHealthGetOp(); + protected FakeHttpSignatureTestOp fakeHttpSignatureTestOp = createFakeHttpSignatureTestOp(); + protected FakeOuterBooleanSerializeOp fakeOuterBooleanSerializeOp = createFakeOuterBooleanSerializeOp(); + protected FakeOuterCompositeSerializeOp fakeOuterCompositeSerializeOp = createFakeOuterCompositeSerializeOp(); + protected FakeOuterNumberSerializeOp fakeOuterNumberSerializeOp = createFakeOuterNumberSerializeOp(); + protected FakeOuterStringSerializeOp fakeOuterStringSerializeOp = createFakeOuterStringSerializeOp(); + protected FakePropertyEnumIntegerSerializeOp fakePropertyEnumIntegerSerializeOp = createFakePropertyEnumIntegerSerializeOp(); + protected TestAdditionalPropertiesReferenceOp testAdditionalPropertiesReferenceOp = createTestAdditionalPropertiesReferenceOp(); + protected TestBodyWithBinaryOp testBodyWithBinaryOp = createTestBodyWithBinaryOp(); + protected TestBodyWithFileSchemaOp testBodyWithFileSchemaOp = createTestBodyWithFileSchemaOp(); + protected TestBodyWithQueryParamsOp testBodyWithQueryParamsOp = createTestBodyWithQueryParamsOp(); + protected TestClientModelOp testClientModelOp = createTestClientModelOp(); + protected TestEndpointParametersOp testEndpointParametersOp = createTestEndpointParametersOp(); + protected TestEnumParametersOp testEnumParametersOp = createTestEnumParametersOp(); + protected TestGroupParametersOp testGroupParametersOp = createTestGroupParametersOp(); + protected TestInlineAdditionalPropertiesOp testInlineAdditionalPropertiesOp = createTestInlineAdditionalPropertiesOp(); + protected TestInlineFreeformAdditionalPropertiesOp testInlineFreeformAdditionalPropertiesOp = createTestInlineFreeformAdditionalPropertiesOp(); + protected TestJsonFormDataOp testJsonFormDataOp = createTestJsonFormDataOp(); + protected TestNullableOp testNullableOp = createTestNullableOp(); + protected TestQueryParameterCollectionFormatOp testQueryParameterCollectionFormatOp = createTestQueryParameterCollectionFormatOp(); + protected TestStringMapReferenceOp testStringMapReferenceOp = createTestStringMapReferenceOp(); + protected UploadFileWithRequiredFileOp uploadFileWithRequiredFileOp = createUploadFileWithRequiredFileOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.get("/BigDecimalMap", this::fakeBigDecimalMap); + rules.get("/health", this::fakeHealthGet); + rules.get("/http-signature-test", this::fakeHttpSignatureTest); + rules.post("/outer/boolean", this::fakeOuterBooleanSerialize); + rules.post("/outer/composite", this::fakeOuterCompositeSerialize); + rules.post("/outer/number", this::fakeOuterNumberSerialize); + rules.post("/outer/string", this::fakeOuterStringSerialize); + rules.post("/property/enum-int", this::fakePropertyEnumIntegerSerialize); + rules.post("/additionalProperties-reference", this::testAdditionalPropertiesReference); + rules.put("/body-with-binary", this::testBodyWithBinary); + rules.put("/body-with-file-schema", this::testBodyWithFileSchema); + rules.put("/body-with-query-params", this::testBodyWithQueryParams); + rules.patch("/", this::testClientModel); + rules.post("/", this::testEndpointParameters); + rules.get("/", this::testEnumParameters); + rules.delete("/", this::testGroupParameters); + rules.post("/inline-additionalProperties", this::testInlineAdditionalProperties); + rules.post("/inline-freeform-additionalProperties", this::testInlineFreeformAdditionalProperties); + rules.get("/jsonFormData", this::testJsonFormData); + rules.post("/nullable", this::testNullable); + rules.put("/test-query-parameters", this::testQueryParameterCollectionFormat); + rules.post("/stringMap-reference", this::testStringMapReference); + rules.post("/{petId}/uploadImageWithRequiredFile", this::uploadFileWithRequiredFile); + } + + + /** + * GET /fake/BigDecimalMap. + * + * @param request the server request + * @param response the server response + */ + protected void fakeBigDecimalMap(ServerRequest request, ServerResponse response) { + + handleFakeBigDecimalMap(request, response); + } + + /** + * Handle GET /fake/BigDecimalMap. + * + * @param request the server request + * @param response the server response + */ + protected abstract void handleFakeBigDecimalMap(ServerRequest request, ServerResponse response); + + /** + * GET /fake/health : Health check endpoint. + * + * @param request the server request + * @param response the server response + */ + protected void fakeHealthGet(ServerRequest request, ServerResponse response) { + + handleFakeHealthGet(request, response); + } + + /** + * Handle GET /fake/health : Health check endpoint. + * + * @param request the server request + * @param response the server response + */ + protected abstract void handleFakeHealthGet(ServerRequest request, ServerResponse response); + + /** + * GET /fake/http-signature-test : test http signature authentication. + * + * @param request the server request + * @param response the server response + */ + protected void fakeHttpSignatureTest(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Pet + Pet pet = fakeHttpSignatureTestOp.pet(request, validator); + validator.require("pet", pet); + + + // Parameter: query_1 + Optional query1 = fakeHttpSignatureTestOp.query1(request, validator); + + + // Parameter: header_1 + Optional header1 = fakeHttpSignatureTestOp.header1(request, validator); + + validator.execute(); + + handleFakeHttpSignatureTest(request, response, + pet, + query1, + header1); + } + + /** + * Handle 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 + * @param query1 query parameter + * @param header1 header parameter + */ + protected abstract void handleFakeHttpSignatureTest(ServerRequest request, ServerResponse response, + Pet pet, + Optional query1, + Optional header1); + + /** + * POST /fake/outer/boolean. + * + * @param request the server request + * @param response the server response + */ + protected void fakeOuterBooleanSerialize(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: body + Optional body = fakeOuterBooleanSerializeOp.body(request, validator); + + validator.execute(); + + handleFakeOuterBooleanSerialize(request, response, + body); + } + + /** + * Handle POST /fake/outer/boolean. + * + * @param request the server request + * @param response the server response + * @param body Input boolean as post body + */ + protected abstract void handleFakeOuterBooleanSerialize(ServerRequest request, ServerResponse response, + Optional body); + + /** + * POST /fake/outer/composite. + * + * @param request the server request + * @param response the server response + */ + protected void fakeOuterCompositeSerialize(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: OuterComposite + Optional outerComposite = fakeOuterCompositeSerializeOp.outerComposite(request, validator); + + validator.execute(); + + handleFakeOuterCompositeSerialize(request, response, + outerComposite); + } + + /** + * Handle POST /fake/outer/composite. + * + * @param request the server request + * @param response the server response + * @param outerComposite Input composite as post body + */ + protected abstract void handleFakeOuterCompositeSerialize(ServerRequest request, ServerResponse response, + Optional outerComposite); + + /** + * POST /fake/outer/number. + * + * @param request the server request + * @param response the server response + */ + protected void fakeOuterNumberSerialize(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: body + Optional body = fakeOuterNumberSerializeOp.body(request, validator); + + validator.execute(); + + handleFakeOuterNumberSerialize(request, response, + body); + } + + /** + * Handle POST /fake/outer/number. + * + * @param request the server request + * @param response the server response + * @param body Input number as post body + */ + protected abstract void handleFakeOuterNumberSerialize(ServerRequest request, ServerResponse response, + Optional body); + + /** + * POST /fake/outer/string. + * + * @param request the server request + * @param response the server response + */ + protected void fakeOuterStringSerialize(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: body + Optional body = fakeOuterStringSerializeOp.body(request, validator); + + validator.execute(); + + handleFakeOuterStringSerialize(request, response, + body); + } + + /** + * Handle POST /fake/outer/string. + * + * @param request the server request + * @param response the server response + * @param body Input string as post body + */ + protected abstract void handleFakeOuterStringSerialize(ServerRequest request, ServerResponse response, + Optional body); + + /** + * POST /fake/property/enum-int. + * + * @param request the server request + * @param response the server response + */ + protected void fakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: OuterObjectWithEnumProperty + OuterObjectWithEnumProperty outerObjectWithEnumProperty = fakePropertyEnumIntegerSerializeOp.outerObjectWithEnumProperty(request, validator); + validator.require("outerObjectWithEnumProperty", outerObjectWithEnumProperty); + + validator.execute(); + + handleFakePropertyEnumIntegerSerialize(request, response, + outerObjectWithEnumProperty); + } + + /** + * Handle POST /fake/property/enum-int. + * + * @param request the server request + * @param response the server response + * @param outerObjectWithEnumProperty Input enum (int) as post body + */ + protected abstract void handleFakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response, + OuterObjectWithEnumProperty outerObjectWithEnumProperty); + + /** + * POST /fake/additionalProperties-reference : test referenced additionalProperties. + * + * @param request the server request + * @param response the server response + */ + protected void testAdditionalPropertiesReference(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: request_body + Map requestBody = testAdditionalPropertiesReferenceOp.requestBody(request, validator); + validator.require("requestBody", requestBody); + + validator.execute(); + + handleTestAdditionalPropertiesReference(request, response, + requestBody); + } + + /** + * Handle POST /fake/additionalProperties-reference : test referenced additionalProperties. + * + * @param request the server request + * @param response the server response + * @param requestBody request body + */ + protected abstract void handleTestAdditionalPropertiesReference(ServerRequest request, ServerResponse response, + Map requestBody); + + /** + * PUT /fake/body-with-binary. + * + * @param request the server request + * @param response the server response + */ + protected void testBodyWithBinary(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: body + InputStream body = testBodyWithBinaryOp.body(request, validator); + validator.require("body", body); + + validator.execute(); + + handleTestBodyWithBinary(request, response, + body); + } + + /** + * Handle PUT /fake/body-with-binary. + * + * @param request the server request + * @param response the server response + * @param body image to upload + */ + protected abstract void handleTestBodyWithBinary(ServerRequest request, ServerResponse response, + InputStream body); + + /** + * PUT /fake/body-with-file-schema. + * + * @param request the server request + * @param response the server response + */ + protected void testBodyWithFileSchema(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: FileSchemaTestClass + FileSchemaTestClass fileSchemaTestClass = testBodyWithFileSchemaOp.fileSchemaTestClass(request, validator); + validator.require("fileSchemaTestClass", fileSchemaTestClass); + + validator.execute(); + + handleTestBodyWithFileSchema(request, response, + fileSchemaTestClass); + } + + /** + * Handle PUT /fake/body-with-file-schema. + * + * @param request the server request + * @param response the server response + * @param fileSchemaTestClass fileSchemaTestClass + */ + protected abstract void handleTestBodyWithFileSchema(ServerRequest request, ServerResponse response, + FileSchemaTestClass fileSchemaTestClass); + + /** + * PUT /fake/body-with-query-params. + * + * @param request the server request + * @param response the server response + */ + protected void testBodyWithQueryParams(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: query + String query = testBodyWithQueryParamsOp.query(request, validator); + + validator.require("query", query); + + // Parameter: User + User user = testBodyWithQueryParamsOp.user(request, validator); + validator.require("user", user); + + validator.execute(); + + handleTestBodyWithQueryParams(request, response, + query, + user); + } + + /** + * Handle PUT /fake/body-with-query-params. + * + * @param request the server request + * @param response the server response + * @param query query + * @param user user + */ + protected abstract void handleTestBodyWithQueryParams(ServerRequest request, ServerResponse response, + String query, + User user); + + /** + * PATCH /fake : To test \"client\" model. + * + * @param request the server request + * @param response the server response + */ + protected void testClientModel(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Client + Client client = testClientModelOp.client(request, validator); + validator.require("client", client); + + validator.execute(); + + handleTestClientModel(request, response, + client); + } + + /** + * Handle PATCH /fake : To test \"client\" model. + * + * @param request the server request + * @param response the server response + * @param client client model + */ + protected abstract void handleTestClientModel(ServerRequest request, ServerResponse response, + Client client); + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 . + * + * @param request the server request + * @param response the server response + */ + protected void testEndpointParameters(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + + Parameters formParams = request.content().as(Parameters.class); + + // Parameter: number + BigDecimal number = testEndpointParametersOp.number(request, formParams, validator); + + validator.require("number", number); + validator.validateMin("number", number, "32.1", true); + validator.validateMax("number", number, "543.2", true); + + // Parameter: double + Double _double = testEndpointParametersOp._double(request, formParams, validator); + + validator.require("_double", _double); + validator.validateMin("_double", _double, 67.8d, true); + validator.validateMax("_double", _double, 123.4d, true); + + // Parameter: pattern_without_delimiter + String patternWithoutDelimiter = testEndpointParametersOp.patternWithoutDelimiter(request, formParams, validator); + + validator.require("patternWithoutDelimiter", patternWithoutDelimiter); validator.validatePattern("patternWithoutDelimiter", patternWithoutDelimiter, "^[A-Z].*"); + + // Parameter: byte + byte[] _byte = testEndpointParametersOp._byte(request, formParams, validator); + + validator.require("_byte", _byte); + + // Parameter: integer + Optional integer = testEndpointParametersOp.integer(request, formParams, validator); + + validator.validateMin("integer", integer, 10, true); + validator.validateMax("integer", integer, 100, true); + + // Parameter: int32 + Optional int32 = testEndpointParametersOp.int32(request, formParams, validator); + + validator.validateMin("int32", int32, 20, true); + validator.validateMax("int32", int32, 200, true); + + // Parameter: int64 + Optional int64 = testEndpointParametersOp.int64(request, formParams, validator); + + + // Parameter: float + Optional _float = testEndpointParametersOp._float(request, formParams, validator); + + validator.validateMax("_float", _float, 987.6f, true); + + // Parameter: string + Optional string = testEndpointParametersOp.string(request, formParams, validator); + validator.validatePattern("string", string, "/[a-z]/i"); + + // Parameter: binary + Optional binary = testEndpointParametersOp.binary(request, formParams, validator); + + + // Parameter: date + Optional date = testEndpointParametersOp.date(request, formParams, validator); + + + // Parameter: dateTime + Optional dateTime = testEndpointParametersOp.dateTime(request, formParams, validator); + + + // Parameter: password + Optional password = testEndpointParametersOp.password(request, formParams, validator); + + validator.validateSize("password", password, 10, 64); + + // Parameter: callback + Optional paramCallback = testEndpointParametersOp.paramCallback(request, formParams, validator); + + validator.execute(); + + handleTestEndpointParameters(request, response, + number, + _double, + patternWithoutDelimiter, + _byte, + integer, + int32, + int64, + _float, + string, + binary, + date, + dateTime, + password, + paramCallback); + } + + /** + * Handle POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 . + * + * @param request the server request + * @param response the server response + * @param number None + * @param _double None + * @param patternWithoutDelimiter None + * @param _byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param _float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param paramCallback None + */ + protected abstract void handleTestEndpointParameters(ServerRequest request, ServerResponse response, + BigDecimal number, + Double _double, + String patternWithoutDelimiter, + byte[] _byte, + Optional integer, + Optional int32, + Optional int64, + Optional _float, + Optional string, + Optional binary, + Optional date, + Optional dateTime, + Optional password, + Optional paramCallback); + + /** + * GET /fake : To test enum parameters. + * + * @param request the server request + * @param response the server response + */ + protected void testEnumParameters(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + + Parameters formParams = request.content().as(Parameters.class); + + // Parameter: enum_header_string_array + List enumHeaderStringArray = testEnumParametersOp.enumHeaderStringArray(request, validator); + + + // Parameter: enum_header_string + Optional enumHeaderString = testEnumParametersOp.enumHeaderString(request, validator); + + + // Parameter: enum_query_string_array + List enumQueryStringArray = testEnumParametersOp.enumQueryStringArray(request, validator); + + + // Parameter: enum_query_string + Optional enumQueryString = testEnumParametersOp.enumQueryString(request, validator); + + + // Parameter: enum_query_integer + Optional enumQueryInteger = testEnumParametersOp.enumQueryInteger(request, validator); + + + // Parameter: enum_query_double + Optional enumQueryDouble = testEnumParametersOp.enumQueryDouble(request, validator); + + + // Parameter: enum_query_model_array + List enumQueryModelArray = testEnumParametersOp.enumQueryModelArray(request, validator); + + + // Parameter: enum_form_string_array + List enumFormStringArray = testEnumParametersOp.enumFormStringArray(request, formParams, validator); + + + // Parameter: enum_form_string + Optional enumFormString = testEnumParametersOp.enumFormString(request, formParams, validator); + + validator.execute(); + + handleTestEnumParameters(request, response, + enumHeaderStringArray, + enumHeaderString, + enumQueryStringArray, + enumQueryString, + enumQueryInteger, + enumQueryDouble, + enumQueryModelArray, + enumFormStringArray, + enumFormString); + } + + /** + * Handle GET /fake : To test enum parameters. + * + * @param request the server request + * @param response the server response + * @param enumHeaderStringArray Header parameter enum test (string array) + * @param enumHeaderString Header parameter enum test (string) + * @param enumQueryStringArray Query parameter enum test (string array) + * @param enumQueryString Query parameter enum test (string) + * @param enumQueryInteger Query parameter enum test (double) + * @param enumQueryDouble Query parameter enum test (double) + * @param enumQueryModelArray enumQueryModelArray + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + */ + protected abstract void handleTestEnumParameters(ServerRequest request, ServerResponse response, + List enumHeaderStringArray, + Optional enumHeaderString, + List enumQueryStringArray, + Optional enumQueryString, + Optional enumQueryInteger, + Optional enumQueryDouble, + List enumQueryModelArray, + List enumFormStringArray, + Optional enumFormString); + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional). + * + * @param request the server request + * @param response the server response + */ + protected void testGroupParameters(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: required_string_group + Integer requiredStringGroup = testGroupParametersOp.requiredStringGroup(request, validator); + + validator.require("requiredStringGroup", requiredStringGroup); + + // Parameter: required_boolean_group + Boolean requiredBooleanGroup = testGroupParametersOp.requiredBooleanGroup(request, validator); + + validator.require("requiredBooleanGroup", requiredBooleanGroup); + + // Parameter: required_int64_group + Long requiredInt64Group = testGroupParametersOp.requiredInt64Group(request, validator); + + validator.require("requiredInt64Group", requiredInt64Group); + + // Parameter: string_group + Optional stringGroup = testGroupParametersOp.stringGroup(request, validator); + + + // Parameter: boolean_group + Optional booleanGroup = testGroupParametersOp.booleanGroup(request, validator); + + + // Parameter: int64_group + Optional int64Group = testGroupParametersOp.int64Group(request, validator); + + validator.execute(); + + handleTestGroupParameters(request, response, + requiredStringGroup, + requiredBooleanGroup, + requiredInt64Group, + stringGroup, + booleanGroup, + int64Group); + } + + /** + * Handle DELETE /fake : Fake endpoint to test group parameters (optional). + * + * @param request the server request + * @param response the server response + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters + * @param booleanGroup Boolean in group parameters + * @param int64Group Integer in group parameters + */ + protected abstract void handleTestGroupParameters(ServerRequest request, ServerResponse response, + Integer requiredStringGroup, + Boolean requiredBooleanGroup, + Long requiredInt64Group, + Optional stringGroup, + Optional booleanGroup, + Optional int64Group); + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties. + * + * @param request the server request + * @param response the server response + */ + protected void testInlineAdditionalProperties(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: request_body + Map requestBody = testInlineAdditionalPropertiesOp.requestBody(request, validator); + validator.require("requestBody", requestBody); + + validator.execute(); + + handleTestInlineAdditionalProperties(request, response, + requestBody); + } + + /** + * Handle POST /fake/inline-additionalProperties : test inline additionalProperties. + * + * @param request the server request + * @param response the server response + * @param requestBody request body + */ + protected abstract void handleTestInlineAdditionalProperties(ServerRequest request, ServerResponse response, + Map requestBody); + + /** + * POST /fake/inline-freeform-additionalProperties : test inline free-form additionalProperties. + * + * @param request the server request + * @param response the server response + */ + protected void testInlineFreeformAdditionalProperties(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: TestInlineFreeformAdditionalPropertiesRequest + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = testInlineFreeformAdditionalPropertiesOp.testInlineFreeformAdditionalPropertiesRequest(request, validator); + validator.require("testInlineFreeformAdditionalPropertiesRequest", testInlineFreeformAdditionalPropertiesRequest); + + validator.execute(); + + handleTestInlineFreeformAdditionalProperties(request, response, + testInlineFreeformAdditionalPropertiesRequest); + } + + /** + * Handle POST /fake/inline-freeform-additionalProperties : test inline free-form additionalProperties. + * + * @param request the server request + * @param response the server response + * @param testInlineFreeformAdditionalPropertiesRequest request body + */ + protected abstract void handleTestInlineFreeformAdditionalProperties(ServerRequest request, ServerResponse response, + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /** + * GET /fake/jsonFormData : test json serialization of form data. + * + * @param request the server request + * @param response the server response + */ + protected void testJsonFormData(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + + Parameters formParams = request.content().as(Parameters.class); + + // Parameter: param + String param = testJsonFormDataOp.param(request, formParams, validator); + + validator.require("param", param); + + // Parameter: param2 + String param2 = testJsonFormDataOp.param2(request, formParams, validator); + + validator.require("param2", param2); + validator.execute(); + + handleTestJsonFormData(request, response, + param, + param2); + } + + /** + * Handle GET /fake/jsonFormData : test json serialization of form data. + * + * @param request the server request + * @param response the server response + * @param param field1 + * @param param2 field2 + */ + protected abstract void handleTestJsonFormData(ServerRequest request, ServerResponse response, + String param, + String param2); + + /** + * POST /fake/nullable : test nullable parent property. + * + * @param request the server request + * @param response the server response + */ + protected void testNullable(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: ChildWithNullable + ChildWithNullable childWithNullable = testNullableOp.childWithNullable(request, validator); + validator.require("childWithNullable", childWithNullable); + + validator.execute(); + + handleTestNullable(request, response, + childWithNullable); + } + + /** + * Handle POST /fake/nullable : test nullable parent property. + * + * @param request the server request + * @param response the server response + * @param childWithNullable request body + */ + protected abstract void handleTestNullable(ServerRequest request, ServerResponse response, + ChildWithNullable childWithNullable); + + /** + * PUT /fake/test-query-parameters. + * + * @param request the server request + * @param response the server response + */ + protected void testQueryParameterCollectionFormat(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: pipe + List pipe = testQueryParameterCollectionFormatOp.pipe(request, validator); + + validator.require("pipe", pipe); + + // Parameter: ioutil + List ioutil = testQueryParameterCollectionFormatOp.ioutil(request, validator); + + validator.require("ioutil", ioutil); + + // Parameter: http + List http = testQueryParameterCollectionFormatOp.http(request, validator); + + validator.require("http", http); + + // Parameter: url + List url = testQueryParameterCollectionFormatOp.url(request, validator); + + validator.require("url", url); + + // Parameter: context + List context = testQueryParameterCollectionFormatOp.context(request, validator); + + validator.require("context", context); + + // Parameter: allowEmpty + String allowEmpty = testQueryParameterCollectionFormatOp.allowEmpty(request, validator); + + validator.require("allowEmpty", allowEmpty); + + // Parameter: language + Map language = testQueryParameterCollectionFormatOp.language(request, validator); + + validator.execute(); + + handleTestQueryParameterCollectionFormat(request, response, + pipe, + ioutil, + http, + url, + context, + allowEmpty, + language); + } + + /** + * Handle PUT /fake/test-query-parameters. + * + * @param request the server request + * @param response the server response + * @param pipe pipe + * @param ioutil ioutil + * @param http http + * @param url url + * @param context context + * @param allowEmpty allowEmpty + * @param language language + */ + protected abstract void handleTestQueryParameterCollectionFormat(ServerRequest request, ServerResponse response, + List pipe, + List ioutil, + List http, + List url, + List context, + String allowEmpty, + Map language); + + /** + * POST /fake/stringMap-reference : test referenced string map. + * + * @param request the server request + * @param response the server response + */ + protected void testStringMapReference(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: request_body + Map requestBody = testStringMapReferenceOp.requestBody(request, validator); + validator.require("requestBody", requestBody); + + validator.execute(); + + handleTestStringMapReference(request, response, + requestBody); + } + + /** + * Handle POST /fake/stringMap-reference : test referenced string map. + * + * @param request the server request + * @param response the server response + * @param requestBody request body + */ + protected abstract void handleTestStringMapReference(ServerRequest request, ServerResponse response, + Map requestBody); + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required). + * + * @param request the server request + * @param response the server response + */ + protected void uploadFileWithRequiredFile(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + + Map parts = PartsUtils.partsMap(request); + + // Parameter: petId + Long petId = uploadFileWithRequiredFileOp.petId(request, validator); + + validator.require("petId", petId); + + // Parameter: requiredFile + ReadablePart requiredFile = uploadFileWithRequiredFileOp.requiredFile(request, parts, validator); + + validator.require("requiredFile", requiredFile); + + // Parameter: additionalMetadata + Optional additionalMetadata = uploadFileWithRequiredFileOp.additionalMetadata(request, parts, validator); + + validator.execute(); + + handleUploadFileWithRequiredFile(request, response, + petId, + requiredFile, + additionalMetadata); + } + + /** + * Handle POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required). + * + * @param request the server request + * @param response the server response + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + */ + protected abstract void handleUploadFileWithRequiredFile(ServerRequest request, ServerResponse response, + Long petId, + ReadablePart requiredFile, + Optional additionalMetadata); + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeBigDecimalMap operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeBigDecimalMap + */ + protected FakeBigDecimalMapOp createFakeBigDecimalMapOp() { + return new FakeBigDecimalMapOp(); + } + + /** + * Helper elements for the {@code fakeBigDecimalMap} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeBigDecimalMapOp { + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(FakeBigDecimalMap200Response response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeBigDecimalMap operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private FakeBigDecimalMap200Response response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(FakeBigDecimalMap200Response response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeHealthGet operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeHealthGet + */ + protected FakeHealthGetOp createFakeHealthGetOp() { + return new FakeHealthGetOp(); + } + + /** + * Helper elements for the {@code fakeHealthGet} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeHealthGetOp { + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(HealthCheckResult response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeHealthGet operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private HealthCheckResult response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(HealthCheckResult response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeHttpSignatureTest operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeHttpSignatureTest + */ + protected FakeHttpSignatureTestOp createFakeHttpSignatureTestOp() { + return new FakeHttpSignatureTestOp(); + } + + /** + * Helper elements for the {@code fakeHttpSignatureTest} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeHttpSignatureTestOp { + + /** + * Prepares the pet parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return pet parameter value + */ + protected Pet pet(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Pet.class) + : null; + } + + /** + * Prepares the query1 parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return query1 parameter value + */ + protected Optional query1(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("query_1") + .asOptional(); + } + + /** + * Prepares the header1 parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return header1 parameter value + */ + protected Optional header1(ServerRequest request, ValidatorUtils.Validator validator) { + return request.headers() + .first(HeaderNames.create("header_1")); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeHttpSignatureTest operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeOuterBooleanSerialize operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeOuterBooleanSerialize + */ + protected FakeOuterBooleanSerializeOp createFakeOuterBooleanSerializeOp() { + return new FakeOuterBooleanSerializeOp(); + } + + /** + * Helper elements for the {@code fakeOuterBooleanSerialize} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeOuterBooleanSerializeOp { + + /** + * Prepares the body parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return body parameter value + */ + protected Optional body(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? Optional.of(request.content().as(Boolean.class)) + : Optional.empty(); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Boolean response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeOuterBooleanSerialize operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Boolean response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Boolean response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeOuterCompositeSerialize operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeOuterCompositeSerialize + */ + protected FakeOuterCompositeSerializeOp createFakeOuterCompositeSerializeOp() { + return new FakeOuterCompositeSerializeOp(); + } + + /** + * Helper elements for the {@code fakeOuterCompositeSerialize} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeOuterCompositeSerializeOp { + + /** + * Prepares the outerComposite parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return outerComposite parameter value + */ + protected Optional outerComposite(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? Optional.of(request.content().as(OuterComposite.class)) + : Optional.empty(); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(OuterComposite response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeOuterCompositeSerialize operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private OuterComposite response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(OuterComposite response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeOuterNumberSerialize operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeOuterNumberSerialize + */ + protected FakeOuterNumberSerializeOp createFakeOuterNumberSerializeOp() { + return new FakeOuterNumberSerializeOp(); + } + + /** + * Helper elements for the {@code fakeOuterNumberSerialize} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeOuterNumberSerializeOp { + + /** + * Prepares the body parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return body parameter value + */ + protected Optional body(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? Optional.of(request.content().as(BigDecimal.class)) + : Optional.empty(); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(BigDecimal response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeOuterNumberSerialize operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private BigDecimal response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(BigDecimal response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeOuterStringSerialize operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeOuterStringSerialize + */ + protected FakeOuterStringSerializeOp createFakeOuterStringSerializeOp() { + return new FakeOuterStringSerializeOp(); + } + + /** + * Helper elements for the {@code fakeOuterStringSerialize} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeOuterStringSerializeOp { + + /** + * Prepares the body parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return body parameter value + */ + protected Optional body(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? Optional.of(request.content().as(String.class)) + : Optional.empty(); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(String response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeOuterStringSerialize operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private String response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(String response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakePropertyEnumIntegerSerialize operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakePropertyEnumIntegerSerialize + */ + protected FakePropertyEnumIntegerSerializeOp createFakePropertyEnumIntegerSerializeOp() { + return new FakePropertyEnumIntegerSerializeOp(); + } + + /** + * Helper elements for the {@code fakePropertyEnumIntegerSerialize} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakePropertyEnumIntegerSerializeOp { + + /** + * Prepares the outerObjectWithEnumProperty parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return outerObjectWithEnumProperty parameter value + */ + protected OuterObjectWithEnumProperty outerObjectWithEnumProperty(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(OuterObjectWithEnumProperty.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(OuterObjectWithEnumProperty response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakePropertyEnumIntegerSerialize operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private OuterObjectWithEnumProperty response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(OuterObjectWithEnumProperty response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testAdditionalPropertiesReference operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestAdditionalPropertiesReference + */ + protected TestAdditionalPropertiesReferenceOp createTestAdditionalPropertiesReferenceOp() { + return new TestAdditionalPropertiesReferenceOp(); + } + + /** + * Helper elements for the {@code testAdditionalPropertiesReference} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestAdditionalPropertiesReferenceOp { + + /** + * Prepares the requestBody parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requestBody parameter value + */ + protected Map requestBody(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(GenericTypes.TYPE__Map_Object) + : Map.of(); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testAdditionalPropertiesReference operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testBodyWithBinary operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestBodyWithBinary + */ + protected TestBodyWithBinaryOp createTestBodyWithBinaryOp() { + return new TestBodyWithBinaryOp(); + } + + /** + * Helper elements for the {@code testBodyWithBinary} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestBodyWithBinaryOp { + + /** + * Prepares the body parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return body parameter value + */ + protected InputStream body(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().inputStream() + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testBodyWithBinary operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testBodyWithFileSchema operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestBodyWithFileSchema + */ + protected TestBodyWithFileSchemaOp createTestBodyWithFileSchemaOp() { + return new TestBodyWithFileSchemaOp(); + } + + /** + * Helper elements for the {@code testBodyWithFileSchema} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestBodyWithFileSchemaOp { + + /** + * Prepares the fileSchemaTestClass parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return fileSchemaTestClass parameter value + */ + protected FileSchemaTestClass fileSchemaTestClass(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(FileSchemaTestClass.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testBodyWithFileSchema operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testBodyWithQueryParams operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestBodyWithQueryParams + */ + protected TestBodyWithQueryParamsOp createTestBodyWithQueryParamsOp() { + return new TestBodyWithQueryParamsOp(); + } + + /** + * Helper elements for the {@code testBodyWithQueryParams} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestBodyWithQueryParamsOp { + + /** + * Prepares the query parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return query parameter value + */ + protected String query(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("query") + .asOptional() + .orElse(null); + } + + /** + * Prepares the user parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return user parameter value + */ + protected User user(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(User.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testBodyWithQueryParams operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testClientModel operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestClientModel + */ + protected TestClientModelOp createTestClientModelOp() { + return new TestClientModelOp(); + } + + /** + * Helper elements for the {@code testClientModel} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestClientModelOp { + + /** + * Prepares the client parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return client parameter value + */ + protected Client client(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Client.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Client response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the testClientModel operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Client response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Client response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testEndpointParameters operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestEndpointParameters + */ + protected TestEndpointParametersOp createTestEndpointParametersOp() { + return new TestEndpointParametersOp(); + } + + /** + * Helper elements for the {@code testEndpointParameters} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestEndpointParametersOp { + + /** + * Prepares the number parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return number parameter value + */ + protected BigDecimal number(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("number") + .asOptional() + .map(BigDecimal::new) + .orElse(null); + } + + /** + * Prepares the _double parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return _double parameter value + */ + protected Double _double(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("double") + .asOptional() + .map(Double::valueOf) + .orElse(null); + } + + /** + * Prepares the patternWithoutDelimiter parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return patternWithoutDelimiter parameter value + */ + protected String patternWithoutDelimiter(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("pattern_without_delimiter") + .asOptional() + .orElse(null); + } + + /** + * Prepares the _byte parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return _byte parameter value + */ + protected byte[] _byte(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("byte") + .asOptional() + .map(HexFormat.of()::parseHex) + .orElse(null); + } + + /** + * Prepares the integer parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return integer parameter value + */ + protected Optional integer(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("integer") + .asOptional() + .map(Integer::valueOf); + } + + /** + * Prepares the int32 parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return int32 parameter value + */ + protected Optional int32(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("int32") + .asOptional() + .map(Integer::valueOf); + } + + /** + * Prepares the int64 parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return int64 parameter value + */ + protected Optional int64(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("int64") + .asOptional() + .map(Long::valueOf); + } + + /** + * Prepares the _float parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return _float parameter value + */ + protected Optional _float(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("float") + .asOptional() + .map(Float::valueOf); + } + + /** + * Prepares the string parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return string parameter value + */ + protected Optional string(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("string") + .asOptional(); + } + + /** + * Prepares the binary parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return binary parameter value + */ + protected Optional binary(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("binary") + .asOptional() + .map(HCollectors::decodeBinaryFormParam); + } + + /** + * Prepares the date parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return date parameter value + */ + protected Optional date(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("date") + .asOptional() + .map(LocalDate::parse); + } + + /** + * Prepares the dateTime parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return dateTime parameter value + */ + protected Optional dateTime(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("dateTime") + .asOptional() + .map(OffsetDateTime::parse); + } + + /** + * Prepares the password parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return password parameter value + */ + protected Optional password(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("password") + .asOptional(); + } + + /** + * Prepares the paramCallback parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return paramCallback parameter value + */ + protected Optional paramCallback(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("callback") + .asOptional(); + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the testEndpointParameters operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the testEndpointParameters operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testEnumParameters operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestEnumParameters + */ + protected TestEnumParametersOp createTestEnumParametersOp() { + return new TestEnumParametersOp(); + } + + /** + * Helper elements for the {@code testEnumParameters} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestEnumParametersOp { + + /** + * Prepares the enumHeaderStringArray parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumHeaderStringArray parameter value + */ + protected List enumHeaderStringArray(ServerRequest request, ValidatorUtils.Validator validator) { + return request.headers() + .values(HeaderNames.create("enum_header_string_array")) + .stream() + .map(String::valueOf) + .map(v -> validator.check("enum_header_string_array", + v, + List.of(">", + "$"))) + .collect(Collectors.toList()); + } + + /** + * Prepares the enumHeaderString parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumHeaderString parameter value + */ + protected Optional enumHeaderString(ServerRequest request, ValidatorUtils.Validator validator) { + return request.headers() + .first(HeaderNames.create("enum_header_string")) + .or(() -> Optional.of("-efg")) + .map(v -> validator.check("enum_header_string", + v, + List.of("_abc", + "-efg", + "(xyz)"))); + } + + /** + * Prepares the enumQueryStringArray parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumQueryStringArray parameter value + */ + protected List enumQueryStringArray(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("enum_query_string_array") + .stream() + .map(String::valueOf) + .map(v -> validator.check("enum_query_string_array", + v, + List.of(">", + "$"))) + .collect(Collectors.toList()); + } + + /** + * Prepares the enumQueryString parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumQueryString parameter value + */ + protected Optional enumQueryString(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("enum_query_string") + .asOptional() + .or(() -> Optional.of("-efg")) + .map(v -> validator.check("enum_query_string", + v, + List.of("_abc", + "-efg", + "(xyz)"))); + } + + /** + * Prepares the enumQueryInteger parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumQueryInteger parameter value + */ + protected Optional enumQueryInteger(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("enum_query_integer") + .asOptional() + .map(Integer::valueOf) + .map(v -> validator.check("enum_query_integer", + v, + List.of(1, + -2))); + } + + /** + * Prepares the enumQueryDouble parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumQueryDouble parameter value + */ + protected Optional enumQueryDouble(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("enum_query_double") + .asOptional() + .map(Double::valueOf) + .map(v -> validator.check("enum_query_double", + v, + List.of(1.1, + -1.2))); + } + + /** + * Prepares the enumQueryModelArray parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumQueryModelArray parameter value + */ + protected List enumQueryModelArray(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("enum_query_model_array") + .stream() + .map(EnumClass::fromValue) + .collect(Collectors.toList()); + } + + /** + * Prepares the enumFormStringArray parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumFormStringArray parameter value + */ + protected List enumFormStringArray(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .all("enum_form_string_array") + .stream() + .map(String::valueOf) + .map(v -> validator.check("enum_form_string_array", + v, + List.of(">", + "$"))) + .collect(HCollectors.toDefaultedList("$", + String::valueOf)); + } + + /** + * Prepares the enumFormString parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumFormString parameter value + */ + protected Optional enumFormString(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("enum_form_string") + .asOptional() + .or(() -> Optional.of("-efg")) + .map(v -> validator.check("enum_form_string", + v, + List.of("_abc", + "-efg", + "(xyz)"))); + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the testEnumParameters operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the testEnumParameters operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testGroupParameters operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestGroupParameters + */ + protected TestGroupParametersOp createTestGroupParametersOp() { + return new TestGroupParametersOp(); + } + + /** + * Helper elements for the {@code testGroupParameters} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestGroupParametersOp { + + /** + * Prepares the requiredStringGroup parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requiredStringGroup parameter value + */ + protected Integer requiredStringGroup(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("required_string_group") + .asOptional() + .map(Integer::valueOf) + .orElse(null); + } + + /** + * Prepares the requiredBooleanGroup parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requiredBooleanGroup parameter value + */ + protected Boolean requiredBooleanGroup(ServerRequest request, ValidatorUtils.Validator validator) { + return request.headers() + .first(HeaderNames.create("required_boolean_group")) + .map(Boolean::valueOf) + .orElse(null); + } + + /** + * Prepares the requiredInt64Group parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requiredInt64Group parameter value + */ + protected Long requiredInt64Group(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("required_int64_group") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Prepares the stringGroup parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return stringGroup parameter value + */ + protected Optional stringGroup(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("string_group") + .asOptional() + .map(Integer::valueOf); + } + + /** + * Prepares the booleanGroup parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return booleanGroup parameter value + */ + protected Optional booleanGroup(ServerRequest request, ValidatorUtils.Validator validator) { + return request.headers() + .first(HeaderNames.create("boolean_group")) + .map(Boolean::valueOf); + } + + /** + * Prepares the int64Group parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return int64Group parameter value + */ + protected Optional int64Group(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("int64_group") + .asOptional() + .map(Long::valueOf); + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the testGroupParameters operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testInlineAdditionalProperties operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestInlineAdditionalProperties + */ + protected TestInlineAdditionalPropertiesOp createTestInlineAdditionalPropertiesOp() { + return new TestInlineAdditionalPropertiesOp(); + } + + /** + * Helper elements for the {@code testInlineAdditionalProperties} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestInlineAdditionalPropertiesOp { + + /** + * Prepares the requestBody parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requestBody parameter value + */ + protected Map requestBody(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(GenericTypes.TYPE__Map_String) + : Map.of(); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testInlineAdditionalProperties operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testInlineFreeformAdditionalProperties operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestInlineFreeformAdditionalProperties + */ + protected TestInlineFreeformAdditionalPropertiesOp createTestInlineFreeformAdditionalPropertiesOp() { + return new TestInlineFreeformAdditionalPropertiesOp(); + } + + /** + * Helper elements for the {@code testInlineFreeformAdditionalProperties} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestInlineFreeformAdditionalPropertiesOp { + + /** + * Prepares the testInlineFreeformAdditionalPropertiesRequest parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return testInlineFreeformAdditionalPropertiesRequest parameter value + */ + protected TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(TestInlineFreeformAdditionalPropertiesRequest.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testInlineFreeformAdditionalProperties operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testJsonFormData operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestJsonFormData + */ + protected TestJsonFormDataOp createTestJsonFormDataOp() { + return new TestJsonFormDataOp(); + } + + /** + * Helper elements for the {@code testJsonFormData} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestJsonFormDataOp { + + /** + * Prepares the param parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return param parameter value + */ + protected String param(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("param") + .asOptional() + .orElse(null); + } + + /** + * Prepares the param2 parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return param2 parameter value + */ + protected String param2(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("param2") + .asOptional() + .orElse(null); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testJsonFormData operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testNullable operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestNullable + */ + protected TestNullableOp createTestNullableOp() { + return new TestNullableOp(); + } + + /** + * Helper elements for the {@code testNullable} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestNullableOp { + + /** + * Prepares the childWithNullable parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return childWithNullable parameter value + */ + protected ChildWithNullable childWithNullable(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(ChildWithNullable.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testNullable operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testQueryParameterCollectionFormat operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestQueryParameterCollectionFormat + */ + protected TestQueryParameterCollectionFormatOp createTestQueryParameterCollectionFormatOp() { + return new TestQueryParameterCollectionFormatOp(); + } + + /** + * Helper elements for the {@code testQueryParameterCollectionFormat} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestQueryParameterCollectionFormatOp { + + /** + * Prepares the pipe parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return pipe parameter value + */ + protected List pipe(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("pipe") + .stream() + .map(String::valueOf) + .collect(Collectors.toList()); + } + + /** + * Prepares the ioutil parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return ioutil parameter value + */ + protected List ioutil(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("ioutil") + .stream() + .map(String::valueOf) + .collect(Collectors.toList()); + } + + /** + * Prepares the http parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return http parameter value + */ + protected List http(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("http") + .stream() + .map(String::valueOf) + .collect(Collectors.toList()); + } + + /** + * Prepares the url parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return url parameter value + */ + protected List url(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("url") + .stream() + .map(String::valueOf) + .collect(Collectors.toList()); + } + + /** + * Prepares the context parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return context parameter value + */ + protected List context(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("context") + .stream() + .map(String::valueOf) + .collect(Collectors.toList()); + } + + /** + * Prepares the allowEmpty parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return allowEmpty parameter value + */ + protected String allowEmpty(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("allowEmpty") + .asOptional() + .orElse(null); + } + + /** + * Prepares the language parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return language parameter value + */ + protected Map language(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("language") + .stream() + .map(String::valueOf) + // TODO - Developer must override this method and provide the correct mapping. + .collect(HCollectors.noOpMap()); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testQueryParameterCollectionFormat operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testStringMapReference operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestStringMapReference + */ + protected TestStringMapReferenceOp createTestStringMapReferenceOp() { + return new TestStringMapReferenceOp(); + } + + /** + * Helper elements for the {@code testStringMapReference} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestStringMapReferenceOp { + + /** + * Prepares the requestBody parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requestBody parameter value + */ + protected Map requestBody(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(GenericTypes.TYPE__Map_String) + : Map.of(); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testStringMapReference operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the uploadFileWithRequiredFile operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new UploadFileWithRequiredFile + */ + protected UploadFileWithRequiredFileOp createUploadFileWithRequiredFileOp() { + return new UploadFileWithRequiredFileOp(); + } + + /** + * Helper elements for the {@code uploadFileWithRequiredFile} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class UploadFileWithRequiredFileOp { + + /** + * Prepares the petId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return petId parameter value + */ + protected Long petId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("petId") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Prepares the requiredFile parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param parts {@code Map} of part names to {@link io.helidon.http.media.multipart.ReadablePart} for each part + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requiredFile parameter value + */ + protected ReadablePart requiredFile(ServerRequest request, Map parts, ValidatorUtils.Validator validator) { + return parts.get("requiredFile"); + } + + /** + * Prepares the additionalMetadata parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param parts {@code Map} of part names to {@link io.helidon.http.media.multipart.ReadablePart} for each part + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return additionalMetadata parameter value + */ + protected Optional additionalMetadata(ServerRequest request, Map parts, ValidatorUtils.Validator validator) { + return Optional.ofNullable(parts.get("additionalMetadata")); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(ModelApiResponse response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the uploadFileWithRequiredFile operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private ModelApiResponse response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(ModelApiResponse response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service FakeService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FakeServiceImpl.java new file mode 100644 index 000000000000..e47df278f682 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -0,0 +1,243 @@ +package org.openapitools.server.api; + +import java.util.ArrayList; +import java.math.BigDecimal; +import org.openapitools.server.model.ChildWithNullable; +import org.openapitools.server.model.Client; +import java.util.stream.Collectors; +import org.openapitools.server.model.EnumClass; +import org.openapitools.server.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.server.model.FileSchemaTestClass; +import java.nio.file.Files; +import org.openapitools.server.model.GenericTypes; +import java.util.HashMap; +import io.helidon.http.HeaderNames; +import io.helidon.http.Headers; +import org.openapitools.server.model.HealthCheckResult; +import java.util.HexFormat; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.time.LocalDate; +import java.util.Map; +import org.openapitools.server.model.ModelApiResponse; +import io.helidon.http.media.multipart.MultiPart; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Objects; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.server.model.OuterComposite; +import org.openapitools.server.model.OuterObjectWithEnumProperty; +import io.helidon.common.parameters.Parameters; +import java.nio.file.Path; +import org.openapitools.server.model.Pet; +import io.helidon.http.media.multipart.ReadablePart; +import io.helidon.http.Status; +import org.openapitools.server.model.TestInlineFreeformAdditionalPropertiesRequest; +import java.io.UncheckedIOException; +import org.openapitools.server.model.User; +import io.helidon.common.mapper.Value; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class FakeServiceImpl extends FakeService { + + @Override + protected void handleFakeBigDecimalMap(ServerRequest request, ServerResponse response) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakeHealthGet(ServerRequest request, ServerResponse response) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakeHttpSignatureTest(ServerRequest request, ServerResponse response, + Pet pet, + Optional query1, + Optional header1) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakeOuterBooleanSerialize(ServerRequest request, ServerResponse response, + Optional body) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakeOuterCompositeSerialize(ServerRequest request, ServerResponse response, + Optional outerComposite) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakeOuterNumberSerialize(ServerRequest request, ServerResponse response, + Optional body) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakeOuterStringSerialize(ServerRequest request, ServerResponse response, + Optional body) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response, + OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestAdditionalPropertiesReference(ServerRequest request, ServerResponse response, + Map requestBody) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestBodyWithBinary(ServerRequest request, ServerResponse response, + InputStream body) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestBodyWithFileSchema(ServerRequest request, ServerResponse response, + FileSchemaTestClass fileSchemaTestClass) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestBodyWithQueryParams(ServerRequest request, ServerResponse response, + String query, + User user) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestClientModel(ServerRequest request, ServerResponse response, + Client client) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestEndpointParameters(ServerRequest request, ServerResponse response, + BigDecimal number, + Double _double, + String patternWithoutDelimiter, + byte[] _byte, + Optional integer, + Optional int32, + Optional int64, + Optional _float, + Optional string, + Optional binary, + Optional date, + Optional dateTime, + Optional password, + Optional paramCallback) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestEnumParameters(ServerRequest request, ServerResponse response, + List enumHeaderStringArray, + Optional enumHeaderString, + List enumQueryStringArray, + Optional enumQueryString, + Optional enumQueryInteger, + Optional enumQueryDouble, + List enumQueryModelArray, + List enumFormStringArray, + Optional enumFormString) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestGroupParameters(ServerRequest request, ServerResponse response, + Integer requiredStringGroup, + Boolean requiredBooleanGroup, + Long requiredInt64Group, + Optional stringGroup, + Optional booleanGroup, + Optional int64Group) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestInlineAdditionalProperties(ServerRequest request, ServerResponse response, + Map requestBody) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestInlineFreeformAdditionalProperties(ServerRequest request, ServerResponse response, + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestJsonFormData(ServerRequest request, ServerResponse response, + String param, + String param2) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestNullable(ServerRequest request, ServerResponse response, + ChildWithNullable childWithNullable) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestQueryParameterCollectionFormat(ServerRequest request, ServerResponse response, + List pipe, + List ioutil, + List http, + List url, + List context, + String allowEmpty, + Map language) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestStringMapReference(ServerRequest request, ServerResponse response, + Map requestBody) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleUploadFileWithRequiredFile(ServerRequest request, ServerResponse response, + Long petId, + ReadablePart requiredFile, + Optional additionalMetadata) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FooService.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FooService.java new file mode 100644 index 000000000000..213f36728006 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FooService.java @@ -0,0 +1,182 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.FooGetDefaultResponse; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'foo'", + version = "stable") +public abstract class FooService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected FooGetOp fooGetOp = createFooGetOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.get("/", this::fooGet); + } + + + /** + * GET /foo. + * + * @param request the server request + * @param response the server response + */ + protected void fooGet(ServerRequest request, ServerResponse response) { + + handleFooGet(request, response); + } + + /** + * Handle GET /foo. + * + * @param request the server request + * @param response the server response + */ + protected abstract void handleFooGet(ServerRequest request, ServerResponse response); + + /** + * Returns a new instance of the class which handles parameters to and responses from the fooGet operation. + *

+ * Developers can override this method if they extend the FooService class. + *

+ * + * @return new FooGet + */ + protected FooGetOp createFooGetOp() { + return new FooGetOp(); + } + + /** + * Helper elements for the {@code fooGet} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FooGetOp { + + /** + * Default result. + * + * @param status (required) Status value to be sent with this default result + * @param response + */ + record Default(Status status, FooGetDefaultResponse response) { + + /** + * Creates a response builder for the default response + * for the fooGet operation; there are no required result values for this response. + * + * @return new builder for status 0 + */ + static Builder builder(Status status) { + return new Builder(status); + } + + /** + * Builder for the Default result. + */ + static class Builder implements io.helidon.common.Builder { + + private FooGetDefaultResponse response; + private final Status status; + Builder(Status status) { + this.status = status; + + } + @Override + public Default build() { + return new Default(status, + response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(FooGetDefaultResponse response) { + this.response = response; + return this; + } + } + + /** + * Constructor for a result for the default result + * for the fooGet operation, verifying non-null values for required return data. + * + * @param response returned entity + */ + public Default(Status status, FooGetDefaultResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + validator.require("status for default response", status); + validator.execute(); + this.status = status; + this.response = response; + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(status); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service FooService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FooServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FooServiceImpl.java new file mode 100644 index 000000000000..087187072916 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/FooServiceImpl.java @@ -0,0 +1,18 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.FooGetDefaultResponse; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class FooServiceImpl extends FooService { + + @Override + protected void handleFooGet(ServerRequest request, ServerResponse response) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/HCollectors.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/HCollectors.java new file mode 100644 index 000000000000..c95c679e1dc9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/HCollectors.java @@ -0,0 +1,217 @@ +package org.openapitools.server.api; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.BiConsumer; +import java.util.function.BinaryOperator; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collector; + +import io.helidon.common.GenericType; +import io.helidon.http.Headers; +import io.helidon.http.WritableHeaders; +import io.helidon.http.media.EntityReader; +import io.helidon.http.media.FormParamsSupport; +import io.helidon.http.media.MediaSupport; + +/** + * Collectors with particular features useful from the generated code. + */ +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "utility", + version = "stable") +public final class HCollectors { + + private static final MediaSupport FORM_PARAMS_SUPPORT = FormParamsSupport.create(); + private static final Headers EMPTY_HEADERS = WritableHeaders.create(); + + /** + * Returns a new {@link java.util.stream.Collector} that applies a default value in the absence of provided values and returns + * the resulting {@link java.util.List}. + * + * @param baseDefault default value expressed in the base type of the parameter + * @param converter transforms the default value from the base type to the result type + * @param base type + * @param result type + * @return new collector + */ + static Collector> toDefaultedList(BT baseDefault, Function converter) { + return new DefaultableListCollector<>(baseDefault, converter); + } + + static Collector> noOpMap() { + + return new NoOpMapCollector(); + } + + /** + * Decodes URL encoded string as binary data. + *

+ * Inspired hugely by java.net.URLDecoder. + *

+ * + * @param s URL encoded string + * @return binary data encoded by the string + */ + static byte[] decodeBinaryFormParam(String s) { + boolean needToChange = false; + int numChars = s.length(); + int i = 0; + + char c; + ByteArrayOutputStream output = new ByteArrayOutputStream(); + byte[] bytes = null; + while (i < numChars) { + c = s.charAt(i); + switch (c) { + case '+': + output.write(' '); + i++; + needToChange = true; + break; + case '%': + /* + * Starting with this instance of %, process all + * consecutive substrings of the form %xy. Each + * substring %xy will yield a byte. Convert all + * consecutive bytes obtained this way to whatever + * character(s) they represent in the provided + * encoding. + */ + + try { + + // (numChars-i)/3 is an upper bound for the number + // of remaining bytes + if (bytes == null) + bytes = new byte[(numChars-i)/3]; + int pos = 0; + + while ( ((i+2) < numChars) && + (c=='%')) { + int v = Integer.parseInt(s, i + 1, i + 3, 16); + if (v < 0) + throw new IllegalArgumentException( + "URLDecoder: Illegal hex characters in escape " + + "(%) pattern - negative value"); + bytes[pos++] = (byte) v; + i+= 3; + if (i < numChars) + c = s.charAt(i); + } + + // A trailing, incomplete byte encoding such as + // "%x" will cause an exception to be thrown + + if ((i < numChars) && (c=='%')) + throw new IllegalArgumentException( + "URLDecoder: Incomplete trailing escape (%) pattern"); + + output.write(bytes, 0, pos); + } catch (NumberFormatException e) { + throw new IllegalArgumentException( + "URLDecoder: Illegal hex characters in escape (%) pattern - " + + e.getMessage()); + } + needToChange = true; + break; + default: + output.write(c); + i++; + break; + } + } + + return output.toByteArray(); + } + + private static class NoOpMapCollector implements Collector, Map> { + + @Override + public Supplier> supplier() { + return LinkedHashMap::new; + } + + @Override + public BiConsumer, String> accumulator() { + return (map, expr) -> {}; + } + + @Override + public BinaryOperator> combiner() { + return (a, b) -> a; + } + + @Override + public Function, Map> finisher() { + return Function.identity(); + } + + @Override + public Set characteristics() { + return Set.of(); + } + } + + private abstract static class AbstractListCollector implements Collector, List> { + + @Override + public Supplier> supplier() { + return ArrayList::new; + } + + @Override + public BiConsumer, T> accumulator() { + return List::add; + } + + @Override + public BinaryOperator> combiner() { + return (l1, l2) -> { + l2.addAll(l1); + return l2; + }; + } + + @Override + public Set characteristics() { + return Set.of(); + } + } + + /** + * {@link java.util.stream.Collector} for streams of the base type (values from the request, often strings} + * applying a converter to the desired result type and supplying a default value if there are no base values. + * + * @param base type (often string) + * @param result type + */ + private static class DefaultableListCollector extends AbstractListCollector { + + private final BT baseDefault; + private final Function converter; + + DefaultableListCollector(BT baseDefault, Function converter) { + this.baseDefault = baseDefault; + this.converter = converter; + } + + @Override + public Function, List> finisher() { + return l -> { + if (l.isEmpty()) { + l.add(converter.apply(baseDefault)); + } + return l; + }; + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/JsonProvider.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/JsonProvider.java new file mode 100644 index 000000000000..41f01e882ab0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/PartsUtils.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/PartsUtils.java new file mode 100644 index 000000000000..a16d88336815 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/PartsUtils.java @@ -0,0 +1,89 @@ +package org.openapitools.server.api; + +import java.io.IOException; +import java.io.File; +import java.io.InputStream; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Optional; + +import io.helidon.common.GenericType; +import io.helidon.http.media.multipart.MultiPart; +import io.helidon.http.media.multipart.ReadablePart; +import io.helidon.webserver.http.ServerRequest; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "utility", + version = "stable") +class PartsUtils { + + private final Map parts = new LinkedHashMap<>(); + + static Map partsMap(ServerRequest request) { + Map parts = new LinkedHashMap<>(); + request.content().as(MultiPart.class).forEachRemaining(part -> parts.put(part.name(), part)); + return parts; + } + + static PartsUtils create(ServerRequest request) { + return new PartsUtils(request); + } + + private PartsUtils(ServerRequest request) { + request.content().as(MultiPart.class).forEachRemaining(part -> parts.put(part.name(), part)); + } + + T part(String partName, Class type, T defaultValue) { + ReadablePart part = parts.get(partName); + if (part == null) { + return defaultValue; + } + return part.as(type); + } + + Optional partOpt(String partName, Class type, T defaultValue) { + return Optional.ofNullable(part(partName, type, defaultValue)); + } + + T part(String partName, GenericType type, T defaultValue) { + ReadablePart part = parts.get(partName); + if (part == null) { + return defaultValue; + } + return part.as(type); + } + + Optional partOpt(String partName, GenericType type, T defaultValue) { + return Optional.ofNullable(part(partName, type, defaultValue)); + } + + InputStream inputStreamPart(String partName) { + ReadablePart part = parts.get(partName); + if (part == null) { + return null; + } + return part.inputStream(); + } + + Optional inputStreamPartOpt(String partName) { + return Optional.ofNullable(inputStreamPart(partName)); + } + + File filePart(String partName, Path directory) { + ReadablePart part = parts.get(partName); + if (part == null) { + return null; + } + try (InputStream inputStream = part.inputStream()) { + Path path = directory.resolve(part.fileName().orElse(partName)); + inputStream.transferTo(Files.newOutputStream(path, StandardOpenOption.CREATE_NEW)); + return path.toFile(); + } catch (IOException ex) { + throw new UncheckedIOException(ex); + } + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/PetService.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/PetService.java new file mode 100644 index 000000000000..6cdd1203dd96 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/PetService.java @@ -0,0 +1,1797 @@ +package org.openapitools.server.api; + +import java.util.ArrayList; +import java.util.stream.Collectors; +import java.io.File; +import java.util.HashMap; +import io.helidon.http.HeaderNames; +import io.helidon.http.Headers; +import java.util.HexFormat; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.Map; +import org.openapitools.server.model.ModelApiResponse; +import io.helidon.http.media.multipart.MultiPart; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Optional; +import io.helidon.common.parameters.Parameters; +import org.openapitools.server.model.Pet; +import io.helidon.http.media.multipart.ReadablePart; +import java.util.Set; +import io.helidon.http.Status; +import java.io.UncheckedIOException; +import io.helidon.common.mapper.Value; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'pet'", + version = "stable") +public abstract class PetService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected AddPetOp addPetOp = createAddPetOp(); + protected DeletePetOp deletePetOp = createDeletePetOp(); + protected FindPetsByStatusOp findPetsByStatusOp = createFindPetsByStatusOp(); + protected FindPetsByTagsOp findPetsByTagsOp = createFindPetsByTagsOp(); + protected GetPetByIdOp getPetByIdOp = createGetPetByIdOp(); + protected UpdatePetOp updatePetOp = createUpdatePetOp(); + protected UpdatePetWithFormOp updatePetWithFormOp = createUpdatePetWithFormOp(); + protected UploadFileOp uploadFileOp = createUploadFileOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.post("/", this::addPet); + rules.delete("/{petId}", this::deletePet); + rules.get("/findByStatus", this::findPetsByStatus); + rules.get("/findByTags", this::findPetsByTags); + rules.get("/{petId}", this::getPetById); + rules.put("/", this::updatePet); + rules.post("/{petId}", this::updatePetWithForm); + rules.post("/{petId}/uploadImage", this::uploadFile); + } + + + /** + * POST /pet : Add a new pet to the store. + * + * @param request the server request + * @param response the server response + */ + protected void addPet(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Pet + Pet pet = addPetOp.pet(request, validator); + validator.require("pet", pet); + + validator.execute(); + + handleAddPet(request, response, + pet); + } + + /** + * Handle 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 + */ + protected abstract void handleAddPet(ServerRequest request, ServerResponse response, + Pet pet); + + /** + * DELETE /pet/{petId} : Deletes a pet. + * + * @param request the server request + * @param response the server response + */ + protected void deletePet(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: petId + Long petId = deletePetOp.petId(request, validator); + + validator.require("petId", petId); + + // Parameter: api_key + Optional apiKey = deletePetOp.apiKey(request, validator); + + validator.execute(); + + handleDeletePet(request, response, + petId, + apiKey); + } + + /** + * Handle DELETE /pet/{petId} : Deletes a pet. + * + * @param request the server request + * @param response the server response + * @param petId Pet id to delete + * @param apiKey apiKey + */ + protected abstract void handleDeletePet(ServerRequest request, ServerResponse response, + Long petId, + Optional apiKey); + + /** + * GET /pet/findByStatus : Finds Pets by status. + * + * @param request the server request + * @param response the server response + */ + protected void findPetsByStatus(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: status + List status = findPetsByStatusOp.status(request, validator); + + validator.require("status", status); + validator.execute(); + + handleFindPetsByStatus(request, response, + status); + } + + /** + * Handle GET /pet/findByStatus : Finds Pets by status. + * + * @param request the server request + * @param response the server response + * @param status Status values that need to be considered for filter + */ + protected abstract void handleFindPetsByStatus(ServerRequest request, ServerResponse response, + List status); + + /** + * GET /pet/findByTags : Finds Pets by tags. + * + * @param request the server request + * @param response the server response + */ + protected void findPetsByTags(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: tags + Set tags = findPetsByTagsOp.tags(request, validator); + + validator.require("tags", tags); + validator.execute(); + + handleFindPetsByTags(request, response, + tags); + } + + /** + * Handle GET /pet/findByTags : Finds Pets by tags. + * + * @param request the server request + * @param response the server response + * @param tags Tags to filter by + */ + protected abstract void handleFindPetsByTags(ServerRequest request, ServerResponse response, + Set tags); + + /** + * GET /pet/{petId} : Find pet by ID. + * + * @param request the server request + * @param response the server response + */ + protected void getPetById(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: petId + Long petId = getPetByIdOp.petId(request, validator); + + validator.require("petId", petId); + validator.execute(); + + handleGetPetById(request, response, + petId); + } + + /** + * Handle GET /pet/{petId} : Find pet by ID. + * + * @param request the server request + * @param response the server response + * @param petId ID of pet to return + */ + protected abstract void handleGetPetById(ServerRequest request, ServerResponse response, + Long petId); + + /** + * PUT /pet : Update an existing pet. + * + * @param request the server request + * @param response the server response + */ + protected void updatePet(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Pet + Pet pet = updatePetOp.pet(request, validator); + validator.require("pet", pet); + + validator.execute(); + + handleUpdatePet(request, response, + pet); + } + + /** + * Handle 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 + */ + protected abstract void handleUpdatePet(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 + */ + protected void updatePetWithForm(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + + Parameters formParams = request.content().as(Parameters.class); + + // Parameter: petId + Long petId = updatePetWithFormOp.petId(request, validator); + + validator.require("petId", petId); + + // Parameter: name + Optional name = updatePetWithFormOp.name(request, formParams, validator); + + + // Parameter: status + Optional status = updatePetWithFormOp.status(request, formParams, validator); + + validator.execute(); + + handleUpdatePetWithForm(request, response, + petId, + name, + status); + } + + /** + * Handle POST /pet/{petId} : Updates a pet in the store with form data. + * + * @param request the server request + * @param response the server response + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + */ + protected abstract void handleUpdatePetWithForm(ServerRequest request, ServerResponse response, + Long petId, + Optional name, + Optional status); + + /** + * POST /pet/{petId}/uploadImage : uploads an image. + * + * @param request the server request + * @param response the server response + */ + protected void uploadFile(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + + Map parts = PartsUtils.partsMap(request); + + // Parameter: petId + Long petId = uploadFileOp.petId(request, validator); + + validator.require("petId", petId); + + // Parameter: additionalMetadata + Optional additionalMetadata = uploadFileOp.additionalMetadata(request, parts, validator); + + + // Parameter: file + Optional _file = uploadFileOp._file(request, parts, validator); + + validator.execute(); + + handleUploadFile(request, response, + petId, + additionalMetadata, + _file); + } + + /** + * Handle POST /pet/{petId}/uploadImage : uploads an image. + * + * @param request the server request + * @param response the server response + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param _file file to upload + */ + protected abstract void handleUploadFile(ServerRequest request, ServerResponse response, + Long petId, + Optional additionalMetadata, + Optional _file); + + /** + * Returns a new instance of the class which handles parameters to and responses from the addPet operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new AddPet + */ + protected AddPetOp createAddPetOp() { + return new AddPetOp(); + } + + /** + * Helper elements for the {@code addPet} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class AddPetOp { + + /** + * Prepares the pet parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return pet parameter value + */ + protected Pet pet(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Pet.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the addPet operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 405}. + */ + record Response405() { + + /** + * Creates a response builder for the status {@code 405} response + * for the addPet operation; there are no required result values for this response. + * + * @return new builder for status 405 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response405 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response405 build() { + return new Response405(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.METHOD_NOT_ALLOWED_405); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the deletePet operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new DeletePet + */ + protected DeletePetOp createDeletePetOp() { + return new DeletePetOp(); + } + + /** + * Helper elements for the {@code deletePet} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class DeletePetOp { + + /** + * Prepares the petId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return petId parameter value + */ + protected Long petId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("petId") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Prepares the apiKey parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return apiKey parameter value + */ + protected Optional apiKey(ServerRequest request, ValidatorUtils.Validator validator) { + return request.headers() + .first(HeaderNames.create("api_key")); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the deletePet operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the deletePet operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the findPetsByStatus operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new FindPetsByStatus + */ + protected FindPetsByStatusOp createFindPetsByStatusOp() { + return new FindPetsByStatusOp(); + } + + /** + * Helper elements for the {@code findPetsByStatus} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FindPetsByStatusOp { + + /** + * Prepares the status parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return status parameter value + */ + protected List status(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("status") + .stream() + .map(String::valueOf) + .map(v -> validator.check("status", + v, + List.of("available", + "pending", + "sold"))) + .collect(Collectors.toList()); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(List response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the findPetsByStatus operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private List response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(List response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the findPetsByStatus operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the findPetsByTags operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new FindPetsByTags + */ + protected FindPetsByTagsOp createFindPetsByTagsOp() { + return new FindPetsByTagsOp(); + } + + /** + * Helper elements for the {@code findPetsByTags} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FindPetsByTagsOp { + + /** + * Prepares the tags parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return tags parameter value + */ + protected Set tags(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("tags") + .stream() + .map(String::valueOf) + .collect(Collectors.toSet()); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Set response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the findPetsByTags operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Set response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Set response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the findPetsByTags operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the getPetById operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new GetPetById + */ + protected GetPetByIdOp createGetPetByIdOp() { + return new GetPetByIdOp(); + } + + /** + * Helper elements for the {@code getPetById} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class GetPetByIdOp { + + /** + * Prepares the petId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return petId parameter value + */ + protected Long petId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("petId") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Pet response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the getPetById operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Pet response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Pet response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the getPetById operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the getPetById operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the updatePet operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new UpdatePet + */ + protected UpdatePetOp createUpdatePetOp() { + return new UpdatePetOp(); + } + + /** + * Helper elements for the {@code updatePet} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class UpdatePetOp { + + /** + * Prepares the pet parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return pet parameter value + */ + protected Pet pet(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Pet.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the updatePet operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the updatePet operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the updatePet operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 405}. + */ + record Response405() { + + /** + * Creates a response builder for the status {@code 405} response + * for the updatePet operation; there are no required result values for this response. + * + * @return new builder for status 405 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response405 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response405 build() { + return new Response405(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.METHOD_NOT_ALLOWED_405); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the updatePetWithForm operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new UpdatePetWithForm + */ + protected UpdatePetWithFormOp createUpdatePetWithFormOp() { + return new UpdatePetWithFormOp(); + } + + /** + * Helper elements for the {@code updatePetWithForm} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class UpdatePetWithFormOp { + + /** + * Prepares the petId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return petId parameter value + */ + protected Long petId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("petId") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Prepares the name parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return name parameter value + */ + protected Optional name(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("name") + .asOptional(); + } + + /** + * Prepares the status parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return status parameter value + */ + protected Optional status(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("status") + .asOptional(); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the updatePetWithForm operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 405}. + */ + record Response405() { + + /** + * Creates a response builder for the status {@code 405} response + * for the updatePetWithForm operation; there are no required result values for this response. + * + * @return new builder for status 405 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response405 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response405 build() { + return new Response405(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.METHOD_NOT_ALLOWED_405); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the uploadFile operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new UploadFile + */ + protected UploadFileOp createUploadFileOp() { + return new UploadFileOp(); + } + + /** + * Helper elements for the {@code uploadFile} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class UploadFileOp { + + /** + * Prepares the petId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return petId parameter value + */ + protected Long petId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("petId") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Prepares the additionalMetadata parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param parts {@code Map} of part names to {@link io.helidon.http.media.multipart.ReadablePart} for each part + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return additionalMetadata parameter value + */ + protected Optional additionalMetadata(ServerRequest request, Map parts, ValidatorUtils.Validator validator) { + return Optional.ofNullable(parts.get("additionalMetadata")); + } + + /** + * Prepares the _file parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param parts {@code Map} of part names to {@link io.helidon.http.media.multipart.ReadablePart} for each part + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return _file parameter value + */ + protected Optional _file(ServerRequest request, Map parts, ValidatorUtils.Validator validator) { + return Optional.ofNullable(parts.get("file")); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(ModelApiResponse response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the uploadFile operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private ModelApiResponse response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(ModelApiResponse response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service PetService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/PetServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/PetServiceImpl.java new file mode 100644 index 000000000000..299009d0b712 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/PetServiceImpl.java @@ -0,0 +1,91 @@ +package org.openapitools.server.api; + +import java.util.ArrayList; +import java.util.stream.Collectors; +import java.io.File; +import java.util.HashMap; +import io.helidon.http.HeaderNames; +import io.helidon.http.Headers; +import java.util.HexFormat; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.Map; +import org.openapitools.server.model.ModelApiResponse; +import io.helidon.http.media.multipart.MultiPart; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Optional; +import io.helidon.common.parameters.Parameters; +import org.openapitools.server.model.Pet; +import io.helidon.http.media.multipart.ReadablePart; +import java.util.Set; +import io.helidon.http.Status; +import java.io.UncheckedIOException; +import io.helidon.common.mapper.Value; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class PetServiceImpl extends PetService { + + @Override + protected void handleAddPet(ServerRequest request, ServerResponse response, + Pet pet) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleDeletePet(ServerRequest request, ServerResponse response, + Long petId, + Optional apiKey) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFindPetsByStatus(ServerRequest request, ServerResponse response, + List status) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFindPetsByTags(ServerRequest request, ServerResponse response, + Set tags) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleGetPetById(ServerRequest request, ServerResponse response, + Long petId) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleUpdatePet(ServerRequest request, ServerResponse response, + Pet pet) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleUpdatePetWithForm(ServerRequest request, ServerResponse response, + Long petId, + Optional name, + Optional status) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleUploadFile(ServerRequest request, ServerResponse response, + Long petId, + Optional additionalMetadata, + Optional _file) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/StoreService.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/StoreService.java new file mode 100644 index 000000000000..415ba55fe104 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/StoreService.java @@ -0,0 +1,796 @@ +package org.openapitools.server.api; + +import java.util.HexFormat; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.server.model.Order; +import io.helidon.http.Status; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'store'", + version = "stable") +public abstract class StoreService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected DeleteOrderOp deleteOrderOp = createDeleteOrderOp(); + protected GetInventoryOp getInventoryOp = createGetInventoryOp(); + protected GetOrderByIdOp getOrderByIdOp = createGetOrderByIdOp(); + protected PlaceOrderOp placeOrderOp = createPlaceOrderOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.delete("/order/{order_id}", this::deleteOrder); + rules.get("/inventory", this::getInventory); + rules.get("/order/{order_id}", this::getOrderById); + rules.post("/order", this::placeOrder); + } + + + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID. + * + * @param request the server request + * @param response the server response + */ + protected void deleteOrder(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: order_id + String orderId = deleteOrderOp.orderId(request, validator); + + validator.require("orderId", orderId); + validator.execute(); + + handleDeleteOrder(request, response, + orderId); + } + + /** + * Handle DELETE /store/order/{order_id} : Delete purchase order by ID. + * + * @param request the server request + * @param response the server response + * @param orderId ID of the order that needs to be deleted + */ + protected abstract void handleDeleteOrder(ServerRequest request, ServerResponse response, + String orderId); + + /** + * GET /store/inventory : Returns pet inventories by status. + * + * @param request the server request + * @param response the server response + */ + protected void getInventory(ServerRequest request, ServerResponse response) { + + handleGetInventory(request, response); + } + + /** + * Handle GET /store/inventory : Returns pet inventories by status. + * + * @param request the server request + * @param response the server response + */ + protected abstract void handleGetInventory(ServerRequest request, ServerResponse response); + + /** + * GET /store/order/{order_id} : Find purchase order by ID. + * + * @param request the server request + * @param response the server response + */ + protected void getOrderById(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: order_id + Long orderId = getOrderByIdOp.orderId(request, validator); + + validator.require("orderId", orderId); + validator.validateMin("orderId", orderId.intValue(), 1, true); + validator.validateMax("orderId", orderId.intValue(), 5, true); + validator.execute(); + + handleGetOrderById(request, response, + orderId); + } + + /** + * Handle GET /store/order/{order_id} : Find purchase order by ID. + * + * @param request the server request + * @param response the server response + * @param orderId ID of pet that needs to be fetched + */ + protected abstract void handleGetOrderById(ServerRequest request, ServerResponse response, + Long orderId); + + /** + * POST /store/order : Place an order for a pet. + * + * @param request the server request + * @param response the server response + */ + protected void placeOrder(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Order + Order order = placeOrderOp.order(request, validator); + validator.require("order", order); + + validator.execute(); + + handlePlaceOrder(request, response, + order); + } + + /** + * Handle 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 + */ + protected abstract void handlePlaceOrder(ServerRequest request, ServerResponse response, + Order order); + + /** + * Returns a new instance of the class which handles parameters to and responses from the deleteOrder operation. + *

+ * Developers can override this method if they extend the StoreService class. + *

+ * + * @return new DeleteOrder + */ + protected DeleteOrderOp createDeleteOrderOp() { + return new DeleteOrderOp(); + } + + /** + * Helper elements for the {@code deleteOrder} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class DeleteOrderOp { + + /** + * Prepares the orderId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return orderId parameter value + */ + protected String orderId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("order_id") + .asOptional() + .orElse(null); + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the deleteOrder operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the deleteOrder operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the getInventory operation. + *

+ * Developers can override this method if they extend the StoreService class. + *

+ * + * @return new GetInventory + */ + protected GetInventoryOp createGetInventoryOp() { + return new GetInventoryOp(); + } + + /** + * Helper elements for the {@code getInventory} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class GetInventoryOp { + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Map response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the getInventory operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Map response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Map response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the getOrderById operation. + *

+ * Developers can override this method if they extend the StoreService class. + *

+ * + * @return new GetOrderById + */ + protected GetOrderByIdOp createGetOrderByIdOp() { + return new GetOrderByIdOp(); + } + + /** + * Helper elements for the {@code getOrderById} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class GetOrderByIdOp { + + /** + * Prepares the orderId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return orderId parameter value + */ + protected Long orderId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("order_id") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Order response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the getOrderById operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Order response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Order response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the getOrderById operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the getOrderById operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the placeOrder operation. + *

+ * Developers can override this method if they extend the StoreService class. + *

+ * + * @return new PlaceOrder + */ + protected PlaceOrderOp createPlaceOrderOp() { + return new PlaceOrderOp(); + } + + /** + * Helper elements for the {@code placeOrder} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class PlaceOrderOp { + + /** + * Prepares the order parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return order parameter value + */ + protected Order order(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Order.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Order response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the placeOrder operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Order response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Order response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the placeOrder operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service StoreService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/StoreServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/StoreServiceImpl.java new file mode 100644 index 000000000000..5b6e23452ba2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/StoreServiceImpl.java @@ -0,0 +1,40 @@ +package org.openapitools.server.api; + +import java.util.HexFormat; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.server.model.Order; +import io.helidon.http.Status; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class StoreServiceImpl extends StoreService { + + @Override + protected void handleDeleteOrder(ServerRequest request, ServerResponse response, + String orderId) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleGetInventory(ServerRequest request, ServerResponse response) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleGetOrderById(ServerRequest request, ServerResponse response, + Long orderId) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handlePlaceOrder(ServerRequest request, ServerResponse response, + Order order) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/UserService.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/UserService.java new file mode 100644 index 000000000000..91f01c9ae25c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/UserService.java @@ -0,0 +1,1494 @@ +package org.openapitools.server.api; + +import java.util.stream.Collectors; +import org.openapitools.server.model.GenericTypes; +import java.util.HexFormat; +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.OffsetDateTime; +import java.util.Optional; +import io.helidon.http.Status; +import org.openapitools.server.model.User; +import jakarta.validation.Valid; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'user'", + version = "stable") +public abstract class UserService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected CreateUserOp createUserOp = createCreateUserOp(); + protected CreateUsersWithArrayInputOp createUsersWithArrayInputOp = createCreateUsersWithArrayInputOp(); + protected CreateUsersWithListInputOp createUsersWithListInputOp = createCreateUsersWithListInputOp(); + protected DeleteUserOp deleteUserOp = createDeleteUserOp(); + protected GetUserByNameOp getUserByNameOp = createGetUserByNameOp(); + protected LoginUserOp loginUserOp = createLoginUserOp(); + protected LogoutUserOp logoutUserOp = createLogoutUserOp(); + protected UpdateUserOp updateUserOp = createUpdateUserOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.post("/", this::createUser); + rules.post("/createWithArray", this::createUsersWithArrayInput); + rules.post("/createWithList", this::createUsersWithListInput); + rules.delete("/{username}", this::deleteUser); + rules.get("/{username}", this::getUserByName); + rules.get("/login", this::loginUser); + rules.get("/logout", this::logoutUser); + rules.put("/{username}", this::updateUser); + } + + + /** + * POST /user : Create user. + * + * @param request the server request + * @param response the server response + */ + protected void createUser(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: User + User user = createUserOp.user(request, validator); + validator.require("user", user); + + validator.execute(); + + handleCreateUser(request, response, + user); + } + + /** + * Handle POST /user : Create user. + * + * @param request the server request + * @param response the server response + * @param user Created user object + */ + protected abstract void handleCreateUser(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 + */ + protected void createUsersWithArrayInput(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: User + List<@Valid User> user = createUsersWithArrayInputOp.user(request, validator); + validator.require("user", user); + + validator.execute(); + + handleCreateUsersWithArrayInput(request, response, + user); + } + + /** + * Handle POST /user/createWithArray : Creates list of users with given input array. + * + * @param request the server request + * @param response the server response + * @param user List of user object + */ + protected abstract void handleCreateUsersWithArrayInput(ServerRequest request, ServerResponse response, + List<@Valid User> user); + + /** + * POST /user/createWithList : Creates list of users with given input array. + * + * @param request the server request + * @param response the server response + */ + protected void createUsersWithListInput(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: User + List<@Valid User> user = createUsersWithListInputOp.user(request, validator); + validator.require("user", user); + + validator.execute(); + + handleCreateUsersWithListInput(request, response, + user); + } + + /** + * Handle POST /user/createWithList : Creates list of users with given input array. + * + * @param request the server request + * @param response the server response + * @param user List of user object + */ + protected abstract void handleCreateUsersWithListInput(ServerRequest request, ServerResponse response, + List<@Valid User> user); + + /** + * DELETE /user/{username} : Delete user. + * + * @param request the server request + * @param response the server response + */ + protected void deleteUser(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: username + String username = deleteUserOp.username(request, validator); + + validator.require("username", username); + validator.execute(); + + handleDeleteUser(request, response, + username); + } + + /** + * Handle DELETE /user/{username} : Delete user. + * + * @param request the server request + * @param response the server response + * @param username The name that needs to be deleted + */ + protected abstract void handleDeleteUser(ServerRequest request, ServerResponse response, + String username); + + /** + * GET /user/{username} : Get user by user name. + * + * @param request the server request + * @param response the server response + */ + protected void getUserByName(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: username + String username = getUserByNameOp.username(request, validator); + + validator.require("username", username); + validator.execute(); + + handleGetUserByName(request, response, + username); + } + + /** + * Handle GET /user/{username} : Get user by user name. + * + * @param request the server request + * @param response the server response + * @param username The name that needs to be fetched. Use user1 for testing. + */ + protected abstract void handleGetUserByName(ServerRequest request, ServerResponse response, + String username); + + /** + * GET /user/login : Logs user into the system. + * + * @param request the server request + * @param response the server response + */ + protected void loginUser(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: username + String username = loginUserOp.username(request, validator); + + validator.require("username", username); + + // Parameter: password + String password = loginUserOp.password(request, validator); + + validator.require("password", password); + validator.execute(); + + handleLoginUser(request, response, + username, + password); + } + + /** + * Handle GET /user/login : Logs user into the system. + * + * @param request the server request + * @param response the server response + * @param username The user name for login + * @param password The password for login in clear text + */ + protected abstract void handleLoginUser(ServerRequest request, ServerResponse response, + String username, + String password); + + /** + * GET /user/logout : Logs out current logged in user session. + * + * @param request the server request + * @param response the server response + */ + protected void logoutUser(ServerRequest request, ServerResponse response) { + + handleLogoutUser(request, response); + } + + /** + * Handle GET /user/logout : Logs out current logged in user session. + * + * @param request the server request + * @param response the server response + */ + protected abstract void handleLogoutUser(ServerRequest request, ServerResponse response); + + /** + * PUT /user/{username} : Updated user. + * + * @param request the server request + * @param response the server response + */ + protected void updateUser(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: username + String username = updateUserOp.username(request, validator); + + validator.require("username", username); + + // Parameter: User + User user = updateUserOp.user(request, validator); + validator.require("user", user); + + validator.execute(); + + handleUpdateUser(request, response, + username, + user); + } + + /** + * Handle PUT /user/{username} : Updated user. + * + * @param request the server request + * @param response the server response + * @param username name that need to be deleted + * @param user Updated user object + */ + protected abstract void handleUpdateUser(ServerRequest request, ServerResponse response, + String username, + User user); + + /** + * Returns a new instance of the class which handles parameters to and responses from the createUser operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new CreateUser + */ + protected CreateUserOp createCreateUserOp() { + return new CreateUserOp(); + } + + /** + * Helper elements for the {@code createUser} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class CreateUserOp { + + /** + * Prepares the user parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return user parameter value + */ + protected User user(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(User.class) + : null; + } + + /** + * Default result. + * + * @param status (required) Status value to be sent with this default result + */ + record Default(Status status) { + + /** + * Creates a response builder for the default response + * for the createUser operation; there are no required result values for this response. + * + * @return new builder for status 0 + */ + static Builder builder(Status status) { + return new Builder(status); + } + + /** + * Builder for the Default result. + */ + static class Builder implements io.helidon.common.Builder { + + private final Status status; + Builder(Status status) { + this.status = status; + + } + @Override + public Default build() { + return new Default(status); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Constructor for a result for the default result + * for the createUser operation, verifying non-null values for required return data. + * + */ + public Default(Status status) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + validator.require("status for default response", status); + validator.execute(); + this.status = status; + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(status); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the createUsersWithArrayInput operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new CreateUsersWithArrayInput + */ + protected CreateUsersWithArrayInputOp createCreateUsersWithArrayInputOp() { + return new CreateUsersWithArrayInputOp(); + } + + /** + * Helper elements for the {@code createUsersWithArrayInput} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class CreateUsersWithArrayInputOp { + + /** + * Prepares the user parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return user parameter value + */ + protected List<@Valid User> user(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(GenericTypes.TYPE__List_User) + : List.of(); + } + + /** + * Default result. + * + * @param status (required) Status value to be sent with this default result + */ + record Default(Status status) { + + /** + * Creates a response builder for the default response + * for the createUsersWithArrayInput operation; there are no required result values for this response. + * + * @return new builder for status 0 + */ + static Builder builder(Status status) { + return new Builder(status); + } + + /** + * Builder for the Default result. + */ + static class Builder implements io.helidon.common.Builder { + + private final Status status; + Builder(Status status) { + this.status = status; + + } + @Override + public Default build() { + return new Default(status); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Constructor for a result for the default result + * for the createUsersWithArrayInput operation, verifying non-null values for required return data. + * + */ + public Default(Status status) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + validator.require("status for default response", status); + validator.execute(); + this.status = status; + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(status); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the createUsersWithListInput operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new CreateUsersWithListInput + */ + protected CreateUsersWithListInputOp createCreateUsersWithListInputOp() { + return new CreateUsersWithListInputOp(); + } + + /** + * Helper elements for the {@code createUsersWithListInput} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class CreateUsersWithListInputOp { + + /** + * Prepares the user parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return user parameter value + */ + protected List<@Valid User> user(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(GenericTypes.TYPE__List_User) + : List.of(); + } + + /** + * Default result. + * + * @param status (required) Status value to be sent with this default result + */ + record Default(Status status) { + + /** + * Creates a response builder for the default response + * for the createUsersWithListInput operation; there are no required result values for this response. + * + * @return new builder for status 0 + */ + static Builder builder(Status status) { + return new Builder(status); + } + + /** + * Builder for the Default result. + */ + static class Builder implements io.helidon.common.Builder { + + private final Status status; + Builder(Status status) { + this.status = status; + + } + @Override + public Default build() { + return new Default(status); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Constructor for a result for the default result + * for the createUsersWithListInput operation, verifying non-null values for required return data. + * + */ + public Default(Status status) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + validator.require("status for default response", status); + validator.execute(); + this.status = status; + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(status); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the deleteUser operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new DeleteUser + */ + protected DeleteUserOp createDeleteUserOp() { + return new DeleteUserOp(); + } + + /** + * Helper elements for the {@code deleteUser} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class DeleteUserOp { + + /** + * Prepares the username parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return username parameter value + */ + protected String username(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("username") + .asOptional() + .orElse(null); + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the deleteUser operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the deleteUser operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the getUserByName operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new GetUserByName + */ + protected GetUserByNameOp createGetUserByNameOp() { + return new GetUserByNameOp(); + } + + /** + * Helper elements for the {@code getUserByName} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class GetUserByNameOp { + + /** + * Prepares the username parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return username parameter value + */ + protected String username(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("username") + .asOptional() + .orElse(null); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(User response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the getUserByName operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private User response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(User response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the getUserByName operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the getUserByName operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the loginUser operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new LoginUser + */ + protected LoginUserOp createLoginUserOp() { + return new LoginUserOp(); + } + + /** + * Helper elements for the {@code loginUser} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class LoginUserOp { + + /** + * Prepares the username parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return username parameter value + */ + protected String username(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("username") + .asOptional() + .orElse(null); + } + + /** + * Prepares the password parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return password parameter value + */ + protected String password(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("password") + .asOptional() + .orElse(null); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param xRateLimit calls per hour allowed by the user + * @param xExpiresAfter date in UTC when token expires + * @param response + */ + record Response200(Integer xRateLimit, + OffsetDateTime xExpiresAfter, + String response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the loginUser operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Integer xRateLimit; private OffsetDateTime xExpiresAfter; private String response; + @Override + public Response200 build() { + return new Response200(xRateLimit, + xExpiresAfter, + response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code xRateLimit}. + * @param xRateLimit calls per hour allowed by the user + * @return updated result builder + */ + Builder xRateLimit(Integer xRateLimit) { + this.xRateLimit = xRateLimit; + return this; + } + + /** + * Sets the value for the optional return property {@code xExpiresAfter}. + * @param xExpiresAfter date in UTC when token expires + * @return updated result builder + */ + Builder xExpiresAfter(OffsetDateTime xExpiresAfter) { + this.xExpiresAfter = xExpiresAfter; + return this; + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(String response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); if (xRateLimit != null) { + _serverResponse.header("X-Rate-Limit", xRateLimit.toString()); + } if (xExpiresAfter != null) { + _serverResponse.header("X-Expires-After", xExpiresAfter.toString()); + } + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the loginUser operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the logoutUser operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new LogoutUser + */ + protected LogoutUserOp createLogoutUserOp() { + return new LogoutUserOp(); + } + + /** + * Helper elements for the {@code logoutUser} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class LogoutUserOp { + + /** + * Default result. + * + * @param status (required) Status value to be sent with this default result + */ + record Default(Status status) { + + /** + * Creates a response builder for the default response + * for the logoutUser operation; there are no required result values for this response. + * + * @return new builder for status 0 + */ + static Builder builder(Status status) { + return new Builder(status); + } + + /** + * Builder for the Default result. + */ + static class Builder implements io.helidon.common.Builder { + + private final Status status; + Builder(Status status) { + this.status = status; + + } + @Override + public Default build() { + return new Default(status); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Constructor for a result for the default result + * for the logoutUser operation, verifying non-null values for required return data. + * + */ + public Default(Status status) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + validator.require("status for default response", status); + validator.execute(); + this.status = status; + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(status); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the updateUser operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new UpdateUser + */ + protected UpdateUserOp createUpdateUserOp() { + return new UpdateUserOp(); + } + + /** + * Helper elements for the {@code updateUser} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class UpdateUserOp { + + /** + * Prepares the username parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return username parameter value + */ + protected String username(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("username") + .asOptional() + .orElse(null); + } + + /** + * Prepares the user parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return user parameter value + */ + protected User user(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(User.class) + : null; + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the updateUser operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the updateUser operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service UserService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/UserServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/UserServiceImpl.java new file mode 100644 index 000000000000..b51933982657 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/UserServiceImpl.java @@ -0,0 +1,75 @@ +package org.openapitools.server.api; + +import java.util.stream.Collectors; +import org.openapitools.server.model.GenericTypes; +import java.util.HexFormat; +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.OffsetDateTime; +import java.util.Optional; +import io.helidon.http.Status; +import org.openapitools.server.model.User; +import jakarta.validation.Valid; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class UserServiceImpl extends UserService { + + @Override + protected void handleCreateUser(ServerRequest request, ServerResponse response, + User user) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleCreateUsersWithArrayInput(ServerRequest request, ServerResponse response, + List<@Valid User> user) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleCreateUsersWithListInput(ServerRequest request, ServerResponse response, + List<@Valid User> user) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleDeleteUser(ServerRequest request, ServerResponse response, + String username) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleGetUserByName(ServerRequest request, ServerResponse response, + String username) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleLoginUser(ServerRequest request, ServerResponse response, + String username, + String password) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleLogoutUser(ServerRequest request, ServerResponse response) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleUpdateUser(ServerRequest request, ServerResponse response, + String username, + User user) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/ValidatorUtils.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/ValidatorUtils.java new file mode 100644 index 000000000000..f485f7d5ff6a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/api/ValidatorUtils.java @@ -0,0 +1,414 @@ +package org.openapitools.server.api; + +import java.lang.reflect.Array; +import java.math.BigDecimal; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +import io.helidon.common.Errors; +import io.helidon.common.mapper.OptionalValue; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +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); + } + } + + public static T nonEmpty(T arg) { + try { + return Objects.requireNonNull(arg, "Required value is missing"); + } catch (NullPointerException npe) { + throw new ValidationException(npe); + } + } + + public static T nonEmpty(Optional opt) { + if (opt.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return opt.get(); + } + + public static T nonEmpty(OptionalValue ov) { + if (ov.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return ov.get(); + } + + public static > M nonEmpty(M map) { + if (map.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return map; + } + + public static > C nonEmpty(C coll) { + if (coll.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return coll; + } + + static Validator validator() { + return new Validator(); + } + + public static class Validator { + + private final Errors.Collector errorsCollector = Errors.collector(); + + T check(String paramName, T paramValue, List validValues) { + if (!validValues.contains(paramValue)) { + errorsCollector.fatal(String.format("Invalid value %s = '%s' not among %s", + paramName, + paramValue, + validValues)); + } + return paramValue; + } + + T require(String paramName, T paramValue) { + if (paramValue == null || ((paramValue instanceof Optional opt) && opt.isEmpty())) { + errorsCollector.fatal(String.format("Missing required param: %s", paramName)); + } + return paramValue; + } + + List require(String paramName, List paramValues) { + if (paramValues.isEmpty()) { + errorsCollector.fatal(String.format("Empty required parameter: %s", paramName)); + } + return paramValues; + } + + T require(String paramName, Optional optionalValue) { + if (optionalValue.isEmpty()) { + errorsCollector.fatal(String.format("Empty required parameter: %s", paramName)); + } + return optionalValue.orElse(null); + } + + boolean validateMin(String paramName, Long value, Long min, boolean isExclusive) { + boolean result = value == null || value > min || !isExclusive && value.equals(min); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %d violates %sminimum %d", + paramName, + value, + isExclusive ? "exclusive " : "", + min)); + } + return result; + } + + boolean validateMin(String paramName, Optional value, Long min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Integer value, Integer min, boolean isExclusive) { + return validateMin(paramName, Long.valueOf(value), Long.valueOf(min), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Integer min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Short value, Short min, boolean isExclusive) { + return validateMin(paramName, value.intValue(), min.intValue(), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Short min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Byte value, Byte min, boolean isExclusive) { + return validateMin(paramName, value.intValue(), min.intValue(), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Byte min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Double value, Double min, boolean isExclusive) { + return validateMin(paramName, new BigDecimal(value), new BigDecimal(min), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Double min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Float value, Float min, boolean isExclusive) { + boolean result = value == null || value.compareTo(min) > 0 || isExclusive && value.equals(min); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %sminimum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + min)); + } + return result; + } + + boolean validateMin(String paramName, Optional value, Float min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, BigDecimal value, String min, boolean isExclusive) { + return validateMin(paramName, value, new BigDecimal(min), isExclusive); + } + + boolean validateMin(String paramName, BigDecimal value, BigDecimal min, boolean isExclusive) { + boolean result = value == null || value.compareTo(min) > 0 || !isExclusive && value.equals(min); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %sminimum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + min)); + } + return result; + } + + boolean validateMin(String paramName, Optional value, String min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMax(String paramName, Long value, Long max, boolean isExclusive) { + boolean result = value == null || value < max || !isExclusive && value.equals(max); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %d violates %smaximum %d", + paramName, + value, + isExclusive ? "exclusive " : "", + max)); + } + return result; + } + + boolean validateMax(String paramName, Optional value, Long max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Integer value, Integer max, boolean isExclusive) { + return validateMax(paramName, Long.valueOf(value), Long.valueOf(max), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Integer max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Short value, Short max, boolean isExclusive) { + return validateMax(paramName, value.intValue(), max.intValue(), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Short max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Byte value, Byte max, boolean isExclusive) { + return validateMax(paramName, value.intValue(), max.intValue(), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Byte max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Double value, Double max, boolean isExclusive) { + return validateMax(paramName, new BigDecimal(value), new BigDecimal(max), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Double max, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Float value, Float max, boolean isExclusive) { + boolean result = value == null || value.compareTo(max) < 0 || isExclusive && value.equals(max); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %smaximum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + max)); + } + return result; + } + + boolean validateMax(String paramName, Optional value, Float max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, BigDecimal value, String max, boolean isExclusive) { + return validateMax(paramName, value, new BigDecimal(max), isExclusive); + } + + boolean validateMax(String paramName, BigDecimal value, BigDecimal max, boolean isExclusive) { + boolean result = value == null || value.compareTo(max) < 0 || !isExclusive && value.equals(max); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %smaximum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + max)); + } + return result; + } + + boolean validateMax(String paramName, Optional value, String max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validatePattern(String paramName, String value, String pattern) { + boolean result = value == null || value.matches(pattern); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s '%s' does not match pattern '%s'", + paramName, + value, + pattern)); + } + return result; + } + + boolean validatePattern(String paramName, Optional value, String pattern) { + return value.isEmpty() || validatePattern(pattern, value.get(), pattern); + } + + boolean validateSize(String paramName, Object value, Integer min, Integer max) { + if (value == null) { + return true; + } + int size = switch (value) { + case Map map -> map.size(); + case CharSequence cs -> cs.length(); + case Collection coll -> coll.size(); + default -> value.getClass().isArray() ? Array.getLength(value) : -1; + }; + if (size == -1) { + errorsCollector.fatal(String.format("Parameter %s with type %s unrecognized for validating size", + paramName, + value.getClass().getName())); + return false; + } + if (min != null) { + validateMin(paramName, size, min, false); + } + if (max != null) { + validateMax(paramName, size, max, false); + } + return true; + } + + boolean validateSize(String paramName, Optional value, Integer min, Integer max) { + return value.isEmpty() || validateSize(paramName, value.get(), min, max); + } + + void execute() { + Errors errors = errorsCollector.collect(); + if (errors.hasFatal()) { + throw new ValidationException("Validation errors: " + errors); + } + } + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java new file mode 100644 index 000000000000..1266dac5d907 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java @@ -0,0 +1,87 @@ +package org.openapitools.server.model; + +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java new file mode 100644 index 000000000000..63eeb7f67afb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java @@ -0,0 +1,88 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.SingleRefType; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Animal.java new file mode 100644 index 000000000000..548edc48a8a8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 000000000000..83c75a242e8e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,72 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java new file mode 100644 index 000000000000..971fb516ba0c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java @@ -0,0 +1,72 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ArrayTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ArrayTest.java new file mode 100644 index 000000000000..d94cad1da9a3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ArrayTest.java @@ -0,0 +1,106 @@ +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.ReadOnlyFirst; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Capitalization.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Capitalization.java new file mode 100644 index 000000000000..942f62d57fbc --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Capitalization.java @@ -0,0 +1,153 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Cat.java new file mode 100644 index 000000000000..d0d01e632a5e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Cat.java @@ -0,0 +1,72 @@ +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; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Category.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Category.java new file mode 100644 index 000000000000..ce9f854b3b91 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Category.java @@ -0,0 +1,85 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ChildWithNullable.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ChildWithNullable.java new file mode 100644 index 000000000000..ea4c963b2b56 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ChildWithNullable.java @@ -0,0 +1,75 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.ParentWithNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class ChildWithNullable extends ParentWithNullable { + + private String otherProperty; + + /** + * Default constructor. + */ + public ChildWithNullable() { + // JSON-B / Jackson + } + + /** + * Create ChildWithNullable. + * + * @param otherProperty otherProperty + */ + public ChildWithNullable( + String otherProperty + ) { + this.otherProperty = otherProperty; + } + + + + /** + * Get otherProperty + * @return otherProperty + */ + public String getOtherProperty() { + return otherProperty; + } + + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ClassModel.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ClassModel.java new file mode 100644 index 000000000000..806a179ba10a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ClassModel.java @@ -0,0 +1,70 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Client.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Client.java new file mode 100644 index 000000000000..3b500ac997ee --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Client.java @@ -0,0 +1,68 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/DeprecatedObject.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/DeprecatedObject.java new file mode 100644 index 000000000000..4e2b7051130c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/DeprecatedObject.java @@ -0,0 +1,68 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Dog.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Dog.java new file mode 100644 index 000000000000..f935612575ee --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Dog.java @@ -0,0 +1,72 @@ +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; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/EnumArrays.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/EnumArrays.java new file mode 100644 index 000000000000..29d6ebaa8fb4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/EnumArrays.java @@ -0,0 +1,164 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/EnumClass.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/EnumClass.java new file mode 100644 index 000000000000..ce974651d829 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/EnumClass.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/EnumTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/EnumTest.java new file mode 100644 index 000000000000..d2d7d27c9414 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/EnumTest.java @@ -0,0 +1,345 @@ +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; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java new file mode 100644 index 000000000000..b50b92931cf5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,89 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class FakeBigDecimalMap200Response { + + private BigDecimal someId; + private Map someMap = new HashMap<>(); + + /** + * Default constructor. + */ + public FakeBigDecimalMap200Response() { + // JSON-B / Jackson + } + + /** + * Create FakeBigDecimalMap200Response. + * + * @param someId someId + * @param someMap someMap + */ + public FakeBigDecimalMap200Response( + BigDecimal someId, + Map someMap + ) { + this.someId = someId; + this.someMap = someMap; + } + + + + /** + * Get someId + * @return someId + */ + public BigDecimal getSomeId() { + return someId; + } + + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + /** + * Get someMap + * @return someMap + */ + public Map getSomeMap() { + return someMap; + } + + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java new file mode 100644 index 000000000000..2b6964db9dec --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java @@ -0,0 +1,89 @@ +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.ModelFile; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class FileSchemaTestClass { + + private ModelFile _file; + private List<@Valid ModelFile> files = new ArrayList<>(); + + /** + * Default constructor. + */ + public FileSchemaTestClass() { + // JSON-B / Jackson + } + + /** + * Create FileSchemaTestClass. + * + * @param _file _file + * @param files files + */ + public FileSchemaTestClass( + ModelFile _file, + List<@Valid ModelFile> 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<@Valid ModelFile> getFiles() { + return files; + } + + public void setFiles(List<@Valid ModelFile> 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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Foo.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Foo.java new file mode 100644 index 000000000000..e02a00803c22 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Foo.java @@ -0,0 +1,68 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java new file mode 100644 index 000000000000..40f8d5855417 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java @@ -0,0 +1,70 @@ +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; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/FormatTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/FormatTest.java new file mode 100644 index 000000000000..92e3aef3e80d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/FormatTest.java @@ -0,0 +1,339 @@ +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; + + + +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("*").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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/GenericTypes.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/GenericTypes.java new file mode 100644 index 000000000000..b05ff79a8f5e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/GenericTypes.java @@ -0,0 +1,14 @@ +package org.openapitools.server.model; + +import java.util.List; +import java.util.Map; + +import io.helidon.common.GenericType; + +public interface GenericTypes { + GenericType> TYPE__List_EnumClass = new GenericType<>() {}; + GenericType> TYPE__List_String = new GenericType<>() {}; + GenericType> TYPE__List_User = new GenericType<>() {}; + GenericType> TYPE__Map_Object = new GenericType<>() {}; + GenericType> TYPE__Map_String = new GenericType<>() {}; +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java new file mode 100644 index 000000000000..50c41f059e3b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java @@ -0,0 +1,86 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/HealthCheckResult.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/HealthCheckResult.java new file mode 100644 index 000000000000..5b865aa0e3f3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/HealthCheckResult.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import org.openapitools.jackson.nullable.JsonNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/MapTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/MapTest.java new file mode 100644 index 000000000000..f8051c6e3e45 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/MapTest.java @@ -0,0 +1,160 @@ +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; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 000000000000..9f2e5dc7bbef --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,107 @@ +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; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Model200Response.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Model200Response.java new file mode 100644 index 000000000000..28f6bd2cdac0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Model200Response.java @@ -0,0 +1,88 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ModelApiResponse.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ModelApiResponse.java new file mode 100644 index 000000000000..81a468f1af79 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ModelApiResponse.java @@ -0,0 +1,103 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ModelFile.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ModelFile.java new file mode 100644 index 000000000000..6743c641a001 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ModelFile.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ModelList.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ModelList.java new file mode 100644 index 000000000000..88000df9959e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ModelList.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ModelReturn.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ModelReturn.java new file mode 100644 index 000000000000..a11d5e2b4e49 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ModelReturn.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Name.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Name.java new file mode 100644 index 000000000000..a3524465b284 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Name.java @@ -0,0 +1,121 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/NullableClass.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/NullableClass.java new file mode 100644 index 000000000000..11e7e2ec0fd0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/NullableClass.java @@ -0,0 +1,264 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +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; + + + +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; + private List arrayAndItemsNullableProp; + private List arrayItemsNullable = new ArrayList<>(); + private Map objectNullableProp; + private Map objectAndItemsNullableProp; + 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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/NumberOnly.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/NumberOnly.java new file mode 100644 index 000000000000..7caf3c857f39 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/NumberOnly.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java new file mode 100644 index 000000000000..83bc634c1d6b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,124 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.DeprecatedObject; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Order.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Order.java new file mode 100644 index 000000000000..0ca5e240f6f6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Order.java @@ -0,0 +1,194 @@ +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; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterComposite.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterComposite.java new file mode 100644 index 000000000000..696e549642d2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterComposite.java @@ -0,0 +1,103 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterEnum.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterEnum.java new file mode 100644 index 000000000000..5a6730ab1b57 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterEnum.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java new file mode 100644 index 000000000000..986b7b1f7f60 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterEnumInteger.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterEnumInteger.java new file mode 100644 index 000000000000..ad5c4c2d3784 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterEnumInteger.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 000000000000..93151449261e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java new file mode 100644 index 000000000000..cd57e792975e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.OuterEnumInteger; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ParentWithNullable.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ParentWithNullable.java new file mode 100644 index 000000000000..e458a6ed3400 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ParentWithNullable.java @@ -0,0 +1,127 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class ParentWithNullable { + + + /** + * Gets or Sets type + */ + public enum TypeEnum { + CHILD_WITH_NULLABLE("ChildWithNullable"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static TypeEnum fromValue(String text) { + for (TypeEnum b : TypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private TypeEnum type; + private String nullableProperty; + + /** + * Default constructor. + */ + public ParentWithNullable() { + // JSON-B / Jackson + } + + /** + * Create ParentWithNullable. + * + * @param type type + * @param nullableProperty nullableProperty + */ + public ParentWithNullable( + TypeEnum type, + String nullableProperty + ) { + this.type = type; + this.nullableProperty = nullableProperty; + } + + + + /** + * Get type + * @return type + */ + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + /** + * Get nullableProperty + * @return nullableProperty + */ + public String getNullableProperty() { + return nullableProperty; + } + + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Pet.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Pet.java new file mode 100644 index 000000000000..671a9be156dc --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Pet.java @@ -0,0 +1,201 @@ +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.Arrays; +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; + + + +public class Pet { + + private Long id; + private Category category; + private String name; + private Set photoUrls = new LinkedHashSet<>(); + private List<@Valid Tag> 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<@Valid Tag> 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<@Valid Tag> getTags() { + return tags; + } + + public void setTags(List<@Valid Tag> 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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java new file mode 100644 index 000000000000..6e9d1f16fb1d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java @@ -0,0 +1,85 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/SingleRefType.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/SingleRefType.java new file mode 100644 index 000000000000..d7ada5dddeaf --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/SingleRefType.java @@ -0,0 +1,45 @@ +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; + } + + @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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/SpecialModelName.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/SpecialModelName.java new file mode 100644 index 000000000000..9c14659f899a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/SpecialModelName.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Tag.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Tag.java new file mode 100644 index 000000000000..e0d425d782e2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/Tag.java @@ -0,0 +1,85 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 000000000000..499fa5013feb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + private String someProperty; + + /** + * Default constructor. + */ + public TestInlineFreeformAdditionalPropertiesRequest() { + // JSON-B / Jackson + } + + /** + * Create TestInlineFreeformAdditionalPropertiesRequest. + * + * @param someProperty someProperty + */ + public TestInlineFreeformAdditionalPropertiesRequest( + String someProperty + ) { + this.someProperty = someProperty; + } + + + + /** + * Get someProperty + * @return someProperty + */ + public String getSomeProperty() { + return someProperty; + } + + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/User.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/User.java new file mode 100644 index 000000000000..9decbea90472 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/model/User.java @@ -0,0 +1,187 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/package-info.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/java/org/openapitools/server/package-info.java new file mode 100644 index 000000000000..1025e91aed8f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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/v4/se-uac-group-by-file-path/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/resources/META-INF/openapi.yml new file mode 100644 index 000000000000..a08bc26cc144 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/resources/META-INF/openapi.yml @@ -0,0 +1,2362 @@ +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 + - application/xml + /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 + - application/xml + /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 + - application/xml + 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-webclient-blocking: false + 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 + - application/xml + /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 generate 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 + - application/xml + /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 + - application/xml + /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 + - application/xml + 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: Something 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/BigDecimalMap: + get: + description: "for Java apache and Java native, test toUrlQueryString for maps\ + \ with BegDecimal keys" + operationId: fakeBigDecimalMap + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/fakeBigDecimalMap_200_response' + description: successful operation + tags: + - fake + 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/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + 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/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/nullable: + post: + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChildWithNullable' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test nullable parent property + 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 + xml: + name: photoUrl + type: array + uniqueItems: true + xml: + 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' + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' + 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 + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + 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 + ParentWithNullable: + discriminator: + propertyName: type + properties: + type: + enum: + - ChildWithNullable + type: string + nullableProperty: + nullable: true + type: string + type: object + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - properties: + otherProperty: + type: string + type: object + example: + otherProperty: otherProperty + nullableProperty: nullableProperty + type: ChildWithNullable + 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 + fakeBigDecimalMap_200_response: + example: + someId: 0.8008281904610115 + someMap: + key: 6.027456183070403 + properties: + someId: + type: number + someMap: + additionalProperties: + type: number + type: object + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + 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 + 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/v4/se-uac-group-by-file-path/src/main/resources/application.yaml b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/resources/application.yaml new file mode 100644 index 000000000000..2c0422edc74a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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/v4/se-uac-group-by-file-path/src/main/resources/logging.properties b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/resources/logging.properties new file mode 100644 index 000000000000..c9bc271dee7a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/main/resources/logging.properties @@ -0,0 +1,18 @@ + +# Example Logging Configuration File +# For more information see $JAVA_HOME/jre/lib/logging.properties + +# Send messages to the console +handlers=java.util.logging.ConsoleHandler + +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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/MainTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/MainTest.java new file mode 100644 index 000000000000..d86de4629d51 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/MainTest.java @@ -0,0 +1,39 @@ +package org.openapitools.server; + +import java.util.Collections; + +import jakarta.json.Json; +import jakarta.json.JsonBuilderFactory; + +import io.helidon.webclient.http1.Http1Client; +import io.helidon.webserver.http.HttpRouting; +import io.helidon.webserver.testing.junit5.ServerTest; +import io.helidon.webserver.testing.junit5.SetUpRoute; + +import org.junit.jupiter.api.Test; + +@ServerTest +public class MainTest { + + private static final JsonBuilderFactory JSON_BUILDER = Json.createBuilderFactory(Collections.emptyMap()); + + + + private Http1Client client; + + MainTest(Http1Client client) { + this.client = client; + } + + @SetUpRoute + static void routing(HttpRouting.Builder builder) { + Main.routing(builder); + } + + + + + @Test + public void test() throws Exception { + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..f6e06fc52a2b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.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 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java new file mode 100644 index 000000000000..61816df9b409 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.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 com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/AnimalTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/AnimalTest.java new file mode 100644 index 000000000000..9a3043089ff3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/AnimalTest.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 com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..90060def339d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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.Arrays; +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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..4a0fa46c97db --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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.Arrays; +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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ArrayTestTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ArrayTestTest.java new file mode 100644 index 000000000000..f7cc01228ea5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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.Arrays; +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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/CapitalizationTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/CapitalizationTest.java new file mode 100644 index 000000000000..83b61a15b3e9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/CapitalizationTest.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.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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/CatTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/CatTest.java new file mode 100644 index 000000000000..dac6fe611165 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/CatTest.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 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/CategoryTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/CategoryTest.java new file mode 100644 index 000000000000..02b10b942559 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/CategoryTest.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.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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java new file mode 100644 index 000000000000..6246621383e2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.ParentWithNullable; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChildWithNullable + */ +public class ChildWithNullableTest { + private final ChildWithNullable model = new ChildWithNullable(); + + /** + * Model tests for ChildWithNullable + */ + @Test + public void testChildWithNullable() { + // TODO: test ChildWithNullable + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + public void nullablePropertyTest() { + // TODO: test nullableProperty + } + + /** + * Test the property 'otherProperty' + */ + @Test + public void otherPropertyTest() { + // TODO: test otherProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ClassModelTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ClassModelTest.java new file mode 100644 index 000000000000..a16d0d7af9e8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ClassModelTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ClientTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ClientTest.java new file mode 100644 index 000000000000..3edb9feb3d15 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ClientTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java new file mode 100644 index 000000000000..e2eba67dc94b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/DogTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/DogTest.java new file mode 100644 index 000000000000..8143306030f6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/DogTest.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 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/EnumArraysTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/EnumArraysTest.java new file mode 100644 index 000000000000..6d797b45ff82 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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.Arrays; +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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/EnumClassTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/EnumClassTest.java new file mode 100644 index 000000000000..8fa14bec99a4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/EnumClassTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/EnumTestTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/EnumTestTest.java new file mode 100644 index 000000000000..fc60f14abf27 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/EnumTestTest.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.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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java new file mode 100644 index 000000000000..c38a4e5469f2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.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 com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeBigDecimalMap200Response + */ +public class FakeBigDecimalMap200ResponseTest { + private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); + + /** + * Model tests for FakeBigDecimalMap200Response + */ + @Test + public void testFakeBigDecimalMap200Response() { + // TODO: test FakeBigDecimalMap200Response + } + + /** + * Test the property 'someId' + */ + @Test + public void someIdTest() { + // TODO: test someId + } + + /** + * Test the property 'someMap' + */ + @Test + public void someMapTest() { + // TODO: test someMap + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java new file mode 100644 index 000000000000..11b779605c74 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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.Arrays; +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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java new file mode 100644 index 000000000000..83cb2f5ffb8c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.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.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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FooTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FooTest.java new file mode 100644 index 000000000000..9aecdffde70a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FooTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FormatTestTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FormatTestTest.java new file mode 100644 index 000000000000..3226b83d99ed --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/FormatTestTest.java @@ -0,0 +1,165 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java new file mode 100644 index 000000000000..f247acac7157 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.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 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java new file mode 100644 index 000000000000..594a8baa95c6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/HealthCheckResultTest.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.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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/MapTestTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/MapTestTest.java new file mode 100644 index 000000000000..ab00e116e10a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/MapTestTest.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 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..46eb7361ce6a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.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 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/Model200ResponseTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/Model200ResponseTest.java new file mode 100644 index 000000000000..ad6f6db532c4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/Model200ResponseTest.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 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java new file mode 100644 index 000000000000..47500c309d89 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ModelApiResponseTest.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.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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ModelFileTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ModelFileTest.java new file mode 100644 index 000000000000..21eafc087a27 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ModelFileTest.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 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ModelListTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ModelListTest.java new file mode 100644 index 000000000000..d073083d48a6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ModelListTest.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 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ModelReturnTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ModelReturnTest.java new file mode 100644 index 000000000000..d84cff2fdb06 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ModelReturnTest.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 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/NameTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/NameTest.java new file mode 100644 index 000000000000..ac557c71d0d8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/NameTest.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.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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/NullableClassTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/NullableClassTest.java new file mode 100644 index 000000000000..a33acb6dd853 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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.Arrays; +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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/NumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/NumberOnlyTest.java new file mode 100644 index 000000000000..8d154d78f6e3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/NumberOnlyTest.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 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 000000000000..75417286d72b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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.Arrays; +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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OrderTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OrderTest.java new file mode 100644 index 000000000000..8ac0b0fbdd00 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OrderTest.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterCompositeTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterCompositeTest.java new file mode 100644 index 000000000000..29769579ebfc --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterCompositeTest.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.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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java new file mode 100644 index 000000000000..79a4bb7cf334 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 000000000000..8b693a146618 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java new file mode 100644 index 000000000000..bfc747798376 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterEnumTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterEnumTest.java new file mode 100644 index 000000000000..182b6b964185 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterEnumTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 000000000000..e06cefec2845 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.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.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java new file mode 100644 index 000000000000..466dc910f557 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ParentWithNullableTest.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.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ParentWithNullable + */ +public class ParentWithNullableTest { + private final ParentWithNullable model = new ParentWithNullable(); + + /** + * Model tests for ParentWithNullable + */ + @Test + public void testParentWithNullable() { + // TODO: test ParentWithNullable + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + public void nullablePropertyTest() { + // TODO: test nullableProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/PetTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/PetTest.java new file mode 100644 index 000000000000..0beb36cbe364 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/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.Arrays; +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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java new file mode 100644 index 000000000000..1cb2ad846425 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.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.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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java new file mode 100644 index 000000000000..a698b5ecb972 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java new file mode 100644 index 000000000000..45e482228aca --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/SpecialModelNameTest.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 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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/TagTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/TagTest.java new file mode 100644 index 000000000000..ead74db6880b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/TagTest.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.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/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 000000000000..55c3e0e12bb3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.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 java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/UserTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/UserTest.java new file mode 100644 index 000000000000..a9dbfb06dedd --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac-group-by-file-path/src/test/java/org/openapitools/server/model/UserTest.java @@ -0,0 +1,95 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/.openapi-generator-ignore b/samples/server/petstore/java-helidon-server/v4/se-uac/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/.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/v4/se-uac/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/v4/se-uac/.openapi-generator/FILES new file mode 100644 index 000000000000..2f92e8bce839 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/.openapi-generator/FILES @@ -0,0 +1,86 @@ +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/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/JsonProvider.java +src/main/java/org/openapitools/server/api/PartsUtils.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/Category.java +src/main/java/org/openapitools/server/model/ChildWithNullable.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/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/FakeBigDecimalMap200Response.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/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.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/ParentWithNullable.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/TestInlineFreeformAdditionalPropertiesRequest.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 diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/.openapi-generator/VERSION b/samples/server/petstore/java-helidon-server/v4/se-uac/.openapi-generator/VERSION new file mode 100644 index 000000000000..6116b14d2c59 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/README.md b/samples/server/petstore/java-helidon-server/v4/se-uac/README.md new file mode 100644 index 000000000000..3442efc621ab --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/README.md @@ -0,0 +1,79 @@ +# 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/BigDecimalMap +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 POST http://petstore.swagger.io:80/v2/fake/additionalProperties-reference +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 POST http://petstore.swagger.io:80/v2/fake/inline-freeform-additionalProperties +curl -X GET http://petstore.swagger.io:80/v2/fake/jsonFormData +curl -X POST http://petstore.swagger.io:80/v2/fake/nullable +curl -X PUT http://petstore.swagger.io:80/v2/fake/test-query-parameters +curl -X POST http://petstore.swagger.io:80/v2/fake/stringMap-reference +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/v4/se-uac/pom.xml b/samples/server/petstore/java-helidon-server/v4/se-uac/pom.xml new file mode 100644 index 000000000000..6a843edad14f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/pom.xml @@ -0,0 +1,122 @@ + + + 4.0.0 + + io.helidon.applications + helidon-se + 4.0.11 + + + 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.6 + + + + + jakarta.validation + jakarta.validation-api + + + io.helidon.webserver + helidon-webserver + + + io.helidon.http.media + helidon-http-media-jsonp + + + io.helidon.http.media + helidon-http-media-multipart + + + io.helidon.config + helidon-config-yaml + + + io.helidon.webserver.observe + helidon-webserver-observe-health + + + io.helidon.health + helidon-health + + + io.helidon.health + helidon-health-checks + + + io.helidon.webserver.observe + helidon-webserver-observe-metrics + + + io.helidon.metrics + helidon-metrics-system-meters + runtime + + + io.helidon.logging + helidon-logging-jul + runtime + + + io.helidon.openapi + helidon-openapi + + + org.openapitools + jackson-databind-nullable + ${version.jackson.databind.nullable} + + + io.helidon.http.media + helidon-http-media-jackson + + + org.junit.jupiter + junit-jupiter-api + test + + + io.helidon.webclient + helidon-webclient + test + + + io.helidon.webserver.testing.junit5 + helidon-webserver-testing-junit5 + 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/v4/se-uac/src/main/java/org/openapitools/server/Main.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/Main.java new file mode 100644 index 000000000000..17d6343e2d6a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/Main.java @@ -0,0 +1,72 @@ +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.logging.common.LogConfig; +import io.helidon.config.Config; +import io.helidon.webserver.http.HttpRouting; +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 WebServer startServer() { + + // load logging configuration + LogConfig.configureRuntime(); + + // By default this will pick up application.yaml from the classpath + Config config = Config.create(); + Config.global(config); + + WebServer webserver = WebServer.builder() + .config(config.get("server")) + .routing(Main::routing) + .build() + .start(); + + System.out.println("WEB server is up! http://petstore.swagger.io:80/v2"); + + return webserver; + } + + /** + * Updates HTTP routing and implicitly registers observe providers. + */ + static void routing(HttpRouting.Builder routing) { + routing + .register("/another-fake/dummy", new AnotherFakeServiceImpl()) + .register("/foo", new DefaultServiceImpl()) + .register("/fake", new FakeServiceImpl()) + .register("/fake_classname_test", new FakeClassnameTags123ServiceImpl()) + .register("/", new PetServiceImpl())/* TODO - fix path or operation grouping for better performance */ + .register("/store", new StoreServiceImpl()) + .register("/user", new UserServiceImpl()); + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/RFC3339DateFormat.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/RFC3339DateFormat.java new file mode 100644 index 000000000000..f47f2f7f9837 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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/v4/se-uac/src/main/java/org/openapitools/server/api/AnotherFakeService.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/AnotherFakeService.java new file mode 100644 index 000000000000..368198eb72b6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/AnotherFakeService.java @@ -0,0 +1,185 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'AnotherFake'", + version = "stable") +public abstract class AnotherFakeService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected Call123testSpecialTagsOp call123testSpecialTagsOp = createCall123testSpecialTagsOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.patch("/", this::call123testSpecialTags); + } + + + /** + * PATCH /another-fake/dummy : To test special tags. + * + * @param request the server request + * @param response the server response + */ + protected void call123testSpecialTags(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Client + Client client = call123testSpecialTagsOp.client(request, validator); + validator.require("client", client); + + validator.execute(); + + handleCall123testSpecialTags(request, response, + client); + } + + /** + * Handle PATCH /another-fake/dummy : To test special tags. + * + * @param request the server request + * @param response the server response + * @param client client model + */ + protected abstract void handleCall123testSpecialTags(ServerRequest request, ServerResponse response, + Client client); + + /** + * Returns a new instance of the class which handles parameters to and responses from the call123testSpecialTags operation. + *

+ * Developers can override this method if they extend the AnotherFakeService class. + *

+ * + * @return new Call123testSpecialTags + */ + protected Call123testSpecialTagsOp createCall123testSpecialTagsOp() { + return new Call123testSpecialTagsOp(); + } + + /** + * Helper elements for the {@code call123testSpecialTags} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class Call123testSpecialTagsOp { + + /** + * Prepares the client parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return client parameter value + */ + protected Client client(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Client.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Client response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the call123testSpecialTags operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Client response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Client response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service AnotherFakeService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java new file mode 100644 index 000000000000..0b96717f4294 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java @@ -0,0 +1,19 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class AnotherFakeServiceImpl extends AnotherFakeService { + + @Override + protected void handleCall123testSpecialTags(ServerRequest request, ServerResponse response, + Client client) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/DefaultService.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/DefaultService.java new file mode 100644 index 000000000000..f14c5b9f167f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/DefaultService.java @@ -0,0 +1,182 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.FooGetDefaultResponse; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'Default'", + version = "stable") +public abstract class DefaultService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected FooGetOp fooGetOp = createFooGetOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.get("/", this::fooGet); + } + + + /** + * GET /foo. + * + * @param request the server request + * @param response the server response + */ + protected void fooGet(ServerRequest request, ServerResponse response) { + + handleFooGet(request, response); + } + + /** + * Handle GET /foo. + * + * @param request the server request + * @param response the server response + */ + protected abstract void handleFooGet(ServerRequest request, ServerResponse response); + + /** + * Returns a new instance of the class which handles parameters to and responses from the fooGet operation. + *

+ * Developers can override this method if they extend the DefaultService class. + *

+ * + * @return new FooGet + */ + protected FooGetOp createFooGetOp() { + return new FooGetOp(); + } + + /** + * Helper elements for the {@code fooGet} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FooGetOp { + + /** + * Default result. + * + * @param status (required) Status value to be sent with this default result + * @param response + */ + record Default(Status status, FooGetDefaultResponse response) { + + /** + * Creates a response builder for the default response + * for the fooGet operation; there are no required result values for this response. + * + * @return new builder for status 0 + */ + static Builder builder(Status status) { + return new Builder(status); + } + + /** + * Builder for the Default result. + */ + static class Builder implements io.helidon.common.Builder { + + private FooGetDefaultResponse response; + private final Status status; + Builder(Status status) { + this.status = status; + + } + @Override + public Default build() { + return new Default(status, + response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(FooGetDefaultResponse response) { + this.response = response; + return this; + } + } + + /** + * Constructor for a result for the default result + * for the fooGet operation, verifying non-null values for required return data. + * + * @param response returned entity + */ + public Default(Status status, FooGetDefaultResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + validator.require("status for default response", status); + validator.execute(); + this.status = status; + this.response = response; + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(status); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service DefaultService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java new file mode 100644 index 000000000000..8e587d42ca7e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java @@ -0,0 +1,18 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.FooGetDefaultResponse; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class DefaultServiceImpl extends DefaultService { + + @Override + protected void handleFooGet(ServerRequest request, ServerResponse response) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java new file mode 100644 index 000000000000..7572ca0434c7 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java @@ -0,0 +1,185 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'FakeClassnameTags123'", + version = "stable") +public abstract class FakeClassnameTags123Service implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected TestClassnameOp testClassnameOp = createTestClassnameOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.patch("/", this::testClassname); + } + + + /** + * PATCH /fake_classname_test : To test class name in snake case. + * + * @param request the server request + * @param response the server response + */ + protected void testClassname(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Client + Client client = testClassnameOp.client(request, validator); + validator.require("client", client); + + validator.execute(); + + handleTestClassname(request, response, + client); + } + + /** + * Handle 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 + */ + protected abstract void handleTestClassname(ServerRequest request, ServerResponse response, + Client client); + + /** + * Returns a new instance of the class which handles parameters to and responses from the testClassname operation. + *

+ * Developers can override this method if they extend the FakeClassnameTags123Service class. + *

+ * + * @return new TestClassname + */ + protected TestClassnameOp createTestClassnameOp() { + return new TestClassnameOp(); + } + + /** + * Helper elements for the {@code testClassname} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestClassnameOp { + + /** + * Prepares the client parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return client parameter value + */ + protected Client client(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Client.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Client response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the testClassname operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Client response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Client response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service FakeClassnameTags123Service is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java new file mode 100644 index 000000000000..cfe38b003a88 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java @@ -0,0 +1,19 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class FakeClassnameTags123ServiceImpl extends FakeClassnameTags123Service { + + @Override + protected void handleTestClassname(ServerRequest request, ServerResponse response, + Client client) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/FakeService.java new file mode 100644 index 000000000000..a308fb480027 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/FakeService.java @@ -0,0 +1,3892 @@ +package org.openapitools.server.api; + +import java.util.ArrayList; +import java.math.BigDecimal; +import org.openapitools.server.model.ChildWithNullable; +import org.openapitools.server.model.Client; +import java.util.stream.Collectors; +import org.openapitools.server.model.EnumClass; +import org.openapitools.server.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.server.model.FileSchemaTestClass; +import java.nio.file.Files; +import org.openapitools.server.model.GenericTypes; +import java.util.HashMap; +import io.helidon.http.HeaderNames; +import io.helidon.http.Headers; +import org.openapitools.server.model.HealthCheckResult; +import java.util.HexFormat; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.time.LocalDate; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Objects; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.server.model.OuterComposite; +import org.openapitools.server.model.OuterObjectWithEnumProperty; +import io.helidon.common.parameters.Parameters; +import java.nio.file.Path; +import org.openapitools.server.model.Pet; +import io.helidon.http.media.multipart.ReadablePart; +import io.helidon.http.Status; +import org.openapitools.server.model.TestInlineFreeformAdditionalPropertiesRequest; +import java.io.UncheckedIOException; +import org.openapitools.server.model.User; +import io.helidon.common.mapper.Value; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'Fake'", + version = "stable") +public abstract class FakeService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected FakeBigDecimalMapOp fakeBigDecimalMapOp = createFakeBigDecimalMapOp(); + protected FakeHealthGetOp fakeHealthGetOp = createFakeHealthGetOp(); + protected FakeHttpSignatureTestOp fakeHttpSignatureTestOp = createFakeHttpSignatureTestOp(); + protected FakeOuterBooleanSerializeOp fakeOuterBooleanSerializeOp = createFakeOuterBooleanSerializeOp(); + protected FakeOuterCompositeSerializeOp fakeOuterCompositeSerializeOp = createFakeOuterCompositeSerializeOp(); + protected FakeOuterNumberSerializeOp fakeOuterNumberSerializeOp = createFakeOuterNumberSerializeOp(); + protected FakeOuterStringSerializeOp fakeOuterStringSerializeOp = createFakeOuterStringSerializeOp(); + protected FakePropertyEnumIntegerSerializeOp fakePropertyEnumIntegerSerializeOp = createFakePropertyEnumIntegerSerializeOp(); + protected TestAdditionalPropertiesReferenceOp testAdditionalPropertiesReferenceOp = createTestAdditionalPropertiesReferenceOp(); + protected TestBodyWithBinaryOp testBodyWithBinaryOp = createTestBodyWithBinaryOp(); + protected TestBodyWithFileSchemaOp testBodyWithFileSchemaOp = createTestBodyWithFileSchemaOp(); + protected TestBodyWithQueryParamsOp testBodyWithQueryParamsOp = createTestBodyWithQueryParamsOp(); + protected TestClientModelOp testClientModelOp = createTestClientModelOp(); + protected TestEndpointParametersOp testEndpointParametersOp = createTestEndpointParametersOp(); + protected TestEnumParametersOp testEnumParametersOp = createTestEnumParametersOp(); + protected TestGroupParametersOp testGroupParametersOp = createTestGroupParametersOp(); + protected TestInlineAdditionalPropertiesOp testInlineAdditionalPropertiesOp = createTestInlineAdditionalPropertiesOp(); + protected TestInlineFreeformAdditionalPropertiesOp testInlineFreeformAdditionalPropertiesOp = createTestInlineFreeformAdditionalPropertiesOp(); + protected TestJsonFormDataOp testJsonFormDataOp = createTestJsonFormDataOp(); + protected TestNullableOp testNullableOp = createTestNullableOp(); + protected TestQueryParameterCollectionFormatOp testQueryParameterCollectionFormatOp = createTestQueryParameterCollectionFormatOp(); + protected TestStringMapReferenceOp testStringMapReferenceOp = createTestStringMapReferenceOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.get("/BigDecimalMap", this::fakeBigDecimalMap); + rules.get("/health", this::fakeHealthGet); + rules.get("/http-signature-test", this::fakeHttpSignatureTest); + rules.post("/outer/boolean", this::fakeOuterBooleanSerialize); + rules.post("/outer/composite", this::fakeOuterCompositeSerialize); + rules.post("/outer/number", this::fakeOuterNumberSerialize); + rules.post("/outer/string", this::fakeOuterStringSerialize); + rules.post("/property/enum-int", this::fakePropertyEnumIntegerSerialize); + rules.post("/additionalProperties-reference", this::testAdditionalPropertiesReference); + rules.put("/body-with-binary", this::testBodyWithBinary); + rules.put("/body-with-file-schema", this::testBodyWithFileSchema); + rules.put("/body-with-query-params", this::testBodyWithQueryParams); + rules.patch("/", this::testClientModel); + rules.post("/", this::testEndpointParameters); + rules.get("/", this::testEnumParameters); + rules.delete("/", this::testGroupParameters); + rules.post("/inline-additionalProperties", this::testInlineAdditionalProperties); + rules.post("/inline-freeform-additionalProperties", this::testInlineFreeformAdditionalProperties); + rules.get("/jsonFormData", this::testJsonFormData); + rules.post("/nullable", this::testNullable); + rules.put("/test-query-parameters", this::testQueryParameterCollectionFormat); + rules.post("/stringMap-reference", this::testStringMapReference); + } + + + /** + * GET /fake/BigDecimalMap. + * + * @param request the server request + * @param response the server response + */ + protected void fakeBigDecimalMap(ServerRequest request, ServerResponse response) { + + handleFakeBigDecimalMap(request, response); + } + + /** + * Handle GET /fake/BigDecimalMap. + * + * @param request the server request + * @param response the server response + */ + protected abstract void handleFakeBigDecimalMap(ServerRequest request, ServerResponse response); + + /** + * GET /fake/health : Health check endpoint. + * + * @param request the server request + * @param response the server response + */ + protected void fakeHealthGet(ServerRequest request, ServerResponse response) { + + handleFakeHealthGet(request, response); + } + + /** + * Handle GET /fake/health : Health check endpoint. + * + * @param request the server request + * @param response the server response + */ + protected abstract void handleFakeHealthGet(ServerRequest request, ServerResponse response); + + /** + * GET /fake/http-signature-test : test http signature authentication. + * + * @param request the server request + * @param response the server response + */ + protected void fakeHttpSignatureTest(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Pet + Pet pet = fakeHttpSignatureTestOp.pet(request, validator); + validator.require("pet", pet); + + + // Parameter: query_1 + Optional query1 = fakeHttpSignatureTestOp.query1(request, validator); + + + // Parameter: header_1 + Optional header1 = fakeHttpSignatureTestOp.header1(request, validator); + + validator.execute(); + + handleFakeHttpSignatureTest(request, response, + pet, + query1, + header1); + } + + /** + * Handle 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 + * @param query1 query parameter + * @param header1 header parameter + */ + protected abstract void handleFakeHttpSignatureTest(ServerRequest request, ServerResponse response, + Pet pet, + Optional query1, + Optional header1); + + /** + * POST /fake/outer/boolean. + * + * @param request the server request + * @param response the server response + */ + protected void fakeOuterBooleanSerialize(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: body + Optional body = fakeOuterBooleanSerializeOp.body(request, validator); + + validator.execute(); + + handleFakeOuterBooleanSerialize(request, response, + body); + } + + /** + * Handle POST /fake/outer/boolean. + * + * @param request the server request + * @param response the server response + * @param body Input boolean as post body + */ + protected abstract void handleFakeOuterBooleanSerialize(ServerRequest request, ServerResponse response, + Optional body); + + /** + * POST /fake/outer/composite. + * + * @param request the server request + * @param response the server response + */ + protected void fakeOuterCompositeSerialize(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: OuterComposite + Optional outerComposite = fakeOuterCompositeSerializeOp.outerComposite(request, validator); + + validator.execute(); + + handleFakeOuterCompositeSerialize(request, response, + outerComposite); + } + + /** + * Handle POST /fake/outer/composite. + * + * @param request the server request + * @param response the server response + * @param outerComposite Input composite as post body + */ + protected abstract void handleFakeOuterCompositeSerialize(ServerRequest request, ServerResponse response, + Optional outerComposite); + + /** + * POST /fake/outer/number. + * + * @param request the server request + * @param response the server response + */ + protected void fakeOuterNumberSerialize(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: body + Optional body = fakeOuterNumberSerializeOp.body(request, validator); + + validator.execute(); + + handleFakeOuterNumberSerialize(request, response, + body); + } + + /** + * Handle POST /fake/outer/number. + * + * @param request the server request + * @param response the server response + * @param body Input number as post body + */ + protected abstract void handleFakeOuterNumberSerialize(ServerRequest request, ServerResponse response, + Optional body); + + /** + * POST /fake/outer/string. + * + * @param request the server request + * @param response the server response + */ + protected void fakeOuterStringSerialize(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: body + Optional body = fakeOuterStringSerializeOp.body(request, validator); + + validator.execute(); + + handleFakeOuterStringSerialize(request, response, + body); + } + + /** + * Handle POST /fake/outer/string. + * + * @param request the server request + * @param response the server response + * @param body Input string as post body + */ + protected abstract void handleFakeOuterStringSerialize(ServerRequest request, ServerResponse response, + Optional body); + + /** + * POST /fake/property/enum-int. + * + * @param request the server request + * @param response the server response + */ + protected void fakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: OuterObjectWithEnumProperty + OuterObjectWithEnumProperty outerObjectWithEnumProperty = fakePropertyEnumIntegerSerializeOp.outerObjectWithEnumProperty(request, validator); + validator.require("outerObjectWithEnumProperty", outerObjectWithEnumProperty); + + validator.execute(); + + handleFakePropertyEnumIntegerSerialize(request, response, + outerObjectWithEnumProperty); + } + + /** + * Handle POST /fake/property/enum-int. + * + * @param request the server request + * @param response the server response + * @param outerObjectWithEnumProperty Input enum (int) as post body + */ + protected abstract void handleFakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response, + OuterObjectWithEnumProperty outerObjectWithEnumProperty); + + /** + * POST /fake/additionalProperties-reference : test referenced additionalProperties. + * + * @param request the server request + * @param response the server response + */ + protected void testAdditionalPropertiesReference(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: request_body + Map requestBody = testAdditionalPropertiesReferenceOp.requestBody(request, validator); + validator.require("requestBody", requestBody); + + validator.execute(); + + handleTestAdditionalPropertiesReference(request, response, + requestBody); + } + + /** + * Handle POST /fake/additionalProperties-reference : test referenced additionalProperties. + * + * @param request the server request + * @param response the server response + * @param requestBody request body + */ + protected abstract void handleTestAdditionalPropertiesReference(ServerRequest request, ServerResponse response, + Map requestBody); + + /** + * PUT /fake/body-with-binary. + * + * @param request the server request + * @param response the server response + */ + protected void testBodyWithBinary(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: body + InputStream body = testBodyWithBinaryOp.body(request, validator); + validator.require("body", body); + + validator.execute(); + + handleTestBodyWithBinary(request, response, + body); + } + + /** + * Handle PUT /fake/body-with-binary. + * + * @param request the server request + * @param response the server response + * @param body image to upload + */ + protected abstract void handleTestBodyWithBinary(ServerRequest request, ServerResponse response, + InputStream body); + + /** + * PUT /fake/body-with-file-schema. + * + * @param request the server request + * @param response the server response + */ + protected void testBodyWithFileSchema(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: FileSchemaTestClass + FileSchemaTestClass fileSchemaTestClass = testBodyWithFileSchemaOp.fileSchemaTestClass(request, validator); + validator.require("fileSchemaTestClass", fileSchemaTestClass); + + validator.execute(); + + handleTestBodyWithFileSchema(request, response, + fileSchemaTestClass); + } + + /** + * Handle PUT /fake/body-with-file-schema. + * + * @param request the server request + * @param response the server response + * @param fileSchemaTestClass fileSchemaTestClass + */ + protected abstract void handleTestBodyWithFileSchema(ServerRequest request, ServerResponse response, + FileSchemaTestClass fileSchemaTestClass); + + /** + * PUT /fake/body-with-query-params. + * + * @param request the server request + * @param response the server response + */ + protected void testBodyWithQueryParams(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: query + String query = testBodyWithQueryParamsOp.query(request, validator); + + validator.require("query", query); + + // Parameter: User + User user = testBodyWithQueryParamsOp.user(request, validator); + validator.require("user", user); + + validator.execute(); + + handleTestBodyWithQueryParams(request, response, + query, + user); + } + + /** + * Handle PUT /fake/body-with-query-params. + * + * @param request the server request + * @param response the server response + * @param query query + * @param user user + */ + protected abstract void handleTestBodyWithQueryParams(ServerRequest request, ServerResponse response, + String query, + User user); + + /** + * PATCH /fake : To test \"client\" model. + * + * @param request the server request + * @param response the server response + */ + protected void testClientModel(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Client + Client client = testClientModelOp.client(request, validator); + validator.require("client", client); + + validator.execute(); + + handleTestClientModel(request, response, + client); + } + + /** + * Handle PATCH /fake : To test \"client\" model. + * + * @param request the server request + * @param response the server response + * @param client client model + */ + protected abstract void handleTestClientModel(ServerRequest request, ServerResponse response, + Client client); + + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 . + * + * @param request the server request + * @param response the server response + */ + protected void testEndpointParameters(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + + Parameters formParams = request.content().as(Parameters.class); + + // Parameter: number + BigDecimal number = testEndpointParametersOp.number(request, formParams, validator); + + validator.require("number", number); + validator.validateMin("number", number, "32.1", true); + validator.validateMax("number", number, "543.2", true); + + // Parameter: double + Double _double = testEndpointParametersOp._double(request, formParams, validator); + + validator.require("_double", _double); + validator.validateMin("_double", _double, 67.8d, true); + validator.validateMax("_double", _double, 123.4d, true); + + // Parameter: pattern_without_delimiter + String patternWithoutDelimiter = testEndpointParametersOp.patternWithoutDelimiter(request, formParams, validator); + + validator.require("patternWithoutDelimiter", patternWithoutDelimiter); validator.validatePattern("patternWithoutDelimiter", patternWithoutDelimiter, "^[A-Z].*"); + + // Parameter: byte + byte[] _byte = testEndpointParametersOp._byte(request, formParams, validator); + + validator.require("_byte", _byte); + + // Parameter: integer + Optional integer = testEndpointParametersOp.integer(request, formParams, validator); + + validator.validateMin("integer", integer, 10, true); + validator.validateMax("integer", integer, 100, true); + + // Parameter: int32 + Optional int32 = testEndpointParametersOp.int32(request, formParams, validator); + + validator.validateMin("int32", int32, 20, true); + validator.validateMax("int32", int32, 200, true); + + // Parameter: int64 + Optional int64 = testEndpointParametersOp.int64(request, formParams, validator); + + + // Parameter: float + Optional _float = testEndpointParametersOp._float(request, formParams, validator); + + validator.validateMax("_float", _float, 987.6f, true); + + // Parameter: string + Optional string = testEndpointParametersOp.string(request, formParams, validator); + validator.validatePattern("string", string, "/[a-z]/i"); + + // Parameter: binary + Optional binary = testEndpointParametersOp.binary(request, formParams, validator); + + + // Parameter: date + Optional date = testEndpointParametersOp.date(request, formParams, validator); + + + // Parameter: dateTime + Optional dateTime = testEndpointParametersOp.dateTime(request, formParams, validator); + + + // Parameter: password + Optional password = testEndpointParametersOp.password(request, formParams, validator); + + validator.validateSize("password", password, 10, 64); + + // Parameter: callback + Optional paramCallback = testEndpointParametersOp.paramCallback(request, formParams, validator); + + validator.execute(); + + handleTestEndpointParameters(request, response, + number, + _double, + patternWithoutDelimiter, + _byte, + integer, + int32, + int64, + _float, + string, + binary, + date, + dateTime, + password, + paramCallback); + } + + /** + * Handle POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 . + * + * @param request the server request + * @param response the server response + * @param number None + * @param _double None + * @param patternWithoutDelimiter None + * @param _byte None + * @param integer None + * @param int32 None + * @param int64 None + * @param _float None + * @param string None + * @param binary None + * @param date None + * @param dateTime None + * @param password None + * @param paramCallback None + */ + protected abstract void handleTestEndpointParameters(ServerRequest request, ServerResponse response, + BigDecimal number, + Double _double, + String patternWithoutDelimiter, + byte[] _byte, + Optional integer, + Optional int32, + Optional int64, + Optional _float, + Optional string, + Optional binary, + Optional date, + Optional dateTime, + Optional password, + Optional paramCallback); + + /** + * GET /fake : To test enum parameters. + * + * @param request the server request + * @param response the server response + */ + protected void testEnumParameters(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + + Parameters formParams = request.content().as(Parameters.class); + + // Parameter: enum_header_string_array + List enumHeaderStringArray = testEnumParametersOp.enumHeaderStringArray(request, validator); + + + // Parameter: enum_header_string + Optional enumHeaderString = testEnumParametersOp.enumHeaderString(request, validator); + + + // Parameter: enum_query_string_array + List enumQueryStringArray = testEnumParametersOp.enumQueryStringArray(request, validator); + + + // Parameter: enum_query_string + Optional enumQueryString = testEnumParametersOp.enumQueryString(request, validator); + + + // Parameter: enum_query_integer + Optional enumQueryInteger = testEnumParametersOp.enumQueryInteger(request, validator); + + + // Parameter: enum_query_double + Optional enumQueryDouble = testEnumParametersOp.enumQueryDouble(request, validator); + + + // Parameter: enum_query_model_array + List enumQueryModelArray = testEnumParametersOp.enumQueryModelArray(request, validator); + + + // Parameter: enum_form_string_array + List enumFormStringArray = testEnumParametersOp.enumFormStringArray(request, formParams, validator); + + + // Parameter: enum_form_string + Optional enumFormString = testEnumParametersOp.enumFormString(request, formParams, validator); + + validator.execute(); + + handleTestEnumParameters(request, response, + enumHeaderStringArray, + enumHeaderString, + enumQueryStringArray, + enumQueryString, + enumQueryInteger, + enumQueryDouble, + enumQueryModelArray, + enumFormStringArray, + enumFormString); + } + + /** + * Handle GET /fake : To test enum parameters. + * + * @param request the server request + * @param response the server response + * @param enumHeaderStringArray Header parameter enum test (string array) + * @param enumHeaderString Header parameter enum test (string) + * @param enumQueryStringArray Query parameter enum test (string array) + * @param enumQueryString Query parameter enum test (string) + * @param enumQueryInteger Query parameter enum test (double) + * @param enumQueryDouble Query parameter enum test (double) + * @param enumQueryModelArray enumQueryModelArray + * @param enumFormStringArray Form parameter enum test (string array) + * @param enumFormString Form parameter enum test (string) + */ + protected abstract void handleTestEnumParameters(ServerRequest request, ServerResponse response, + List enumHeaderStringArray, + Optional enumHeaderString, + List enumQueryStringArray, + Optional enumQueryString, + Optional enumQueryInteger, + Optional enumQueryDouble, + List enumQueryModelArray, + List enumFormStringArray, + Optional enumFormString); + + /** + * DELETE /fake : Fake endpoint to test group parameters (optional). + * + * @param request the server request + * @param response the server response + */ + protected void testGroupParameters(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: required_string_group + Integer requiredStringGroup = testGroupParametersOp.requiredStringGroup(request, validator); + + validator.require("requiredStringGroup", requiredStringGroup); + + // Parameter: required_boolean_group + Boolean requiredBooleanGroup = testGroupParametersOp.requiredBooleanGroup(request, validator); + + validator.require("requiredBooleanGroup", requiredBooleanGroup); + + // Parameter: required_int64_group + Long requiredInt64Group = testGroupParametersOp.requiredInt64Group(request, validator); + + validator.require("requiredInt64Group", requiredInt64Group); + + // Parameter: string_group + Optional stringGroup = testGroupParametersOp.stringGroup(request, validator); + + + // Parameter: boolean_group + Optional booleanGroup = testGroupParametersOp.booleanGroup(request, validator); + + + // Parameter: int64_group + Optional int64Group = testGroupParametersOp.int64Group(request, validator); + + validator.execute(); + + handleTestGroupParameters(request, response, + requiredStringGroup, + requiredBooleanGroup, + requiredInt64Group, + stringGroup, + booleanGroup, + int64Group); + } + + /** + * Handle DELETE /fake : Fake endpoint to test group parameters (optional). + * + * @param request the server request + * @param response the server response + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param stringGroup String in group parameters + * @param booleanGroup Boolean in group parameters + * @param int64Group Integer in group parameters + */ + protected abstract void handleTestGroupParameters(ServerRequest request, ServerResponse response, + Integer requiredStringGroup, + Boolean requiredBooleanGroup, + Long requiredInt64Group, + Optional stringGroup, + Optional booleanGroup, + Optional int64Group); + + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties. + * + * @param request the server request + * @param response the server response + */ + protected void testInlineAdditionalProperties(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: request_body + Map requestBody = testInlineAdditionalPropertiesOp.requestBody(request, validator); + validator.require("requestBody", requestBody); + + validator.execute(); + + handleTestInlineAdditionalProperties(request, response, + requestBody); + } + + /** + * Handle POST /fake/inline-additionalProperties : test inline additionalProperties. + * + * @param request the server request + * @param response the server response + * @param requestBody request body + */ + protected abstract void handleTestInlineAdditionalProperties(ServerRequest request, ServerResponse response, + Map requestBody); + + /** + * POST /fake/inline-freeform-additionalProperties : test inline free-form additionalProperties. + * + * @param request the server request + * @param response the server response + */ + protected void testInlineFreeformAdditionalProperties(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: TestInlineFreeformAdditionalPropertiesRequest + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = testInlineFreeformAdditionalPropertiesOp.testInlineFreeformAdditionalPropertiesRequest(request, validator); + validator.require("testInlineFreeformAdditionalPropertiesRequest", testInlineFreeformAdditionalPropertiesRequest); + + validator.execute(); + + handleTestInlineFreeformAdditionalProperties(request, response, + testInlineFreeformAdditionalPropertiesRequest); + } + + /** + * Handle POST /fake/inline-freeform-additionalProperties : test inline free-form additionalProperties. + * + * @param request the server request + * @param response the server response + * @param testInlineFreeformAdditionalPropertiesRequest request body + */ + protected abstract void handleTestInlineFreeformAdditionalProperties(ServerRequest request, ServerResponse response, + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest); + + /** + * GET /fake/jsonFormData : test json serialization of form data. + * + * @param request the server request + * @param response the server response + */ + protected void testJsonFormData(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + + Parameters formParams = request.content().as(Parameters.class); + + // Parameter: param + String param = testJsonFormDataOp.param(request, formParams, validator); + + validator.require("param", param); + + // Parameter: param2 + String param2 = testJsonFormDataOp.param2(request, formParams, validator); + + validator.require("param2", param2); + validator.execute(); + + handleTestJsonFormData(request, response, + param, + param2); + } + + /** + * Handle GET /fake/jsonFormData : test json serialization of form data. + * + * @param request the server request + * @param response the server response + * @param param field1 + * @param param2 field2 + */ + protected abstract void handleTestJsonFormData(ServerRequest request, ServerResponse response, + String param, + String param2); + + /** + * POST /fake/nullable : test nullable parent property. + * + * @param request the server request + * @param response the server response + */ + protected void testNullable(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: ChildWithNullable + ChildWithNullable childWithNullable = testNullableOp.childWithNullable(request, validator); + validator.require("childWithNullable", childWithNullable); + + validator.execute(); + + handleTestNullable(request, response, + childWithNullable); + } + + /** + * Handle POST /fake/nullable : test nullable parent property. + * + * @param request the server request + * @param response the server response + * @param childWithNullable request body + */ + protected abstract void handleTestNullable(ServerRequest request, ServerResponse response, + ChildWithNullable childWithNullable); + + /** + * PUT /fake/test-query-parameters. + * + * @param request the server request + * @param response the server response + */ + protected void testQueryParameterCollectionFormat(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: pipe + List pipe = testQueryParameterCollectionFormatOp.pipe(request, validator); + + validator.require("pipe", pipe); + + // Parameter: ioutil + List ioutil = testQueryParameterCollectionFormatOp.ioutil(request, validator); + + validator.require("ioutil", ioutil); + + // Parameter: http + List http = testQueryParameterCollectionFormatOp.http(request, validator); + + validator.require("http", http); + + // Parameter: url + List url = testQueryParameterCollectionFormatOp.url(request, validator); + + validator.require("url", url); + + // Parameter: context + List context = testQueryParameterCollectionFormatOp.context(request, validator); + + validator.require("context", context); + + // Parameter: allowEmpty + String allowEmpty = testQueryParameterCollectionFormatOp.allowEmpty(request, validator); + + validator.require("allowEmpty", allowEmpty); + + // Parameter: language + Map language = testQueryParameterCollectionFormatOp.language(request, validator); + + validator.execute(); + + handleTestQueryParameterCollectionFormat(request, response, + pipe, + ioutil, + http, + url, + context, + allowEmpty, + language); + } + + /** + * Handle PUT /fake/test-query-parameters. + * + * @param request the server request + * @param response the server response + * @param pipe pipe + * @param ioutil ioutil + * @param http http + * @param url url + * @param context context + * @param allowEmpty allowEmpty + * @param language language + */ + protected abstract void handleTestQueryParameterCollectionFormat(ServerRequest request, ServerResponse response, + List pipe, + List ioutil, + List http, + List url, + List context, + String allowEmpty, + Map language); + + /** + * POST /fake/stringMap-reference : test referenced string map. + * + * @param request the server request + * @param response the server response + */ + protected void testStringMapReference(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: request_body + Map requestBody = testStringMapReferenceOp.requestBody(request, validator); + validator.require("requestBody", requestBody); + + validator.execute(); + + handleTestStringMapReference(request, response, + requestBody); + } + + /** + * Handle POST /fake/stringMap-reference : test referenced string map. + * + * @param request the server request + * @param response the server response + * @param requestBody request body + */ + protected abstract void handleTestStringMapReference(ServerRequest request, ServerResponse response, + Map requestBody); + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeBigDecimalMap operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeBigDecimalMap + */ + protected FakeBigDecimalMapOp createFakeBigDecimalMapOp() { + return new FakeBigDecimalMapOp(); + } + + /** + * Helper elements for the {@code fakeBigDecimalMap} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeBigDecimalMapOp { + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(FakeBigDecimalMap200Response response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeBigDecimalMap operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private FakeBigDecimalMap200Response response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(FakeBigDecimalMap200Response response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeHealthGet operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeHealthGet + */ + protected FakeHealthGetOp createFakeHealthGetOp() { + return new FakeHealthGetOp(); + } + + /** + * Helper elements for the {@code fakeHealthGet} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeHealthGetOp { + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(HealthCheckResult response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeHealthGet operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private HealthCheckResult response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(HealthCheckResult response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeHttpSignatureTest operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeHttpSignatureTest + */ + protected FakeHttpSignatureTestOp createFakeHttpSignatureTestOp() { + return new FakeHttpSignatureTestOp(); + } + + /** + * Helper elements for the {@code fakeHttpSignatureTest} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeHttpSignatureTestOp { + + /** + * Prepares the pet parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return pet parameter value + */ + protected Pet pet(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Pet.class) + : null; + } + + /** + * Prepares the query1 parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return query1 parameter value + */ + protected Optional query1(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("query_1") + .asOptional(); + } + + /** + * Prepares the header1 parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return header1 parameter value + */ + protected Optional header1(ServerRequest request, ValidatorUtils.Validator validator) { + return request.headers() + .first(HeaderNames.create("header_1")); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeHttpSignatureTest operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeOuterBooleanSerialize operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeOuterBooleanSerialize + */ + protected FakeOuterBooleanSerializeOp createFakeOuterBooleanSerializeOp() { + return new FakeOuterBooleanSerializeOp(); + } + + /** + * Helper elements for the {@code fakeOuterBooleanSerialize} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeOuterBooleanSerializeOp { + + /** + * Prepares the body parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return body parameter value + */ + protected Optional body(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? Optional.of(request.content().as(Boolean.class)) + : Optional.empty(); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Boolean response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeOuterBooleanSerialize operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Boolean response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Boolean response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeOuterCompositeSerialize operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeOuterCompositeSerialize + */ + protected FakeOuterCompositeSerializeOp createFakeOuterCompositeSerializeOp() { + return new FakeOuterCompositeSerializeOp(); + } + + /** + * Helper elements for the {@code fakeOuterCompositeSerialize} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeOuterCompositeSerializeOp { + + /** + * Prepares the outerComposite parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return outerComposite parameter value + */ + protected Optional outerComposite(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? Optional.of(request.content().as(OuterComposite.class)) + : Optional.empty(); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(OuterComposite response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeOuterCompositeSerialize operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private OuterComposite response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(OuterComposite response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeOuterNumberSerialize operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeOuterNumberSerialize + */ + protected FakeOuterNumberSerializeOp createFakeOuterNumberSerializeOp() { + return new FakeOuterNumberSerializeOp(); + } + + /** + * Helper elements for the {@code fakeOuterNumberSerialize} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeOuterNumberSerializeOp { + + /** + * Prepares the body parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return body parameter value + */ + protected Optional body(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? Optional.of(request.content().as(BigDecimal.class)) + : Optional.empty(); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(BigDecimal response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeOuterNumberSerialize operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private BigDecimal response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(BigDecimal response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakeOuterStringSerialize operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakeOuterStringSerialize + */ + protected FakeOuterStringSerializeOp createFakeOuterStringSerializeOp() { + return new FakeOuterStringSerializeOp(); + } + + /** + * Helper elements for the {@code fakeOuterStringSerialize} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakeOuterStringSerializeOp { + + /** + * Prepares the body parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return body parameter value + */ + protected Optional body(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? Optional.of(request.content().as(String.class)) + : Optional.empty(); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(String response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakeOuterStringSerialize operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private String response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(String response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the fakePropertyEnumIntegerSerialize operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new FakePropertyEnumIntegerSerialize + */ + protected FakePropertyEnumIntegerSerializeOp createFakePropertyEnumIntegerSerializeOp() { + return new FakePropertyEnumIntegerSerializeOp(); + } + + /** + * Helper elements for the {@code fakePropertyEnumIntegerSerialize} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FakePropertyEnumIntegerSerializeOp { + + /** + * Prepares the outerObjectWithEnumProperty parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return outerObjectWithEnumProperty parameter value + */ + protected OuterObjectWithEnumProperty outerObjectWithEnumProperty(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(OuterObjectWithEnumProperty.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(OuterObjectWithEnumProperty response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the fakePropertyEnumIntegerSerialize operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private OuterObjectWithEnumProperty response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(OuterObjectWithEnumProperty response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testAdditionalPropertiesReference operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestAdditionalPropertiesReference + */ + protected TestAdditionalPropertiesReferenceOp createTestAdditionalPropertiesReferenceOp() { + return new TestAdditionalPropertiesReferenceOp(); + } + + /** + * Helper elements for the {@code testAdditionalPropertiesReference} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestAdditionalPropertiesReferenceOp { + + /** + * Prepares the requestBody parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requestBody parameter value + */ + protected Map requestBody(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(GenericTypes.TYPE__Map_Object) + : Map.of(); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testAdditionalPropertiesReference operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testBodyWithBinary operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestBodyWithBinary + */ + protected TestBodyWithBinaryOp createTestBodyWithBinaryOp() { + return new TestBodyWithBinaryOp(); + } + + /** + * Helper elements for the {@code testBodyWithBinary} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestBodyWithBinaryOp { + + /** + * Prepares the body parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return body parameter value + */ + protected InputStream body(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().inputStream() + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testBodyWithBinary operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testBodyWithFileSchema operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestBodyWithFileSchema + */ + protected TestBodyWithFileSchemaOp createTestBodyWithFileSchemaOp() { + return new TestBodyWithFileSchemaOp(); + } + + /** + * Helper elements for the {@code testBodyWithFileSchema} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestBodyWithFileSchemaOp { + + /** + * Prepares the fileSchemaTestClass parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return fileSchemaTestClass parameter value + */ + protected FileSchemaTestClass fileSchemaTestClass(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(FileSchemaTestClass.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testBodyWithFileSchema operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testBodyWithQueryParams operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestBodyWithQueryParams + */ + protected TestBodyWithQueryParamsOp createTestBodyWithQueryParamsOp() { + return new TestBodyWithQueryParamsOp(); + } + + /** + * Helper elements for the {@code testBodyWithQueryParams} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestBodyWithQueryParamsOp { + + /** + * Prepares the query parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return query parameter value + */ + protected String query(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("query") + .asOptional() + .orElse(null); + } + + /** + * Prepares the user parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return user parameter value + */ + protected User user(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(User.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testBodyWithQueryParams operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testClientModel operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestClientModel + */ + protected TestClientModelOp createTestClientModelOp() { + return new TestClientModelOp(); + } + + /** + * Helper elements for the {@code testClientModel} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestClientModelOp { + + /** + * Prepares the client parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return client parameter value + */ + protected Client client(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Client.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Client response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the testClientModel operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Client response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Client response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testEndpointParameters operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestEndpointParameters + */ + protected TestEndpointParametersOp createTestEndpointParametersOp() { + return new TestEndpointParametersOp(); + } + + /** + * Helper elements for the {@code testEndpointParameters} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestEndpointParametersOp { + + /** + * Prepares the number parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return number parameter value + */ + protected BigDecimal number(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("number") + .asOptional() + .map(BigDecimal::new) + .orElse(null); + } + + /** + * Prepares the _double parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return _double parameter value + */ + protected Double _double(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("double") + .asOptional() + .map(Double::valueOf) + .orElse(null); + } + + /** + * Prepares the patternWithoutDelimiter parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return patternWithoutDelimiter parameter value + */ + protected String patternWithoutDelimiter(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("pattern_without_delimiter") + .asOptional() + .orElse(null); + } + + /** + * Prepares the _byte parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return _byte parameter value + */ + protected byte[] _byte(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("byte") + .asOptional() + .map(HexFormat.of()::parseHex) + .orElse(null); + } + + /** + * Prepares the integer parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return integer parameter value + */ + protected Optional integer(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("integer") + .asOptional() + .map(Integer::valueOf); + } + + /** + * Prepares the int32 parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return int32 parameter value + */ + protected Optional int32(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("int32") + .asOptional() + .map(Integer::valueOf); + } + + /** + * Prepares the int64 parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return int64 parameter value + */ + protected Optional int64(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("int64") + .asOptional() + .map(Long::valueOf); + } + + /** + * Prepares the _float parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return _float parameter value + */ + protected Optional _float(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("float") + .asOptional() + .map(Float::valueOf); + } + + /** + * Prepares the string parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return string parameter value + */ + protected Optional string(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("string") + .asOptional(); + } + + /** + * Prepares the binary parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return binary parameter value + */ + protected Optional binary(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("binary") + .asOptional() + .map(HCollectors::decodeBinaryFormParam); + } + + /** + * Prepares the date parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return date parameter value + */ + protected Optional date(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("date") + .asOptional() + .map(LocalDate::parse); + } + + /** + * Prepares the dateTime parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return dateTime parameter value + */ + protected Optional dateTime(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("dateTime") + .asOptional() + .map(OffsetDateTime::parse); + } + + /** + * Prepares the password parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return password parameter value + */ + protected Optional password(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("password") + .asOptional(); + } + + /** + * Prepares the paramCallback parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return paramCallback parameter value + */ + protected Optional paramCallback(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("callback") + .asOptional(); + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the testEndpointParameters operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the testEndpointParameters operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testEnumParameters operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestEnumParameters + */ + protected TestEnumParametersOp createTestEnumParametersOp() { + return new TestEnumParametersOp(); + } + + /** + * Helper elements for the {@code testEnumParameters} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestEnumParametersOp { + + /** + * Prepares the enumHeaderStringArray parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumHeaderStringArray parameter value + */ + protected List enumHeaderStringArray(ServerRequest request, ValidatorUtils.Validator validator) { + return request.headers() + .values(HeaderNames.create("enum_header_string_array")) + .stream() + .map(String::valueOf) + .map(v -> validator.check("enum_header_string_array", + v, + List.of(">", + "$"))) + .collect(Collectors.toList()); + } + + /** + * Prepares the enumHeaderString parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumHeaderString parameter value + */ + protected Optional enumHeaderString(ServerRequest request, ValidatorUtils.Validator validator) { + return request.headers() + .first(HeaderNames.create("enum_header_string")) + .or(() -> Optional.of("-efg")) + .map(v -> validator.check("enum_header_string", + v, + List.of("_abc", + "-efg", + "(xyz)"))); + } + + /** + * Prepares the enumQueryStringArray parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumQueryStringArray parameter value + */ + protected List enumQueryStringArray(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("enum_query_string_array") + .stream() + .map(String::valueOf) + .map(v -> validator.check("enum_query_string_array", + v, + List.of(">", + "$"))) + .collect(Collectors.toList()); + } + + /** + * Prepares the enumQueryString parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumQueryString parameter value + */ + protected Optional enumQueryString(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("enum_query_string") + .asOptional() + .or(() -> Optional.of("-efg")) + .map(v -> validator.check("enum_query_string", + v, + List.of("_abc", + "-efg", + "(xyz)"))); + } + + /** + * Prepares the enumQueryInteger parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumQueryInteger parameter value + */ + protected Optional enumQueryInteger(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("enum_query_integer") + .asOptional() + .map(Integer::valueOf) + .map(v -> validator.check("enum_query_integer", + v, + List.of(1, + -2))); + } + + /** + * Prepares the enumQueryDouble parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumQueryDouble parameter value + */ + protected Optional enumQueryDouble(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("enum_query_double") + .asOptional() + .map(Double::valueOf) + .map(v -> validator.check("enum_query_double", + v, + List.of(1.1, + -1.2))); + } + + /** + * Prepares the enumQueryModelArray parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumQueryModelArray parameter value + */ + protected List enumQueryModelArray(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("enum_query_model_array") + .stream() + .map(EnumClass::fromValue) + .collect(Collectors.toList()); + } + + /** + * Prepares the enumFormStringArray parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumFormStringArray parameter value + */ + protected List enumFormStringArray(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .all("enum_form_string_array") + .stream() + .map(String::valueOf) + .map(v -> validator.check("enum_form_string_array", + v, + List.of(">", + "$"))) + .collect(HCollectors.toDefaultedList("$", + String::valueOf)); + } + + /** + * Prepares the enumFormString parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return enumFormString parameter value + */ + protected Optional enumFormString(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("enum_form_string") + .asOptional() + .or(() -> Optional.of("-efg")) + .map(v -> validator.check("enum_form_string", + v, + List.of("_abc", + "-efg", + "(xyz)"))); + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the testEnumParameters operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the testEnumParameters operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testGroupParameters operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestGroupParameters + */ + protected TestGroupParametersOp createTestGroupParametersOp() { + return new TestGroupParametersOp(); + } + + /** + * Helper elements for the {@code testGroupParameters} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestGroupParametersOp { + + /** + * Prepares the requiredStringGroup parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requiredStringGroup parameter value + */ + protected Integer requiredStringGroup(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("required_string_group") + .asOptional() + .map(Integer::valueOf) + .orElse(null); + } + + /** + * Prepares the requiredBooleanGroup parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requiredBooleanGroup parameter value + */ + protected Boolean requiredBooleanGroup(ServerRequest request, ValidatorUtils.Validator validator) { + return request.headers() + .first(HeaderNames.create("required_boolean_group")) + .map(Boolean::valueOf) + .orElse(null); + } + + /** + * Prepares the requiredInt64Group parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requiredInt64Group parameter value + */ + protected Long requiredInt64Group(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("required_int64_group") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Prepares the stringGroup parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return stringGroup parameter value + */ + protected Optional stringGroup(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("string_group") + .asOptional() + .map(Integer::valueOf); + } + + /** + * Prepares the booleanGroup parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return booleanGroup parameter value + */ + protected Optional booleanGroup(ServerRequest request, ValidatorUtils.Validator validator) { + return request.headers() + .first(HeaderNames.create("boolean_group")) + .map(Boolean::valueOf); + } + + /** + * Prepares the int64Group parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return int64Group parameter value + */ + protected Optional int64Group(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("int64_group") + .asOptional() + .map(Long::valueOf); + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the testGroupParameters operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testInlineAdditionalProperties operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestInlineAdditionalProperties + */ + protected TestInlineAdditionalPropertiesOp createTestInlineAdditionalPropertiesOp() { + return new TestInlineAdditionalPropertiesOp(); + } + + /** + * Helper elements for the {@code testInlineAdditionalProperties} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestInlineAdditionalPropertiesOp { + + /** + * Prepares the requestBody parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requestBody parameter value + */ + protected Map requestBody(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(GenericTypes.TYPE__Map_String) + : Map.of(); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testInlineAdditionalProperties operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testInlineFreeformAdditionalProperties operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestInlineFreeformAdditionalProperties + */ + protected TestInlineFreeformAdditionalPropertiesOp createTestInlineFreeformAdditionalPropertiesOp() { + return new TestInlineFreeformAdditionalPropertiesOp(); + } + + /** + * Helper elements for the {@code testInlineFreeformAdditionalProperties} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestInlineFreeformAdditionalPropertiesOp { + + /** + * Prepares the testInlineFreeformAdditionalPropertiesRequest parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return testInlineFreeformAdditionalPropertiesRequest parameter value + */ + protected TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(TestInlineFreeformAdditionalPropertiesRequest.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testInlineFreeformAdditionalProperties operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testJsonFormData operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestJsonFormData + */ + protected TestJsonFormDataOp createTestJsonFormDataOp() { + return new TestJsonFormDataOp(); + } + + /** + * Helper elements for the {@code testJsonFormData} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestJsonFormDataOp { + + /** + * Prepares the param parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return param parameter value + */ + protected String param(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("param") + .asOptional() + .orElse(null); + } + + /** + * Prepares the param2 parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return param2 parameter value + */ + protected String param2(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("param2") + .asOptional() + .orElse(null); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testJsonFormData operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testNullable operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestNullable + */ + protected TestNullableOp createTestNullableOp() { + return new TestNullableOp(); + } + + /** + * Helper elements for the {@code testNullable} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestNullableOp { + + /** + * Prepares the childWithNullable parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return childWithNullable parameter value + */ + protected ChildWithNullable childWithNullable(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(ChildWithNullable.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testNullable operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testQueryParameterCollectionFormat operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestQueryParameterCollectionFormat + */ + protected TestQueryParameterCollectionFormatOp createTestQueryParameterCollectionFormatOp() { + return new TestQueryParameterCollectionFormatOp(); + } + + /** + * Helper elements for the {@code testQueryParameterCollectionFormat} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestQueryParameterCollectionFormatOp { + + /** + * Prepares the pipe parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return pipe parameter value + */ + protected List pipe(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("pipe") + .stream() + .map(String::valueOf) + .collect(Collectors.toList()); + } + + /** + * Prepares the ioutil parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return ioutil parameter value + */ + protected List ioutil(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("ioutil") + .stream() + .map(String::valueOf) + .collect(Collectors.toList()); + } + + /** + * Prepares the http parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return http parameter value + */ + protected List http(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("http") + .stream() + .map(String::valueOf) + .collect(Collectors.toList()); + } + + /** + * Prepares the url parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return url parameter value + */ + protected List url(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("url") + .stream() + .map(String::valueOf) + .collect(Collectors.toList()); + } + + /** + * Prepares the context parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return context parameter value + */ + protected List context(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("context") + .stream() + .map(String::valueOf) + .collect(Collectors.toList()); + } + + /** + * Prepares the allowEmpty parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return allowEmpty parameter value + */ + protected String allowEmpty(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("allowEmpty") + .asOptional() + .orElse(null); + } + + /** + * Prepares the language parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return language parameter value + */ + protected Map language(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("language") + .stream() + .map(String::valueOf) + // TODO - Developer must override this method and provide the correct mapping. + .collect(HCollectors.noOpMap()); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testQueryParameterCollectionFormat operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the testStringMapReference operation. + *

+ * Developers can override this method if they extend the FakeService class. + *

+ * + * @return new TestStringMapReference + */ + protected TestStringMapReferenceOp createTestStringMapReferenceOp() { + return new TestStringMapReferenceOp(); + } + + /** + * Helper elements for the {@code testStringMapReference} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class TestStringMapReferenceOp { + + /** + * Prepares the requestBody parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requestBody parameter value + */ + protected Map requestBody(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(GenericTypes.TYPE__Map_String) + : Map.of(); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the testStringMapReference operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service FakeService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/FakeServiceImpl.java new file mode 100644 index 000000000000..012b7789b1b5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -0,0 +1,232 @@ +package org.openapitools.server.api; + +import java.util.ArrayList; +import java.math.BigDecimal; +import org.openapitools.server.model.ChildWithNullable; +import org.openapitools.server.model.Client; +import java.util.stream.Collectors; +import org.openapitools.server.model.EnumClass; +import org.openapitools.server.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.server.model.FileSchemaTestClass; +import java.nio.file.Files; +import org.openapitools.server.model.GenericTypes; +import java.util.HashMap; +import io.helidon.http.HeaderNames; +import io.helidon.http.Headers; +import org.openapitools.server.model.HealthCheckResult; +import java.util.HexFormat; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.time.LocalDate; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Objects; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.server.model.OuterComposite; +import org.openapitools.server.model.OuterObjectWithEnumProperty; +import io.helidon.common.parameters.Parameters; +import java.nio.file.Path; +import org.openapitools.server.model.Pet; +import io.helidon.http.media.multipart.ReadablePart; +import io.helidon.http.Status; +import org.openapitools.server.model.TestInlineFreeformAdditionalPropertiesRequest; +import java.io.UncheckedIOException; +import org.openapitools.server.model.User; +import io.helidon.common.mapper.Value; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class FakeServiceImpl extends FakeService { + + @Override + protected void handleFakeBigDecimalMap(ServerRequest request, ServerResponse response) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakeHealthGet(ServerRequest request, ServerResponse response) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakeHttpSignatureTest(ServerRequest request, ServerResponse response, + Pet pet, + Optional query1, + Optional header1) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakeOuterBooleanSerialize(ServerRequest request, ServerResponse response, + Optional body) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakeOuterCompositeSerialize(ServerRequest request, ServerResponse response, + Optional outerComposite) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakeOuterNumberSerialize(ServerRequest request, ServerResponse response, + Optional body) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakeOuterStringSerialize(ServerRequest request, ServerResponse response, + Optional body) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response, + OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestAdditionalPropertiesReference(ServerRequest request, ServerResponse response, + Map requestBody) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestBodyWithBinary(ServerRequest request, ServerResponse response, + InputStream body) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestBodyWithFileSchema(ServerRequest request, ServerResponse response, + FileSchemaTestClass fileSchemaTestClass) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestBodyWithQueryParams(ServerRequest request, ServerResponse response, + String query, + User user) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestClientModel(ServerRequest request, ServerResponse response, + Client client) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestEndpointParameters(ServerRequest request, ServerResponse response, + BigDecimal number, + Double _double, + String patternWithoutDelimiter, + byte[] _byte, + Optional integer, + Optional int32, + Optional int64, + Optional _float, + Optional string, + Optional binary, + Optional date, + Optional dateTime, + Optional password, + Optional paramCallback) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestEnumParameters(ServerRequest request, ServerResponse response, + List enumHeaderStringArray, + Optional enumHeaderString, + List enumQueryStringArray, + Optional enumQueryString, + Optional enumQueryInteger, + Optional enumQueryDouble, + List enumQueryModelArray, + List enumFormStringArray, + Optional enumFormString) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestGroupParameters(ServerRequest request, ServerResponse response, + Integer requiredStringGroup, + Boolean requiredBooleanGroup, + Long requiredInt64Group, + Optional stringGroup, + Optional booleanGroup, + Optional int64Group) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestInlineAdditionalProperties(ServerRequest request, ServerResponse response, + Map requestBody) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestInlineFreeformAdditionalProperties(ServerRequest request, ServerResponse response, + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestJsonFormData(ServerRequest request, ServerResponse response, + String param, + String param2) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestNullable(ServerRequest request, ServerResponse response, + ChildWithNullable childWithNullable) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestQueryParameterCollectionFormat(ServerRequest request, ServerResponse response, + List pipe, + List ioutil, + List http, + List url, + List context, + String allowEmpty, + Map language) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleTestStringMapReference(ServerRequest request, ServerResponse response, + Map requestBody) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/HCollectors.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/HCollectors.java new file mode 100644 index 000000000000..c95c679e1dc9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/HCollectors.java @@ -0,0 +1,217 @@ +package org.openapitools.server.api; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.BiConsumer; +import java.util.function.BinaryOperator; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collector; + +import io.helidon.common.GenericType; +import io.helidon.http.Headers; +import io.helidon.http.WritableHeaders; +import io.helidon.http.media.EntityReader; +import io.helidon.http.media.FormParamsSupport; +import io.helidon.http.media.MediaSupport; + +/** + * Collectors with particular features useful from the generated code. + */ +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "utility", + version = "stable") +public final class HCollectors { + + private static final MediaSupport FORM_PARAMS_SUPPORT = FormParamsSupport.create(); + private static final Headers EMPTY_HEADERS = WritableHeaders.create(); + + /** + * Returns a new {@link java.util.stream.Collector} that applies a default value in the absence of provided values and returns + * the resulting {@link java.util.List}. + * + * @param baseDefault default value expressed in the base type of the parameter + * @param converter transforms the default value from the base type to the result type + * @param base type + * @param result type + * @return new collector + */ + static Collector> toDefaultedList(BT baseDefault, Function converter) { + return new DefaultableListCollector<>(baseDefault, converter); + } + + static Collector> noOpMap() { + + return new NoOpMapCollector(); + } + + /** + * Decodes URL encoded string as binary data. + *

+ * Inspired hugely by java.net.URLDecoder. + *

+ * + * @param s URL encoded string + * @return binary data encoded by the string + */ + static byte[] decodeBinaryFormParam(String s) { + boolean needToChange = false; + int numChars = s.length(); + int i = 0; + + char c; + ByteArrayOutputStream output = new ByteArrayOutputStream(); + byte[] bytes = null; + while (i < numChars) { + c = s.charAt(i); + switch (c) { + case '+': + output.write(' '); + i++; + needToChange = true; + break; + case '%': + /* + * Starting with this instance of %, process all + * consecutive substrings of the form %xy. Each + * substring %xy will yield a byte. Convert all + * consecutive bytes obtained this way to whatever + * character(s) they represent in the provided + * encoding. + */ + + try { + + // (numChars-i)/3 is an upper bound for the number + // of remaining bytes + if (bytes == null) + bytes = new byte[(numChars-i)/3]; + int pos = 0; + + while ( ((i+2) < numChars) && + (c=='%')) { + int v = Integer.parseInt(s, i + 1, i + 3, 16); + if (v < 0) + throw new IllegalArgumentException( + "URLDecoder: Illegal hex characters in escape " + + "(%) pattern - negative value"); + bytes[pos++] = (byte) v; + i+= 3; + if (i < numChars) + c = s.charAt(i); + } + + // A trailing, incomplete byte encoding such as + // "%x" will cause an exception to be thrown + + if ((i < numChars) && (c=='%')) + throw new IllegalArgumentException( + "URLDecoder: Incomplete trailing escape (%) pattern"); + + output.write(bytes, 0, pos); + } catch (NumberFormatException e) { + throw new IllegalArgumentException( + "URLDecoder: Illegal hex characters in escape (%) pattern - " + + e.getMessage()); + } + needToChange = true; + break; + default: + output.write(c); + i++; + break; + } + } + + return output.toByteArray(); + } + + private static class NoOpMapCollector implements Collector, Map> { + + @Override + public Supplier> supplier() { + return LinkedHashMap::new; + } + + @Override + public BiConsumer, String> accumulator() { + return (map, expr) -> {}; + } + + @Override + public BinaryOperator> combiner() { + return (a, b) -> a; + } + + @Override + public Function, Map> finisher() { + return Function.identity(); + } + + @Override + public Set characteristics() { + return Set.of(); + } + } + + private abstract static class AbstractListCollector implements Collector, List> { + + @Override + public Supplier> supplier() { + return ArrayList::new; + } + + @Override + public BiConsumer, T> accumulator() { + return List::add; + } + + @Override + public BinaryOperator> combiner() { + return (l1, l2) -> { + l2.addAll(l1); + return l2; + }; + } + + @Override + public Set characteristics() { + return Set.of(); + } + } + + /** + * {@link java.util.stream.Collector} for streams of the base type (values from the request, often strings} + * applying a converter to the desired result type and supplying a default value if there are no base values. + * + * @param base type (often string) + * @param result type + */ + private static class DefaultableListCollector extends AbstractListCollector { + + private final BT baseDefault; + private final Function converter; + + DefaultableListCollector(BT baseDefault, Function converter) { + this.baseDefault = baseDefault; + this.converter = converter; + } + + @Override + public Function, List> finisher() { + return l -> { + if (l.isEmpty()) { + l.add(converter.apply(baseDefault)); + } + return l; + }; + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/JsonProvider.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/JsonProvider.java new file mode 100644 index 000000000000..41f01e882ab0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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/v4/se-uac/src/main/java/org/openapitools/server/api/PartsUtils.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/PartsUtils.java new file mode 100644 index 000000000000..a16d88336815 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/PartsUtils.java @@ -0,0 +1,89 @@ +package org.openapitools.server.api; + +import java.io.IOException; +import java.io.File; +import java.io.InputStream; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Optional; + +import io.helidon.common.GenericType; +import io.helidon.http.media.multipart.MultiPart; +import io.helidon.http.media.multipart.ReadablePart; +import io.helidon.webserver.http.ServerRequest; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "utility", + version = "stable") +class PartsUtils { + + private final Map parts = new LinkedHashMap<>(); + + static Map partsMap(ServerRequest request) { + Map parts = new LinkedHashMap<>(); + request.content().as(MultiPart.class).forEachRemaining(part -> parts.put(part.name(), part)); + return parts; + } + + static PartsUtils create(ServerRequest request) { + return new PartsUtils(request); + } + + private PartsUtils(ServerRequest request) { + request.content().as(MultiPart.class).forEachRemaining(part -> parts.put(part.name(), part)); + } + + T part(String partName, Class type, T defaultValue) { + ReadablePart part = parts.get(partName); + if (part == null) { + return defaultValue; + } + return part.as(type); + } + + Optional partOpt(String partName, Class type, T defaultValue) { + return Optional.ofNullable(part(partName, type, defaultValue)); + } + + T part(String partName, GenericType type, T defaultValue) { + ReadablePart part = parts.get(partName); + if (part == null) { + return defaultValue; + } + return part.as(type); + } + + Optional partOpt(String partName, GenericType type, T defaultValue) { + return Optional.ofNullable(part(partName, type, defaultValue)); + } + + InputStream inputStreamPart(String partName) { + ReadablePart part = parts.get(partName); + if (part == null) { + return null; + } + return part.inputStream(); + } + + Optional inputStreamPartOpt(String partName) { + return Optional.ofNullable(inputStreamPart(partName)); + } + + File filePart(String partName, Path directory) { + ReadablePart part = parts.get(partName); + if (part == null) { + return null; + } + try (InputStream inputStream = part.inputStream()) { + Path path = directory.resolve(part.fileName().orElse(partName)); + inputStream.transferTo(Files.newOutputStream(path, StandardOpenOption.CREATE_NEW)); + return path.toFile(); + } catch (IOException ex) { + throw new UncheckedIOException(ex); + } + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/PetService.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/PetService.java new file mode 100644 index 000000000000..a2f02a0657b8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/PetService.java @@ -0,0 +1,1986 @@ +package org.openapitools.server.api; + +import java.util.ArrayList; +import java.util.stream.Collectors; +import java.io.File; +import java.util.HashMap; +import io.helidon.http.HeaderNames; +import io.helidon.http.Headers; +import java.util.HexFormat; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.Map; +import org.openapitools.server.model.ModelApiResponse; +import io.helidon.http.media.multipart.MultiPart; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Optional; +import io.helidon.common.parameters.Parameters; +import org.openapitools.server.model.Pet; +import io.helidon.http.media.multipart.ReadablePart; +import java.util.Set; +import io.helidon.http.Status; +import java.io.UncheckedIOException; +import io.helidon.common.mapper.Value; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'Pet'", + version = "stable") +public abstract class PetService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected AddPetOp addPetOp = createAddPetOp(); + protected DeletePetOp deletePetOp = createDeletePetOp(); + protected FindPetsByStatusOp findPetsByStatusOp = createFindPetsByStatusOp(); + protected FindPetsByTagsOp findPetsByTagsOp = createFindPetsByTagsOp(); + protected GetPetByIdOp getPetByIdOp = createGetPetByIdOp(); + protected UpdatePetOp updatePetOp = createUpdatePetOp(); + protected UpdatePetWithFormOp updatePetWithFormOp = createUpdatePetWithFormOp(); + protected UploadFileOp uploadFileOp = createUploadFileOp(); + protected UploadFileWithRequiredFileOp uploadFileWithRequiredFileOp = createUploadFileWithRequiredFileOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.post("/pet", 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", 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 + */ + protected void addPet(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Pet + Pet pet = addPetOp.pet(request, validator); + validator.require("pet", pet); + + validator.execute(); + + handleAddPet(request, response, + pet); + } + + /** + * Handle 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 + */ + protected abstract void handleAddPet(ServerRequest request, ServerResponse response, + Pet pet); + + /** + * DELETE /pet/{petId} : Deletes a pet. + * + * @param request the server request + * @param response the server response + */ + protected void deletePet(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: petId + Long petId = deletePetOp.petId(request, validator); + + validator.require("petId", petId); + + // Parameter: api_key + Optional apiKey = deletePetOp.apiKey(request, validator); + + validator.execute(); + + handleDeletePet(request, response, + petId, + apiKey); + } + + /** + * Handle DELETE /pet/{petId} : Deletes a pet. + * + * @param request the server request + * @param response the server response + * @param petId Pet id to delete + * @param apiKey apiKey + */ + protected abstract void handleDeletePet(ServerRequest request, ServerResponse response, + Long petId, + Optional apiKey); + + /** + * GET /pet/findByStatus : Finds Pets by status. + * + * @param request the server request + * @param response the server response + */ + protected void findPetsByStatus(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: status + List status = findPetsByStatusOp.status(request, validator); + + validator.require("status", status); + validator.execute(); + + handleFindPetsByStatus(request, response, + status); + } + + /** + * Handle GET /pet/findByStatus : Finds Pets by status. + * + * @param request the server request + * @param response the server response + * @param status Status values that need to be considered for filter + */ + protected abstract void handleFindPetsByStatus(ServerRequest request, ServerResponse response, + List status); + + /** + * GET /pet/findByTags : Finds Pets by tags. + * + * @param request the server request + * @param response the server response + */ + protected void findPetsByTags(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: tags + Set tags = findPetsByTagsOp.tags(request, validator); + + validator.require("tags", tags); + validator.execute(); + + handleFindPetsByTags(request, response, + tags); + } + + /** + * Handle GET /pet/findByTags : Finds Pets by tags. + * + * @param request the server request + * @param response the server response + * @param tags Tags to filter by + */ + protected abstract void handleFindPetsByTags(ServerRequest request, ServerResponse response, + Set tags); + + /** + * GET /pet/{petId} : Find pet by ID. + * + * @param request the server request + * @param response the server response + */ + protected void getPetById(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: petId + Long petId = getPetByIdOp.petId(request, validator); + + validator.require("petId", petId); + validator.execute(); + + handleGetPetById(request, response, + petId); + } + + /** + * Handle GET /pet/{petId} : Find pet by ID. + * + * @param request the server request + * @param response the server response + * @param petId ID of pet to return + */ + protected abstract void handleGetPetById(ServerRequest request, ServerResponse response, + Long petId); + + /** + * PUT /pet : Update an existing pet. + * + * @param request the server request + * @param response the server response + */ + protected void updatePet(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Pet + Pet pet = updatePetOp.pet(request, validator); + validator.require("pet", pet); + + validator.execute(); + + handleUpdatePet(request, response, + pet); + } + + /** + * Handle 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 + */ + protected abstract void handleUpdatePet(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 + */ + protected void updatePetWithForm(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + + Parameters formParams = request.content().as(Parameters.class); + + // Parameter: petId + Long petId = updatePetWithFormOp.petId(request, validator); + + validator.require("petId", petId); + + // Parameter: name + Optional name = updatePetWithFormOp.name(request, formParams, validator); + + + // Parameter: status + Optional status = updatePetWithFormOp.status(request, formParams, validator); + + validator.execute(); + + handleUpdatePetWithForm(request, response, + petId, + name, + status); + } + + /** + * Handle POST /pet/{petId} : Updates a pet in the store with form data. + * + * @param request the server request + * @param response the server response + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + */ + protected abstract void handleUpdatePetWithForm(ServerRequest request, ServerResponse response, + Long petId, + Optional name, + Optional status); + + /** + * POST /pet/{petId}/uploadImage : uploads an image. + * + * @param request the server request + * @param response the server response + */ + protected void uploadFile(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + + Map parts = PartsUtils.partsMap(request); + + // Parameter: petId + Long petId = uploadFileOp.petId(request, validator); + + validator.require("petId", petId); + + // Parameter: additionalMetadata + Optional additionalMetadata = uploadFileOp.additionalMetadata(request, parts, validator); + + + // Parameter: file + Optional _file = uploadFileOp._file(request, parts, validator); + + validator.execute(); + + handleUploadFile(request, response, + petId, + additionalMetadata, + _file); + } + + /** + * Handle POST /pet/{petId}/uploadImage : uploads an image. + * + * @param request the server request + * @param response the server response + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param _file file to upload + */ + protected abstract void handleUploadFile(ServerRequest request, ServerResponse response, + Long petId, + Optional additionalMetadata, + Optional _file); + + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required). + * + * @param request the server request + * @param response the server response + */ + protected void uploadFileWithRequiredFile(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + + Map parts = PartsUtils.partsMap(request); + + // Parameter: petId + Long petId = uploadFileWithRequiredFileOp.petId(request, validator); + + validator.require("petId", petId); + + // Parameter: requiredFile + ReadablePart requiredFile = uploadFileWithRequiredFileOp.requiredFile(request, parts, validator); + + validator.require("requiredFile", requiredFile); + + // Parameter: additionalMetadata + Optional additionalMetadata = uploadFileWithRequiredFileOp.additionalMetadata(request, parts, validator); + + validator.execute(); + + handleUploadFileWithRequiredFile(request, response, + petId, + requiredFile, + additionalMetadata); + } + + /** + * Handle POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required). + * + * @param request the server request + * @param response the server response + * @param petId ID of pet to update + * @param requiredFile file to upload + * @param additionalMetadata Additional data to pass to server + */ + protected abstract void handleUploadFileWithRequiredFile(ServerRequest request, ServerResponse response, + Long petId, + ReadablePart requiredFile, + Optional additionalMetadata); + + /** + * Returns a new instance of the class which handles parameters to and responses from the addPet operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new AddPet + */ + protected AddPetOp createAddPetOp() { + return new AddPetOp(); + } + + /** + * Helper elements for the {@code addPet} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class AddPetOp { + + /** + * Prepares the pet parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return pet parameter value + */ + protected Pet pet(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Pet.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the addPet operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 405}. + */ + record Response405() { + + /** + * Creates a response builder for the status {@code 405} response + * for the addPet operation; there are no required result values for this response. + * + * @return new builder for status 405 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response405 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response405 build() { + return new Response405(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.METHOD_NOT_ALLOWED_405); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the deletePet operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new DeletePet + */ + protected DeletePetOp createDeletePetOp() { + return new DeletePetOp(); + } + + /** + * Helper elements for the {@code deletePet} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class DeletePetOp { + + /** + * Prepares the petId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return petId parameter value + */ + protected Long petId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("petId") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Prepares the apiKey parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return apiKey parameter value + */ + protected Optional apiKey(ServerRequest request, ValidatorUtils.Validator validator) { + return request.headers() + .first(HeaderNames.create("api_key")); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the deletePet operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the deletePet operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the findPetsByStatus operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new FindPetsByStatus + */ + protected FindPetsByStatusOp createFindPetsByStatusOp() { + return new FindPetsByStatusOp(); + } + + /** + * Helper elements for the {@code findPetsByStatus} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FindPetsByStatusOp { + + /** + * Prepares the status parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return status parameter value + */ + protected List status(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("status") + .stream() + .map(String::valueOf) + .map(v -> validator.check("status", + v, + List.of("available", + "pending", + "sold"))) + .collect(Collectors.toList()); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(List response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the findPetsByStatus operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private List response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(List response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the findPetsByStatus operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the findPetsByTags operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new FindPetsByTags + */ + protected FindPetsByTagsOp createFindPetsByTagsOp() { + return new FindPetsByTagsOp(); + } + + /** + * Helper elements for the {@code findPetsByTags} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class FindPetsByTagsOp { + + /** + * Prepares the tags parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return tags parameter value + */ + protected Set tags(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .all("tags") + .stream() + .map(String::valueOf) + .collect(Collectors.toSet()); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Set response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the findPetsByTags operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Set response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Set response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the findPetsByTags operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the getPetById operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new GetPetById + */ + protected GetPetByIdOp createGetPetByIdOp() { + return new GetPetByIdOp(); + } + + /** + * Helper elements for the {@code getPetById} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class GetPetByIdOp { + + /** + * Prepares the petId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return petId parameter value + */ + protected Long petId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("petId") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Pet response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the getPetById operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Pet response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Pet response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the getPetById operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the getPetById operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the updatePet operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new UpdatePet + */ + protected UpdatePetOp createUpdatePetOp() { + return new UpdatePetOp(); + } + + /** + * Helper elements for the {@code updatePet} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class UpdatePetOp { + + /** + * Prepares the pet parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return pet parameter value + */ + protected Pet pet(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Pet.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the updatePet operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the updatePet operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the updatePet operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 405}. + */ + record Response405() { + + /** + * Creates a response builder for the status {@code 405} response + * for the updatePet operation; there are no required result values for this response. + * + * @return new builder for status 405 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response405 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response405 build() { + return new Response405(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.METHOD_NOT_ALLOWED_405); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the updatePetWithForm operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new UpdatePetWithForm + */ + protected UpdatePetWithFormOp createUpdatePetWithFormOp() { + return new UpdatePetWithFormOp(); + } + + /** + * Helper elements for the {@code updatePetWithForm} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class UpdatePetWithFormOp { + + /** + * Prepares the petId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return petId parameter value + */ + protected Long petId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("petId") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Prepares the name parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return name parameter value + */ + protected Optional name(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("name") + .asOptional(); + } + + /** + * Prepares the status parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return status parameter value + */ + protected Optional status(ServerRequest request, Parameters formParams, ValidatorUtils.Validator validator) { + return formParams + .first("status") + .asOptional(); + } + + /** + * Response for HTTP status code {@code 200}. + */ + record Response200() { + + /** + * Creates a response builder for the status {@code 200} response + * for the updatePetWithForm operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response200 build() { + return new Response200(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 405}. + */ + record Response405() { + + /** + * Creates a response builder for the status {@code 405} response + * for the updatePetWithForm operation; there are no required result values for this response. + * + * @return new builder for status 405 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response405 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response405 build() { + return new Response405(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.METHOD_NOT_ALLOWED_405); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the uploadFile operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new UploadFile + */ + protected UploadFileOp createUploadFileOp() { + return new UploadFileOp(); + } + + /** + * Helper elements for the {@code uploadFile} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class UploadFileOp { + + /** + * Prepares the petId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return petId parameter value + */ + protected Long petId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("petId") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Prepares the additionalMetadata parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param parts {@code Map} of part names to {@link io.helidon.http.media.multipart.ReadablePart} for each part + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return additionalMetadata parameter value + */ + protected Optional additionalMetadata(ServerRequest request, Map parts, ValidatorUtils.Validator validator) { + return Optional.ofNullable(parts.get("additionalMetadata")); + } + + /** + * Prepares the _file parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param parts {@code Map} of part names to {@link io.helidon.http.media.multipart.ReadablePart} for each part + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return _file parameter value + */ + protected Optional _file(ServerRequest request, Map parts, ValidatorUtils.Validator validator) { + return Optional.ofNullable(parts.get("file")); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(ModelApiResponse response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the uploadFile operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private ModelApiResponse response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(ModelApiResponse response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the uploadFileWithRequiredFile operation. + *

+ * Developers can override this method if they extend the PetService class. + *

+ * + * @return new UploadFileWithRequiredFile + */ + protected UploadFileWithRequiredFileOp createUploadFileWithRequiredFileOp() { + return new UploadFileWithRequiredFileOp(); + } + + /** + * Helper elements for the {@code uploadFileWithRequiredFile} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class UploadFileWithRequiredFileOp { + + /** + * Prepares the petId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return petId parameter value + */ + protected Long petId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("petId") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Prepares the requiredFile parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param parts {@code Map} of part names to {@link io.helidon.http.media.multipart.ReadablePart} for each part + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return requiredFile parameter value + */ + protected ReadablePart requiredFile(ServerRequest request, Map parts, ValidatorUtils.Validator validator) { + return parts.get("requiredFile"); + } + + /** + * Prepares the additionalMetadata parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param parts {@code Map} of part names to {@link io.helidon.http.media.multipart.ReadablePart} for each part + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return additionalMetadata parameter value + */ + protected Optional additionalMetadata(ServerRequest request, Map parts, ValidatorUtils.Validator validator) { + return Optional.ofNullable(parts.get("additionalMetadata")); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(ModelApiResponse response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the uploadFileWithRequiredFile operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private ModelApiResponse response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(ModelApiResponse response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service PetService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/PetServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/PetServiceImpl.java new file mode 100644 index 000000000000..ba312ca6ef1a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/PetServiceImpl.java @@ -0,0 +1,100 @@ +package org.openapitools.server.api; + +import java.util.ArrayList; +import java.util.stream.Collectors; +import java.io.File; +import java.util.HashMap; +import io.helidon.http.HeaderNames; +import io.helidon.http.Headers; +import java.util.HexFormat; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.Map; +import org.openapitools.server.model.ModelApiResponse; +import io.helidon.http.media.multipart.MultiPart; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Optional; +import io.helidon.common.parameters.Parameters; +import org.openapitools.server.model.Pet; +import io.helidon.http.media.multipart.ReadablePart; +import java.util.Set; +import io.helidon.http.Status; +import java.io.UncheckedIOException; +import io.helidon.common.mapper.Value; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class PetServiceImpl extends PetService { + + @Override + protected void handleAddPet(ServerRequest request, ServerResponse response, + Pet pet) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleDeletePet(ServerRequest request, ServerResponse response, + Long petId, + Optional apiKey) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFindPetsByStatus(ServerRequest request, ServerResponse response, + List status) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleFindPetsByTags(ServerRequest request, ServerResponse response, + Set tags) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleGetPetById(ServerRequest request, ServerResponse response, + Long petId) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleUpdatePet(ServerRequest request, ServerResponse response, + Pet pet) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleUpdatePetWithForm(ServerRequest request, ServerResponse response, + Long petId, + Optional name, + Optional status) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleUploadFile(ServerRequest request, ServerResponse response, + Long petId, + Optional additionalMetadata, + Optional _file) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleUploadFileWithRequiredFile(ServerRequest request, ServerResponse response, + Long petId, + ReadablePart requiredFile, + Optional additionalMetadata) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/StoreService.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/StoreService.java new file mode 100644 index 000000000000..d94a9c0839ef --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/StoreService.java @@ -0,0 +1,796 @@ +package org.openapitools.server.api; + +import java.util.HexFormat; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.server.model.Order; +import io.helidon.http.Status; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'Store'", + version = "stable") +public abstract class StoreService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected DeleteOrderOp deleteOrderOp = createDeleteOrderOp(); + protected GetInventoryOp getInventoryOp = createGetInventoryOp(); + protected GetOrderByIdOp getOrderByIdOp = createGetOrderByIdOp(); + protected PlaceOrderOp placeOrderOp = createPlaceOrderOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.delete("/order/{order_id}", this::deleteOrder); + rules.get("/inventory", this::getInventory); + rules.get("/order/{order_id}", this::getOrderById); + rules.post("/order", this::placeOrder); + } + + + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID. + * + * @param request the server request + * @param response the server response + */ + protected void deleteOrder(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: order_id + String orderId = deleteOrderOp.orderId(request, validator); + + validator.require("orderId", orderId); + validator.execute(); + + handleDeleteOrder(request, response, + orderId); + } + + /** + * Handle DELETE /store/order/{order_id} : Delete purchase order by ID. + * + * @param request the server request + * @param response the server response + * @param orderId ID of the order that needs to be deleted + */ + protected abstract void handleDeleteOrder(ServerRequest request, ServerResponse response, + String orderId); + + /** + * GET /store/inventory : Returns pet inventories by status. + * + * @param request the server request + * @param response the server response + */ + protected void getInventory(ServerRequest request, ServerResponse response) { + + handleGetInventory(request, response); + } + + /** + * Handle GET /store/inventory : Returns pet inventories by status. + * + * @param request the server request + * @param response the server response + */ + protected abstract void handleGetInventory(ServerRequest request, ServerResponse response); + + /** + * GET /store/order/{order_id} : Find purchase order by ID. + * + * @param request the server request + * @param response the server response + */ + protected void getOrderById(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: order_id + Long orderId = getOrderByIdOp.orderId(request, validator); + + validator.require("orderId", orderId); + validator.validateMin("orderId", orderId.intValue(), 1, true); + validator.validateMax("orderId", orderId.intValue(), 5, true); + validator.execute(); + + handleGetOrderById(request, response, + orderId); + } + + /** + * Handle GET /store/order/{order_id} : Find purchase order by ID. + * + * @param request the server request + * @param response the server response + * @param orderId ID of pet that needs to be fetched + */ + protected abstract void handleGetOrderById(ServerRequest request, ServerResponse response, + Long orderId); + + /** + * POST /store/order : Place an order for a pet. + * + * @param request the server request + * @param response the server response + */ + protected void placeOrder(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: Order + Order order = placeOrderOp.order(request, validator); + validator.require("order", order); + + validator.execute(); + + handlePlaceOrder(request, response, + order); + } + + /** + * Handle 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 + */ + protected abstract void handlePlaceOrder(ServerRequest request, ServerResponse response, + Order order); + + /** + * Returns a new instance of the class which handles parameters to and responses from the deleteOrder operation. + *

+ * Developers can override this method if they extend the StoreService class. + *

+ * + * @return new DeleteOrder + */ + protected DeleteOrderOp createDeleteOrderOp() { + return new DeleteOrderOp(); + } + + /** + * Helper elements for the {@code deleteOrder} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class DeleteOrderOp { + + /** + * Prepares the orderId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return orderId parameter value + */ + protected String orderId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("order_id") + .asOptional() + .orElse(null); + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the deleteOrder operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the deleteOrder operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the getInventory operation. + *

+ * Developers can override this method if they extend the StoreService class. + *

+ * + * @return new GetInventory + */ + protected GetInventoryOp createGetInventoryOp() { + return new GetInventoryOp(); + } + + /** + * Helper elements for the {@code getInventory} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class GetInventoryOp { + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Map response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the getInventory operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Map response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Map response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the getOrderById operation. + *

+ * Developers can override this method if they extend the StoreService class. + *

+ * + * @return new GetOrderById + */ + protected GetOrderByIdOp createGetOrderByIdOp() { + return new GetOrderByIdOp(); + } + + /** + * Helper elements for the {@code getOrderById} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class GetOrderByIdOp { + + /** + * Prepares the orderId parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return orderId parameter value + */ + protected Long orderId(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("order_id") + .asOptional() + .map(Long::valueOf) + .orElse(null); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Order response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the getOrderById operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Order response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Order response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the getOrderById operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the getOrderById operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the placeOrder operation. + *

+ * Developers can override this method if they extend the StoreService class. + *

+ * + * @return new PlaceOrder + */ + protected PlaceOrderOp createPlaceOrderOp() { + return new PlaceOrderOp(); + } + + /** + * Helper elements for the {@code placeOrder} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class PlaceOrderOp { + + /** + * Prepares the order parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return order parameter value + */ + protected Order order(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(Order.class) + : null; + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(Order response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the placeOrder operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Order response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(Order response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the placeOrder operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service StoreService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/StoreServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/StoreServiceImpl.java new file mode 100644 index 000000000000..5b6e23452ba2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/StoreServiceImpl.java @@ -0,0 +1,40 @@ +package org.openapitools.server.api; + +import java.util.HexFormat; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.server.model.Order; +import io.helidon.http.Status; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class StoreServiceImpl extends StoreService { + + @Override + protected void handleDeleteOrder(ServerRequest request, ServerResponse response, + String orderId) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleGetInventory(ServerRequest request, ServerResponse response) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleGetOrderById(ServerRequest request, ServerResponse response, + Long orderId) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handlePlaceOrder(ServerRequest request, ServerResponse response, + Order order) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/UserService.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/UserService.java new file mode 100644 index 000000000000..6019f05ab7ab --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/UserService.java @@ -0,0 +1,1494 @@ +package org.openapitools.server.api; + +import java.util.stream.Collectors; +import org.openapitools.server.model.GenericTypes; +import java.util.HexFormat; +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.OffsetDateTime; +import java.util.Optional; +import io.helidon.http.Status; +import org.openapitools.server.model.User; +import jakarta.validation.Valid; + +import java.util.Optional; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'User'", + version = "stable") +public abstract class UserService implements HttpService { + + + protected static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + protected CreateUserOp createUserOp = createCreateUserOp(); + protected CreateUsersWithArrayInputOp createUsersWithArrayInputOp = createCreateUsersWithArrayInputOp(); + protected CreateUsersWithListInputOp createUsersWithListInputOp = createCreateUsersWithListInputOp(); + protected DeleteUserOp deleteUserOp = createDeleteUserOp(); + protected GetUserByNameOp getUserByNameOp = createGetUserByNameOp(); + protected LoginUserOp loginUserOp = createLoginUserOp(); + protected LogoutUserOp logoutUserOp = createLogoutUserOp(); + protected UpdateUserOp updateUserOp = createUpdateUserOp(); + + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + public void routing(HttpRules rules) { + rules.post("/", this::createUser); + rules.post("/createWithArray", this::createUsersWithArrayInput); + rules.post("/createWithList", this::createUsersWithListInput); + rules.delete("/{username}", this::deleteUser); + rules.get("/{username}", this::getUserByName); + rules.get("/login", this::loginUser); + rules.get("/logout", this::logoutUser); + rules.put("/{username}", this::updateUser); + } + + + /** + * POST /user : Create user. + * + * @param request the server request + * @param response the server response + */ + protected void createUser(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: User + User user = createUserOp.user(request, validator); + validator.require("user", user); + + validator.execute(); + + handleCreateUser(request, response, + user); + } + + /** + * Handle POST /user : Create user. + * + * @param request the server request + * @param response the server response + * @param user Created user object + */ + protected abstract void handleCreateUser(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 + */ + protected void createUsersWithArrayInput(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: User + List<@Valid User> user = createUsersWithArrayInputOp.user(request, validator); + validator.require("user", user); + + validator.execute(); + + handleCreateUsersWithArrayInput(request, response, + user); + } + + /** + * Handle POST /user/createWithArray : Creates list of users with given input array. + * + * @param request the server request + * @param response the server response + * @param user List of user object + */ + protected abstract void handleCreateUsersWithArrayInput(ServerRequest request, ServerResponse response, + List<@Valid User> user); + + /** + * POST /user/createWithList : Creates list of users with given input array. + * + * @param request the server request + * @param response the server response + */ + protected void createUsersWithListInput(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: User + List<@Valid User> user = createUsersWithListInputOp.user(request, validator); + validator.require("user", user); + + validator.execute(); + + handleCreateUsersWithListInput(request, response, + user); + } + + /** + * Handle POST /user/createWithList : Creates list of users with given input array. + * + * @param request the server request + * @param response the server response + * @param user List of user object + */ + protected abstract void handleCreateUsersWithListInput(ServerRequest request, ServerResponse response, + List<@Valid User> user); + + /** + * DELETE /user/{username} : Delete user. + * + * @param request the server request + * @param response the server response + */ + protected void deleteUser(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: username + String username = deleteUserOp.username(request, validator); + + validator.require("username", username); + validator.execute(); + + handleDeleteUser(request, response, + username); + } + + /** + * Handle DELETE /user/{username} : Delete user. + * + * @param request the server request + * @param response the server response + * @param username The name that needs to be deleted + */ + protected abstract void handleDeleteUser(ServerRequest request, ServerResponse response, + String username); + + /** + * GET /user/{username} : Get user by user name. + * + * @param request the server request + * @param response the server response + */ + protected void getUserByName(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: username + String username = getUserByNameOp.username(request, validator); + + validator.require("username", username); + validator.execute(); + + handleGetUserByName(request, response, + username); + } + + /** + * Handle GET /user/{username} : Get user by user name. + * + * @param request the server request + * @param response the server response + * @param username The name that needs to be fetched. Use user1 for testing. + */ + protected abstract void handleGetUserByName(ServerRequest request, ServerResponse response, + String username); + + /** + * GET /user/login : Logs user into the system. + * + * @param request the server request + * @param response the server response + */ + protected void loginUser(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: username + String username = loginUserOp.username(request, validator); + + validator.require("username", username); + + // Parameter: password + String password = loginUserOp.password(request, validator); + + validator.require("password", password); + validator.execute(); + + handleLoginUser(request, response, + username, + password); + } + + /** + * Handle GET /user/login : Logs user into the system. + * + * @param request the server request + * @param response the server response + * @param username The user name for login + * @param password The password for login in clear text + */ + protected abstract void handleLoginUser(ServerRequest request, ServerResponse response, + String username, + String password); + + /** + * GET /user/logout : Logs out current logged in user session. + * + * @param request the server request + * @param response the server response + */ + protected void logoutUser(ServerRequest request, ServerResponse response) { + + handleLogoutUser(request, response); + } + + /** + * Handle GET /user/logout : Logs out current logged in user session. + * + * @param request the server request + * @param response the server response + */ + protected abstract void handleLogoutUser(ServerRequest request, ServerResponse response); + + /** + * PUT /user/{username} : Updated user. + * + * @param request the server request + * @param response the server response + */ + protected void updateUser(ServerRequest request, ServerResponse response) { + + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + // Parameter: username + String username = updateUserOp.username(request, validator); + + validator.require("username", username); + + // Parameter: User + User user = updateUserOp.user(request, validator); + validator.require("user", user); + + validator.execute(); + + handleUpdateUser(request, response, + username, + user); + } + + /** + * Handle PUT /user/{username} : Updated user. + * + * @param request the server request + * @param response the server response + * @param username name that need to be deleted + * @param user Updated user object + */ + protected abstract void handleUpdateUser(ServerRequest request, ServerResponse response, + String username, + User user); + + /** + * Returns a new instance of the class which handles parameters to and responses from the createUser operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new CreateUser + */ + protected CreateUserOp createCreateUserOp() { + return new CreateUserOp(); + } + + /** + * Helper elements for the {@code createUser} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class CreateUserOp { + + /** + * Prepares the user parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return user parameter value + */ + protected User user(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(User.class) + : null; + } + + /** + * Default result. + * + * @param status (required) Status value to be sent with this default result + */ + record Default(Status status) { + + /** + * Creates a response builder for the default response + * for the createUser operation; there are no required result values for this response. + * + * @return new builder for status 0 + */ + static Builder builder(Status status) { + return new Builder(status); + } + + /** + * Builder for the Default result. + */ + static class Builder implements io.helidon.common.Builder { + + private final Status status; + Builder(Status status) { + this.status = status; + + } + @Override + public Default build() { + return new Default(status); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Constructor for a result for the default result + * for the createUser operation, verifying non-null values for required return data. + * + */ + public Default(Status status) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + validator.require("status for default response", status); + validator.execute(); + this.status = status; + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(status); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the createUsersWithArrayInput operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new CreateUsersWithArrayInput + */ + protected CreateUsersWithArrayInputOp createCreateUsersWithArrayInputOp() { + return new CreateUsersWithArrayInputOp(); + } + + /** + * Helper elements for the {@code createUsersWithArrayInput} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class CreateUsersWithArrayInputOp { + + /** + * Prepares the user parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return user parameter value + */ + protected List<@Valid User> user(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(GenericTypes.TYPE__List_User) + : List.of(); + } + + /** + * Default result. + * + * @param status (required) Status value to be sent with this default result + */ + record Default(Status status) { + + /** + * Creates a response builder for the default response + * for the createUsersWithArrayInput operation; there are no required result values for this response. + * + * @return new builder for status 0 + */ + static Builder builder(Status status) { + return new Builder(status); + } + + /** + * Builder for the Default result. + */ + static class Builder implements io.helidon.common.Builder { + + private final Status status; + Builder(Status status) { + this.status = status; + + } + @Override + public Default build() { + return new Default(status); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Constructor for a result for the default result + * for the createUsersWithArrayInput operation, verifying non-null values for required return data. + * + */ + public Default(Status status) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + validator.require("status for default response", status); + validator.execute(); + this.status = status; + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(status); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the createUsersWithListInput operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new CreateUsersWithListInput + */ + protected CreateUsersWithListInputOp createCreateUsersWithListInputOp() { + return new CreateUsersWithListInputOp(); + } + + /** + * Helper elements for the {@code createUsersWithListInput} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class CreateUsersWithListInputOp { + + /** + * Prepares the user parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return user parameter value + */ + protected List<@Valid User> user(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(GenericTypes.TYPE__List_User) + : List.of(); + } + + /** + * Default result. + * + * @param status (required) Status value to be sent with this default result + */ + record Default(Status status) { + + /** + * Creates a response builder for the default response + * for the createUsersWithListInput operation; there are no required result values for this response. + * + * @return new builder for status 0 + */ + static Builder builder(Status status) { + return new Builder(status); + } + + /** + * Builder for the Default result. + */ + static class Builder implements io.helidon.common.Builder { + + private final Status status; + Builder(Status status) { + this.status = status; + + } + @Override + public Default build() { + return new Default(status); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Constructor for a result for the default result + * for the createUsersWithListInput operation, verifying non-null values for required return data. + * + */ + public Default(Status status) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + validator.require("status for default response", status); + validator.execute(); + this.status = status; + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(status); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the deleteUser operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new DeleteUser + */ + protected DeleteUserOp createDeleteUserOp() { + return new DeleteUserOp(); + } + + /** + * Helper elements for the {@code deleteUser} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class DeleteUserOp { + + /** + * Prepares the username parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return username parameter value + */ + protected String username(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("username") + .asOptional() + .orElse(null); + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the deleteUser operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the deleteUser operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the getUserByName operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new GetUserByName + */ + protected GetUserByNameOp createGetUserByNameOp() { + return new GetUserByNameOp(); + } + + /** + * Helper elements for the {@code getUserByName} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class GetUserByNameOp { + + /** + * Prepares the username parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return username parameter value + */ + protected String username(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("username") + .asOptional() + .orElse(null); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param response + */ + record Response200(User response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the getUserByName operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private User response; + @Override + public Response200 build() { + return new Response200(response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(User response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the getUserByName operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the getUserByName operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the loginUser operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new LoginUser + */ + protected LoginUserOp createLoginUserOp() { + return new LoginUserOp(); + } + + /** + * Helper elements for the {@code loginUser} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class LoginUserOp { + + /** + * Prepares the username parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return username parameter value + */ + protected String username(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("username") + .asOptional() + .orElse(null); + } + + /** + * Prepares the password parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return password parameter value + */ + protected String password(ServerRequest request, ValidatorUtils.Validator validator) { + return request.query() + .first("password") + .asOptional() + .orElse(null); + } + + /** + * Response for HTTP status code {@code 200}. + * + * @param xRateLimit calls per hour allowed by the user + * @param xExpiresAfter date in UTC when token expires + * @param response + */ + record Response200(Integer xRateLimit, + OffsetDateTime xExpiresAfter, + String response) { + + /** + * Creates a response builder for the status {@code 200} response + * for the loginUser operation; there are no required result values for this response. + * + * @return new builder for status 200 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response200 result. + */ + static class Builder implements io.helidon.common.Builder { + + private Integer xRateLimit; private OffsetDateTime xExpiresAfter; private String response; + @Override + public Response200 build() { + return new Response200(xRateLimit, + xExpiresAfter, + response); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + + /** + * Sets the value for the optional return property {@code xRateLimit}. + * @param xRateLimit calls per hour allowed by the user + * @return updated result builder + */ + Builder xRateLimit(Integer xRateLimit) { + this.xRateLimit = xRateLimit; + return this; + } + + /** + * Sets the value for the optional return property {@code xExpiresAfter}. + * @param xExpiresAfter date in UTC when token expires + * @return updated result builder + */ + Builder xExpiresAfter(OffsetDateTime xExpiresAfter) { + this.xExpiresAfter = xExpiresAfter; + return this; + } + + /** + * Sets the value for the optional return property {@code response}. + * @param response + * @return updated result builder + */ + Builder response(String response) { + this.response = response; + return this; + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.OK_200); if (xRateLimit != null) { + _serverResponse.header("X-Rate-Limit", xRateLimit.toString()); + } if (xExpiresAfter != null) { + _serverResponse.header("X-Expires-After", xExpiresAfter.toString()); + } + if (response != null) { + _serverResponse.send(response); + } else { + _serverResponse.send(); + } + } + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the loginUser operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the logoutUser operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new LogoutUser + */ + protected LogoutUserOp createLogoutUserOp() { + return new LogoutUserOp(); + } + + /** + * Helper elements for the {@code logoutUser} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class LogoutUserOp { + + /** + * Default result. + * + * @param status (required) Status value to be sent with this default result + */ + record Default(Status status) { + + /** + * Creates a response builder for the default response + * for the logoutUser operation; there are no required result values for this response. + * + * @return new builder for status 0 + */ + static Builder builder(Status status) { + return new Builder(status); + } + + /** + * Builder for the Default result. + */ + static class Builder implements io.helidon.common.Builder { + + private final Status status; + Builder(Status status) { + this.status = status; + + } + @Override + public Default build() { + return new Default(status); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Constructor for a result for the default result + * for the logoutUser operation, verifying non-null values for required return data. + * + */ + public Default(Status status) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + validator.require("status for default response", status); + validator.execute(); + this.status = status; + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(status); + _serverResponse.send(); + } + } + } + + /** + * Returns a new instance of the class which handles parameters to and responses from the updateUser operation. + *

+ * Developers can override this method if they extend the UserService class. + *

+ * + * @return new UpdateUser + */ + protected UpdateUserOp createUpdateUserOp() { + return new UpdateUserOp(); + } + + /** + * Helper elements for the {@code updateUser} operation. + *

+ * Also below are records for each response declared in the OpenAPI document, organized by response status. + *

+ * Once your code determines which (if any) declared response to send it can use the static {@code builder} method for + * that specific result, passing the required elements of the response as parameters, and then assign any optional + * response elements using the other builder methods. + *

+ * Finally, your code should invoke the {@code apply} method, passing the original {@link ServerResponse}. The + * generated method sets any headers you have assigned, sets the correct status in the response, and sends + * the response including any appropriate entity. + *

+ */ + public static class UpdateUserOp { + + /** + * Prepares the username parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return username parameter value + */ + protected String username(ServerRequest request, ValidatorUtils.Validator validator) { + return request.path() + .pathParameters() + .first("username") + .asOptional() + .orElse(null); + } + + /** + * Prepares the user parameter. + * + * @param request {@link io.helidon.webserver.http.ServerRequest} containing the parameter + * @param validator {@link org.openapitools.server.api.ValidatorUtils.Validator} for validating all parameters to the operation + * @return user parameter value + */ + protected User user(ServerRequest request, ValidatorUtils.Validator validator) { + return request.content().hasEntity() + ? request.content().as(User.class) + : null; + } + + /** + * Response for HTTP status code {@code 400}. + */ + record Response400() { + + /** + * Creates a response builder for the status {@code 400} response + * for the updateUser operation; there are no required result values for this response. + * + * @return new builder for status 400 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response400 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response400 build() { + return new Response400(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.BAD_REQUEST_400); + _serverResponse.send(); + } + } + + /** + * Response for HTTP status code {@code 404}. + */ + record Response404() { + + /** + * Creates a response builder for the status {@code 404} response + * for the updateUser operation; there are no required result values for this response. + * + * @return new builder for status 404 + */ + static Builder builder() { + return new Builder(); + } + + /** + * Builder for the Response404 result. + */ + static class Builder implements io.helidon.common.Builder { + + @Override + public Response404 build() { + return new Response404(); + } + + /** + * Sends the response data in this builder to the specified {@link io.helidon.webserver.http.ServerResponse}, + * assigning the HTTP status, any response headers, and any response entity. + *

+ * Equivalent to {@snippet : + * build().send(_serverResponse); + * } + *

+ * + * @param _serverResponse the {@code ServerResponse} to which to apply the status, headers, and entity + */ + void send(ServerResponse _serverResponse) { + build().send(_serverResponse); + } + } + + /** + * Applies this response data to the specified {@link io.helidon.webserver.http.ServerResponse}, assigning the + * HTTP status, any response headers, and any response entity. + * + * @param _serverResponse the server response to which to apply these result values + */ + void send(ServerResponse _serverResponse) { + _serverResponse.status(Status.NOT_FOUND_404); + _serverResponse.send(); + } + } + } + + + @Override + public void afterStop() { + System.out.println("Service UserService is down. Goodbye!"); + } + + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/UserServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/UserServiceImpl.java new file mode 100644 index 000000000000..b51933982657 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/UserServiceImpl.java @@ -0,0 +1,75 @@ +package org.openapitools.server.api; + +import java.util.stream.Collectors; +import org.openapitools.server.model.GenericTypes; +import java.util.HexFormat; +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.OffsetDateTime; +import java.util.Optional; +import io.helidon.http.Status; +import org.openapitools.server.model.User; +import jakarta.validation.Valid; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class UserServiceImpl extends UserService { + + @Override + protected void handleCreateUser(ServerRequest request, ServerResponse response, + User user) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleCreateUsersWithArrayInput(ServerRequest request, ServerResponse response, + List<@Valid User> user) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleCreateUsersWithListInput(ServerRequest request, ServerResponse response, + List<@Valid User> user) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleDeleteUser(ServerRequest request, ServerResponse response, + String username) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleGetUserByName(ServerRequest request, ServerResponse response, + String username) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleLoginUser(ServerRequest request, ServerResponse response, + String username, + String password) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleLogoutUser(ServerRequest request, ServerResponse response) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + protected void handleUpdateUser(ServerRequest request, ServerResponse response, + String username, + User user) { + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/ValidatorUtils.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/ValidatorUtils.java new file mode 100644 index 000000000000..f485f7d5ff6a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/api/ValidatorUtils.java @@ -0,0 +1,414 @@ +package org.openapitools.server.api; + +import java.lang.reflect.Array; +import java.math.BigDecimal; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +import io.helidon.common.Errors; +import io.helidon.common.mapper.OptionalValue; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +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); + } + } + + public static T nonEmpty(T arg) { + try { + return Objects.requireNonNull(arg, "Required value is missing"); + } catch (NullPointerException npe) { + throw new ValidationException(npe); + } + } + + public static T nonEmpty(Optional opt) { + if (opt.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return opt.get(); + } + + public static T nonEmpty(OptionalValue ov) { + if (ov.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return ov.get(); + } + + public static > M nonEmpty(M map) { + if (map.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return map; + } + + public static > C nonEmpty(C coll) { + if (coll.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return coll; + } + + static Validator validator() { + return new Validator(); + } + + public static class Validator { + + private final Errors.Collector errorsCollector = Errors.collector(); + + T check(String paramName, T paramValue, List validValues) { + if (!validValues.contains(paramValue)) { + errorsCollector.fatal(String.format("Invalid value %s = '%s' not among %s", + paramName, + paramValue, + validValues)); + } + return paramValue; + } + + T require(String paramName, T paramValue) { + if (paramValue == null || ((paramValue instanceof Optional opt) && opt.isEmpty())) { + errorsCollector.fatal(String.format("Missing required param: %s", paramName)); + } + return paramValue; + } + + List require(String paramName, List paramValues) { + if (paramValues.isEmpty()) { + errorsCollector.fatal(String.format("Empty required parameter: %s", paramName)); + } + return paramValues; + } + + T require(String paramName, Optional optionalValue) { + if (optionalValue.isEmpty()) { + errorsCollector.fatal(String.format("Empty required parameter: %s", paramName)); + } + return optionalValue.orElse(null); + } + + boolean validateMin(String paramName, Long value, Long min, boolean isExclusive) { + boolean result = value == null || value > min || !isExclusive && value.equals(min); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %d violates %sminimum %d", + paramName, + value, + isExclusive ? "exclusive " : "", + min)); + } + return result; + } + + boolean validateMin(String paramName, Optional value, Long min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Integer value, Integer min, boolean isExclusive) { + return validateMin(paramName, Long.valueOf(value), Long.valueOf(min), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Integer min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Short value, Short min, boolean isExclusive) { + return validateMin(paramName, value.intValue(), min.intValue(), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Short min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Byte value, Byte min, boolean isExclusive) { + return validateMin(paramName, value.intValue(), min.intValue(), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Byte min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Double value, Double min, boolean isExclusive) { + return validateMin(paramName, new BigDecimal(value), new BigDecimal(min), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Double min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Float value, Float min, boolean isExclusive) { + boolean result = value == null || value.compareTo(min) > 0 || isExclusive && value.equals(min); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %sminimum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + min)); + } + return result; + } + + boolean validateMin(String paramName, Optional value, Float min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, BigDecimal value, String min, boolean isExclusive) { + return validateMin(paramName, value, new BigDecimal(min), isExclusive); + } + + boolean validateMin(String paramName, BigDecimal value, BigDecimal min, boolean isExclusive) { + boolean result = value == null || value.compareTo(min) > 0 || !isExclusive && value.equals(min); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %sminimum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + min)); + } + return result; + } + + boolean validateMin(String paramName, Optional value, String min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMax(String paramName, Long value, Long max, boolean isExclusive) { + boolean result = value == null || value < max || !isExclusive && value.equals(max); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %d violates %smaximum %d", + paramName, + value, + isExclusive ? "exclusive " : "", + max)); + } + return result; + } + + boolean validateMax(String paramName, Optional value, Long max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Integer value, Integer max, boolean isExclusive) { + return validateMax(paramName, Long.valueOf(value), Long.valueOf(max), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Integer max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Short value, Short max, boolean isExclusive) { + return validateMax(paramName, value.intValue(), max.intValue(), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Short max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Byte value, Byte max, boolean isExclusive) { + return validateMax(paramName, value.intValue(), max.intValue(), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Byte max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Double value, Double max, boolean isExclusive) { + return validateMax(paramName, new BigDecimal(value), new BigDecimal(max), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Double max, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Float value, Float max, boolean isExclusive) { + boolean result = value == null || value.compareTo(max) < 0 || isExclusive && value.equals(max); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %smaximum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + max)); + } + return result; + } + + boolean validateMax(String paramName, Optional value, Float max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, BigDecimal value, String max, boolean isExclusive) { + return validateMax(paramName, value, new BigDecimal(max), isExclusive); + } + + boolean validateMax(String paramName, BigDecimal value, BigDecimal max, boolean isExclusive) { + boolean result = value == null || value.compareTo(max) < 0 || !isExclusive && value.equals(max); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %smaximum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + max)); + } + return result; + } + + boolean validateMax(String paramName, Optional value, String max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validatePattern(String paramName, String value, String pattern) { + boolean result = value == null || value.matches(pattern); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s '%s' does not match pattern '%s'", + paramName, + value, + pattern)); + } + return result; + } + + boolean validatePattern(String paramName, Optional value, String pattern) { + return value.isEmpty() || validatePattern(pattern, value.get(), pattern); + } + + boolean validateSize(String paramName, Object value, Integer min, Integer max) { + if (value == null) { + return true; + } + int size = switch (value) { + case Map map -> map.size(); + case CharSequence cs -> cs.length(); + case Collection coll -> coll.size(); + default -> value.getClass().isArray() ? Array.getLength(value) : -1; + }; + if (size == -1) { + errorsCollector.fatal(String.format("Parameter %s with type %s unrecognized for validating size", + paramName, + value.getClass().getName())); + return false; + } + if (min != null) { + validateMin(paramName, size, min, false); + } + if (max != null) { + validateMax(paramName, size, max, false); + } + return true; + } + + boolean validateSize(String paramName, Optional value, Integer min, Integer max) { + return value.isEmpty() || validateSize(paramName, value.get(), min, max); + } + + void execute() { + Errors errors = errorsCollector.collect(); + if (errors.hasFatal()) { + throw new ValidationException("Validation errors: " + errors); + } + } + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java new file mode 100644 index 000000000000..1266dac5d907 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java @@ -0,0 +1,87 @@ +package org.openapitools.server.model; + +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java new file mode 100644 index 000000000000..63eeb7f67afb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java @@ -0,0 +1,88 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.SingleRefType; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Animal.java new file mode 100644 index 000000000000..548edc48a8a8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 000000000000..83c75a242e8e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,72 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java new file mode 100644 index 000000000000..971fb516ba0c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java @@ -0,0 +1,72 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/ArrayTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ArrayTest.java new file mode 100644 index 000000000000..d94cad1da9a3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ArrayTest.java @@ -0,0 +1,106 @@ +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.ReadOnlyFirst; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/Capitalization.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Capitalization.java new file mode 100644 index 000000000000..942f62d57fbc --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Capitalization.java @@ -0,0 +1,153 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Cat.java new file mode 100644 index 000000000000..d0d01e632a5e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Cat.java @@ -0,0 +1,72 @@ +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; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/Category.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Category.java new file mode 100644 index 000000000000..ce9f854b3b91 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Category.java @@ -0,0 +1,85 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/ChildWithNullable.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ChildWithNullable.java new file mode 100644 index 000000000000..ea4c963b2b56 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ChildWithNullable.java @@ -0,0 +1,75 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.ParentWithNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class ChildWithNullable extends ParentWithNullable { + + private String otherProperty; + + /** + * Default constructor. + */ + public ChildWithNullable() { + // JSON-B / Jackson + } + + /** + * Create ChildWithNullable. + * + * @param otherProperty otherProperty + */ + public ChildWithNullable( + String otherProperty + ) { + this.otherProperty = otherProperty; + } + + + + /** + * Get otherProperty + * @return otherProperty + */ + public String getOtherProperty() { + return otherProperty; + } + + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).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/v4/se-uac/src/main/java/org/openapitools/server/model/ClassModel.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ClassModel.java new file mode 100644 index 000000000000..806a179ba10a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ClassModel.java @@ -0,0 +1,70 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se-uac/src/main/java/org/openapitools/server/model/Client.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Client.java new file mode 100644 index 000000000000..3b500ac997ee --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Client.java @@ -0,0 +1,68 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/DeprecatedObject.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/DeprecatedObject.java new file mode 100644 index 000000000000..4e2b7051130c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/DeprecatedObject.java @@ -0,0 +1,68 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/Dog.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Dog.java new file mode 100644 index 000000000000..f935612575ee --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Dog.java @@ -0,0 +1,72 @@ +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; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/EnumArrays.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/EnumArrays.java new file mode 100644 index 000000000000..29d6ebaa8fb4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/EnumArrays.java @@ -0,0 +1,164 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/EnumClass.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/EnumClass.java new file mode 100644 index 000000000000..ce974651d829 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/EnumClass.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se-uac/src/main/java/org/openapitools/server/model/EnumTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/EnumTest.java new file mode 100644 index 000000000000..d2d7d27c9414 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/EnumTest.java @@ -0,0 +1,345 @@ +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; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java new file mode 100644 index 000000000000..b50b92931cf5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,89 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class FakeBigDecimalMap200Response { + + private BigDecimal someId; + private Map someMap = new HashMap<>(); + + /** + * Default constructor. + */ + public FakeBigDecimalMap200Response() { + // JSON-B / Jackson + } + + /** + * Create FakeBigDecimalMap200Response. + * + * @param someId someId + * @param someMap someMap + */ + public FakeBigDecimalMap200Response( + BigDecimal someId, + Map someMap + ) { + this.someId = someId; + this.someMap = someMap; + } + + + + /** + * Get someId + * @return someId + */ + public BigDecimal getSomeId() { + return someId; + } + + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + /** + * Get someMap + * @return someMap + */ + public Map getSomeMap() { + return someMap; + } + + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).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/v4/se-uac/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java new file mode 100644 index 000000000000..2b6964db9dec --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java @@ -0,0 +1,89 @@ +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.ModelFile; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class FileSchemaTestClass { + + private ModelFile _file; + private List<@Valid ModelFile> files = new ArrayList<>(); + + /** + * Default constructor. + */ + public FileSchemaTestClass() { + // JSON-B / Jackson + } + + /** + * Create FileSchemaTestClass. + * + * @param _file _file + * @param files files + */ + public FileSchemaTestClass( + ModelFile _file, + List<@Valid ModelFile> 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<@Valid ModelFile> getFiles() { + return files; + } + + public void setFiles(List<@Valid ModelFile> 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/v4/se-uac/src/main/java/org/openapitools/server/model/Foo.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Foo.java new file mode 100644 index 000000000000..e02a00803c22 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Foo.java @@ -0,0 +1,68 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java new file mode 100644 index 000000000000..40f8d5855417 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java @@ -0,0 +1,70 @@ +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; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/FormatTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/FormatTest.java new file mode 100644 index 000000000000..92e3aef3e80d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/FormatTest.java @@ -0,0 +1,339 @@ +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; + + + +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("*").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/v4/se-uac/src/main/java/org/openapitools/server/model/GenericTypes.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/GenericTypes.java new file mode 100644 index 000000000000..b05ff79a8f5e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/GenericTypes.java @@ -0,0 +1,14 @@ +package org.openapitools.server.model; + +import java.util.List; +import java.util.Map; + +import io.helidon.common.GenericType; + +public interface GenericTypes { + GenericType> TYPE__List_EnumClass = new GenericType<>() {}; + GenericType> TYPE__List_String = new GenericType<>() {}; + GenericType> TYPE__List_User = new GenericType<>() {}; + GenericType> TYPE__Map_Object = new GenericType<>() {}; + GenericType> TYPE__Map_String = new GenericType<>() {}; +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java new file mode 100644 index 000000000000..50c41f059e3b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java @@ -0,0 +1,86 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/HealthCheckResult.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/HealthCheckResult.java new file mode 100644 index 000000000000..5b865aa0e3f3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/HealthCheckResult.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import org.openapitools.jackson.nullable.JsonNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se-uac/src/main/java/org/openapitools/server/model/MapTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/MapTest.java new file mode 100644 index 000000000000..f8051c6e3e45 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/MapTest.java @@ -0,0 +1,160 @@ +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; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 000000000000..9f2e5dc7bbef --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,107 @@ +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; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/Model200Response.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Model200Response.java new file mode 100644 index 000000000000..28f6bd2cdac0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Model200Response.java @@ -0,0 +1,88 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se-uac/src/main/java/org/openapitools/server/model/ModelApiResponse.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ModelApiResponse.java new file mode 100644 index 000000000000..81a468f1af79 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ModelApiResponse.java @@ -0,0 +1,103 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/ModelFile.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ModelFile.java new file mode 100644 index 000000000000..6743c641a001 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ModelFile.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se-uac/src/main/java/org/openapitools/server/model/ModelList.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ModelList.java new file mode 100644 index 000000000000..88000df9959e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ModelList.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/ModelReturn.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ModelReturn.java new file mode 100644 index 000000000000..a11d5e2b4e49 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ModelReturn.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se-uac/src/main/java/org/openapitools/server/model/Name.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Name.java new file mode 100644 index 000000000000..a3524465b284 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Name.java @@ -0,0 +1,121 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se-uac/src/main/java/org/openapitools/server/model/NullableClass.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/NullableClass.java new file mode 100644 index 000000000000..11e7e2ec0fd0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/NullableClass.java @@ -0,0 +1,264 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +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; + + + +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; + private List arrayAndItemsNullableProp; + private List arrayItemsNullable = new ArrayList<>(); + private Map objectNullableProp; + private Map objectAndItemsNullableProp; + 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/v4/se-uac/src/main/java/org/openapitools/server/model/NumberOnly.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/NumberOnly.java new file mode 100644 index 000000000000..7caf3c857f39 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/NumberOnly.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java new file mode 100644 index 000000000000..83bc634c1d6b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,124 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.DeprecatedObject; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/Order.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Order.java new file mode 100644 index 000000000000..0ca5e240f6f6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Order.java @@ -0,0 +1,194 @@ +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; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/OuterComposite.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/OuterComposite.java new file mode 100644 index 000000000000..696e549642d2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/OuterComposite.java @@ -0,0 +1,103 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/OuterEnum.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/OuterEnum.java new file mode 100644 index 000000000000..5a6730ab1b57 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/OuterEnum.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se-uac/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java new file mode 100644 index 000000000000..986b7b1f7f60 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se-uac/src/main/java/org/openapitools/server/model/OuterEnumInteger.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/OuterEnumInteger.java new file mode 100644 index 000000000000..ad5c4c2d3784 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/OuterEnumInteger.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se-uac/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 000000000000..93151449261e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se-uac/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java new file mode 100644 index 000000000000..cd57e792975e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.OuterEnumInteger; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/ParentWithNullable.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ParentWithNullable.java new file mode 100644 index 000000000000..e458a6ed3400 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ParentWithNullable.java @@ -0,0 +1,127 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class ParentWithNullable { + + + /** + * Gets or Sets type + */ + public enum TypeEnum { + CHILD_WITH_NULLABLE("ChildWithNullable"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static TypeEnum fromValue(String text) { + for (TypeEnum b : TypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private TypeEnum type; + private String nullableProperty; + + /** + * Default constructor. + */ + public ParentWithNullable() { + // JSON-B / Jackson + } + + /** + * Create ParentWithNullable. + * + * @param type type + * @param nullableProperty nullableProperty + */ + public ParentWithNullable( + TypeEnum type, + String nullableProperty + ) { + this.type = type; + this.nullableProperty = nullableProperty; + } + + + + /** + * Get type + * @return type + */ + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + /** + * Get nullableProperty + * @return nullableProperty + */ + public String getNullableProperty() { + return nullableProperty; + } + + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).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/v4/se-uac/src/main/java/org/openapitools/server/model/Pet.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Pet.java new file mode 100644 index 000000000000..671a9be156dc --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Pet.java @@ -0,0 +1,201 @@ +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.Arrays; +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; + + + +public class Pet { + + private Long id; + private Category category; + private String name; + private Set photoUrls = new LinkedHashSet<>(); + private List<@Valid Tag> 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<@Valid Tag> 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<@Valid Tag> getTags() { + return tags; + } + + public void setTags(List<@Valid Tag> 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/v4/se-uac/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java new file mode 100644 index 000000000000..6e9d1f16fb1d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java @@ -0,0 +1,85 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/SingleRefType.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/SingleRefType.java new file mode 100644 index 000000000000..d7ada5dddeaf --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/SingleRefType.java @@ -0,0 +1,45 @@ +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; + } + + @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/v4/se-uac/src/main/java/org/openapitools/server/model/SpecialModelName.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/SpecialModelName.java new file mode 100644 index 000000000000..9c14659f899a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/SpecialModelName.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/Tag.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Tag.java new file mode 100644 index 000000000000..e0d425d782e2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/Tag.java @@ -0,0 +1,85 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 000000000000..499fa5013feb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + private String someProperty; + + /** + * Default constructor. + */ + public TestInlineFreeformAdditionalPropertiesRequest() { + // JSON-B / Jackson + } + + /** + * Create TestInlineFreeformAdditionalPropertiesRequest. + * + * @param someProperty someProperty + */ + public TestInlineFreeformAdditionalPropertiesRequest( + String someProperty + ) { + this.someProperty = someProperty; + } + + + + /** + * Get someProperty + * @return someProperty + */ + public String getSomeProperty() { + return someProperty; + } + + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).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/v4/se-uac/src/main/java/org/openapitools/server/model/User.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/User.java new file mode 100644 index 000000000000..9decbea90472 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/model/User.java @@ -0,0 +1,187 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se-uac/src/main/java/org/openapitools/server/package-info.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/java/org/openapitools/server/package-info.java new file mode 100644 index 000000000000..1025e91aed8f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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/v4/se-uac/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/resources/META-INF/openapi.yml new file mode 100644 index 000000000000..a08bc26cc144 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/resources/META-INF/openapi.yml @@ -0,0 +1,2362 @@ +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 + - application/xml + /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 + - application/xml + /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 + - application/xml + 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-webclient-blocking: false + 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 + - application/xml + /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 generate 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 + - application/xml + /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 + - application/xml + /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 + - application/xml + 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: Something 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/BigDecimalMap: + get: + description: "for Java apache and Java native, test toUrlQueryString for maps\ + \ with BegDecimal keys" + operationId: fakeBigDecimalMap + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/fakeBigDecimalMap_200_response' + description: successful operation + tags: + - fake + 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/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + 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/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/nullable: + post: + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChildWithNullable' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test nullable parent property + 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 + xml: + name: photoUrl + type: array + uniqueItems: true + xml: + 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' + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' + 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 + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + 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 + ParentWithNullable: + discriminator: + propertyName: type + properties: + type: + enum: + - ChildWithNullable + type: string + nullableProperty: + nullable: true + type: string + type: object + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - properties: + otherProperty: + type: string + type: object + example: + otherProperty: otherProperty + nullableProperty: nullableProperty + type: ChildWithNullable + 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 + fakeBigDecimalMap_200_response: + example: + someId: 0.8008281904610115 + someMap: + key: 6.027456183070403 + properties: + someId: + type: number + someMap: + additionalProperties: + type: number + type: object + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + 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 + 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/v4/se-uac/src/main/resources/application.yaml b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/resources/application.yaml new file mode 100644 index 000000000000..2c0422edc74a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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/v4/se-uac/src/main/resources/logging.properties b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/resources/logging.properties new file mode 100644 index 000000000000..c9bc271dee7a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/main/resources/logging.properties @@ -0,0 +1,18 @@ + +# Example Logging Configuration File +# For more information see $JAVA_HOME/jre/lib/logging.properties + +# Send messages to the console +handlers=java.util.logging.ConsoleHandler + +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/v4/se-uac/src/test/java/org/openapitools/server/MainTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/MainTest.java new file mode 100644 index 000000000000..d86de4629d51 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/MainTest.java @@ -0,0 +1,39 @@ +package org.openapitools.server; + +import java.util.Collections; + +import jakarta.json.Json; +import jakarta.json.JsonBuilderFactory; + +import io.helidon.webclient.http1.Http1Client; +import io.helidon.webserver.http.HttpRouting; +import io.helidon.webserver.testing.junit5.ServerTest; +import io.helidon.webserver.testing.junit5.SetUpRoute; + +import org.junit.jupiter.api.Test; + +@ServerTest +public class MainTest { + + private static final JsonBuilderFactory JSON_BUILDER = Json.createBuilderFactory(Collections.emptyMap()); + + + + private Http1Client client; + + MainTest(Http1Client client) { + this.client = client; + } + + @SetUpRoute + static void routing(HttpRouting.Builder builder) { + Main.routing(builder); + } + + + + + @Test + public void test() throws Exception { + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..f6e06fc52a2b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.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 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/v4/se-uac/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java new file mode 100644 index 000000000000..61816df9b409 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.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 com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +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/v4/se-uac/src/test/java/org/openapitools/server/model/AnimalTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/AnimalTest.java new file mode 100644 index 000000000000..9a3043089ff3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/AnimalTest.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 com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +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/v4/se-uac/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..90060def339d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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.Arrays; +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/v4/se-uac/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..4a0fa46c97db --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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.Arrays; +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/v4/se-uac/src/test/java/org/openapitools/server/model/ArrayTestTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ArrayTestTest.java new file mode 100644 index 000000000000..f7cc01228ea5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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.Arrays; +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/v4/se-uac/src/test/java/org/openapitools/server/model/CapitalizationTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/CapitalizationTest.java new file mode 100644 index 000000000000..83b61a15b3e9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/CapitalizationTest.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.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/v4/se-uac/src/test/java/org/openapitools/server/model/CatTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/CatTest.java new file mode 100644 index 000000000000..dac6fe611165 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/CatTest.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 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/v4/se-uac/src/test/java/org/openapitools/server/model/CategoryTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/CategoryTest.java new file mode 100644 index 000000000000..02b10b942559 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/CategoryTest.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.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/v4/se-uac/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java new file mode 100644 index 000000000000..6246621383e2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.ParentWithNullable; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChildWithNullable + */ +public class ChildWithNullableTest { + private final ChildWithNullable model = new ChildWithNullable(); + + /** + * Model tests for ChildWithNullable + */ + @Test + public void testChildWithNullable() { + // TODO: test ChildWithNullable + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + public void nullablePropertyTest() { + // TODO: test nullableProperty + } + + /** + * Test the property 'otherProperty' + */ + @Test + public void otherPropertyTest() { + // TODO: test otherProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ClassModelTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ClassModelTest.java new file mode 100644 index 000000000000..a16d0d7af9e8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ClassModelTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/src/test/java/org/openapitools/server/model/ClientTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ClientTest.java new file mode 100644 index 000000000000..3edb9feb3d15 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ClientTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java new file mode 100644 index 000000000000..e2eba67dc94b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/src/test/java/org/openapitools/server/model/DogTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/DogTest.java new file mode 100644 index 000000000000..8143306030f6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/DogTest.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 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/v4/se-uac/src/test/java/org/openapitools/server/model/EnumArraysTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/EnumArraysTest.java new file mode 100644 index 000000000000..6d797b45ff82 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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.Arrays; +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/v4/se-uac/src/test/java/org/openapitools/server/model/EnumClassTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/EnumClassTest.java new file mode 100644 index 000000000000..8fa14bec99a4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/EnumClassTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/src/test/java/org/openapitools/server/model/EnumTestTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/EnumTestTest.java new file mode 100644 index 000000000000..fc60f14abf27 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/EnumTestTest.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.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/v4/se-uac/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java new file mode 100644 index 000000000000..c38a4e5469f2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.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 com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeBigDecimalMap200Response + */ +public class FakeBigDecimalMap200ResponseTest { + private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); + + /** + * Model tests for FakeBigDecimalMap200Response + */ + @Test + public void testFakeBigDecimalMap200Response() { + // TODO: test FakeBigDecimalMap200Response + } + + /** + * Test the property 'someId' + */ + @Test + public void someIdTest() { + // TODO: test someId + } + + /** + * Test the property 'someMap' + */ + @Test + public void someMapTest() { + // TODO: test someMap + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java new file mode 100644 index 000000000000..11b779605c74 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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.Arrays; +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/v4/se-uac/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java new file mode 100644 index 000000000000..83cb2f5ffb8c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.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.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/v4/se-uac/src/test/java/org/openapitools/server/model/FooTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/FooTest.java new file mode 100644 index 000000000000..9aecdffde70a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/FooTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/src/test/java/org/openapitools/server/model/FormatTestTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/FormatTestTest.java new file mode 100644 index 000000000000..3226b83d99ed --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/FormatTestTest.java @@ -0,0 +1,165 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java new file mode 100644 index 000000000000..f247acac7157 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.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 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/v4/se-uac/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java new file mode 100644 index 000000000000..594a8baa95c6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/HealthCheckResultTest.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.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/v4/se-uac/src/test/java/org/openapitools/server/model/MapTestTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/MapTestTest.java new file mode 100644 index 000000000000..ab00e116e10a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/MapTestTest.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 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/v4/se-uac/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..46eb7361ce6a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.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 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/v4/se-uac/src/test/java/org/openapitools/server/model/Model200ResponseTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/Model200ResponseTest.java new file mode 100644 index 000000000000..ad6f6db532c4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/Model200ResponseTest.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 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/v4/se-uac/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java new file mode 100644 index 000000000000..47500c309d89 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ModelApiResponseTest.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.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/v4/se-uac/src/test/java/org/openapitools/server/model/ModelFileTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ModelFileTest.java new file mode 100644 index 000000000000..21eafc087a27 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ModelFileTest.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 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/v4/se-uac/src/test/java/org/openapitools/server/model/ModelListTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ModelListTest.java new file mode 100644 index 000000000000..d073083d48a6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ModelListTest.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 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/v4/se-uac/src/test/java/org/openapitools/server/model/ModelReturnTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ModelReturnTest.java new file mode 100644 index 000000000000..d84cff2fdb06 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ModelReturnTest.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 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/v4/se-uac/src/test/java/org/openapitools/server/model/NameTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/NameTest.java new file mode 100644 index 000000000000..ac557c71d0d8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/NameTest.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.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/v4/se-uac/src/test/java/org/openapitools/server/model/NullableClassTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/NullableClassTest.java new file mode 100644 index 000000000000..a33acb6dd853 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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.Arrays; +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/v4/se-uac/src/test/java/org/openapitools/server/model/NumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/NumberOnlyTest.java new file mode 100644 index 000000000000..8d154d78f6e3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/NumberOnlyTest.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 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/v4/se-uac/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 000000000000..75417286d72b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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.Arrays; +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/v4/se-uac/src/test/java/org/openapitools/server/model/OrderTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OrderTest.java new file mode 100644 index 000000000000..8ac0b0fbdd00 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OrderTest.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/src/test/java/org/openapitools/server/model/OuterCompositeTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OuterCompositeTest.java new file mode 100644 index 000000000000..29769579ebfc --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OuterCompositeTest.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.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/v4/se-uac/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java new file mode 100644 index 000000000000..79a4bb7cf334 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 000000000000..8b693a146618 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java new file mode 100644 index 000000000000..bfc747798376 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/src/test/java/org/openapitools/server/model/OuterEnumTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OuterEnumTest.java new file mode 100644 index 000000000000..182b6b964185 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OuterEnumTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 000000000000..e06cefec2845 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.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.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +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/v4/se-uac/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java new file mode 100644 index 000000000000..466dc910f557 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ParentWithNullableTest.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.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ParentWithNullable + */ +public class ParentWithNullableTest { + private final ParentWithNullable model = new ParentWithNullable(); + + /** + * Model tests for ParentWithNullable + */ + @Test + public void testParentWithNullable() { + // TODO: test ParentWithNullable + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + public void nullablePropertyTest() { + // TODO: test nullableProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/PetTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/PetTest.java new file mode 100644 index 000000000000..0beb36cbe364 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/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.Arrays; +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/v4/se-uac/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java new file mode 100644 index 000000000000..1cb2ad846425 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.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.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/v4/se-uac/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java new file mode 100644 index 000000000000..a698b5ecb972 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se-uac/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java new file mode 100644 index 000000000000..45e482228aca --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/SpecialModelNameTest.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 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/v4/se-uac/src/test/java/org/openapitools/server/model/TagTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/TagTest.java new file mode 100644 index 000000000000..ead74db6880b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/TagTest.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.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/v4/se-uac/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 000000000000..55c3e0e12bb3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.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 java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/UserTest.java b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/UserTest.java new file mode 100644 index 000000000000..a9dbfb06dedd --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se-uac/src/test/java/org/openapitools/server/model/UserTest.java @@ -0,0 +1,95 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/.openapi-generator-ignore b/samples/server/petstore/java-helidon-server/v4/se/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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/v4/se/.openapi-generator/FILES b/samples/server/petstore/java-helidon-server/v4/se/.openapi-generator/FILES new file mode 100644 index 000000000000..b893425f65fa --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/.openapi-generator/FILES @@ -0,0 +1,85 @@ +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/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.java +src/main/java/org/openapitools/server/api/HCollectors.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/Category.java +src/main/java/org/openapitools/server/model/ChildWithNullable.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/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/FakeBigDecimalMap200Response.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/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.java +src/main/java/org/openapitools/server/model/GenericTypes.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/ParentWithNullable.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/TestInlineFreeformAdditionalPropertiesRequest.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 diff --git a/samples/server/petstore/java-helidon-server/v4/se/.openapi-generator/VERSION b/samples/server/petstore/java-helidon-server/v4/se/.openapi-generator/VERSION new file mode 100644 index 000000000000..6116b14d2c59 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.8.0-SNAPSHOT diff --git a/samples/server/petstore/java-helidon-server/v4/se/README.md b/samples/server/petstore/java-helidon-server/v4/se/README.md new file mode 100644 index 000000000000..3442efc621ab --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/README.md @@ -0,0 +1,79 @@ +# 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/BigDecimalMap +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 POST http://petstore.swagger.io:80/v2/fake/additionalProperties-reference +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 POST http://petstore.swagger.io:80/v2/fake/inline-freeform-additionalProperties +curl -X GET http://petstore.swagger.io:80/v2/fake/jsonFormData +curl -X POST http://petstore.swagger.io:80/v2/fake/nullable +curl -X PUT http://petstore.swagger.io:80/v2/fake/test-query-parameters +curl -X POST http://petstore.swagger.io:80/v2/fake/stringMap-reference +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/v4/se/pom.xml b/samples/server/petstore/java-helidon-server/v4/se/pom.xml new file mode 100644 index 000000000000..6a843edad14f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/pom.xml @@ -0,0 +1,122 @@ + + + 4.0.0 + + io.helidon.applications + helidon-se + 4.0.11 + + + 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.6 + + + + + jakarta.validation + jakarta.validation-api + + + io.helidon.webserver + helidon-webserver + + + io.helidon.http.media + helidon-http-media-jsonp + + + io.helidon.http.media + helidon-http-media-multipart + + + io.helidon.config + helidon-config-yaml + + + io.helidon.webserver.observe + helidon-webserver-observe-health + + + io.helidon.health + helidon-health + + + io.helidon.health + helidon-health-checks + + + io.helidon.webserver.observe + helidon-webserver-observe-metrics + + + io.helidon.metrics + helidon-metrics-system-meters + runtime + + + io.helidon.logging + helidon-logging-jul + runtime + + + io.helidon.openapi + helidon-openapi + + + org.openapitools + jackson-databind-nullable + ${version.jackson.databind.nullable} + + + io.helidon.http.media + helidon-http-media-jackson + + + org.junit.jupiter + junit-jupiter-api + test + + + io.helidon.webclient + helidon-webclient + test + + + io.helidon.webserver.testing.junit5 + helidon-webserver-testing-junit5 + 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/v4/se/src/main/java/org/openapitools/server/Main.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/Main.java new file mode 100644 index 000000000000..17d6343e2d6a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/Main.java @@ -0,0 +1,72 @@ +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.logging.common.LogConfig; +import io.helidon.config.Config; +import io.helidon.webserver.http.HttpRouting; +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 WebServer startServer() { + + // load logging configuration + LogConfig.configureRuntime(); + + // By default this will pick up application.yaml from the classpath + Config config = Config.create(); + Config.global(config); + + WebServer webserver = WebServer.builder() + .config(config.get("server")) + .routing(Main::routing) + .build() + .start(); + + System.out.println("WEB server is up! http://petstore.swagger.io:80/v2"); + + return webserver; + } + + /** + * Updates HTTP routing and implicitly registers observe providers. + */ + static void routing(HttpRouting.Builder routing) { + routing + .register("/another-fake/dummy", new AnotherFakeServiceImpl()) + .register("/foo", new DefaultServiceImpl()) + .register("/fake", new FakeServiceImpl()) + .register("/fake_classname_test", new FakeClassnameTags123ServiceImpl()) + .register("/", new PetServiceImpl())/* TODO - fix path or operation grouping for better performance */ + .register("/store", new StoreServiceImpl()) + .register("/user", new UserServiceImpl()); + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/RFC3339DateFormat.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/RFC3339DateFormat.java new file mode 100644 index 000000000000..f47f2f7f9837 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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/v4/se/src/main/java/org/openapitools/server/api/AnotherFakeService.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/AnotherFakeService.java new file mode 100644 index 000000000000..1bfa8a276a3e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/AnotherFakeService.java @@ -0,0 +1,35 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'AnotherFake'", + version = "stable") +public interface AnotherFakeService extends HttpService { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void routing(HttpRules rules) { + rules.patch("/", this::call123testSpecialTags); + } + + + /** + * PATCH /another-fake/dummy : To test special tags. + * + * @param request the server request + * @param response the server response + */ + void call123testSpecialTags(ServerRequest request, ServerResponse response); +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java new file mode 100644 index 000000000000..47e18fd44fad --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/AnotherFakeServiceImpl.java @@ -0,0 +1,27 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class AnotherFakeServiceImpl implements AnotherFakeService { + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + @Override + public void call123testSpecialTags(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + + @Override + public void afterStop() { + System.out.println("Service AnotherFakeService is down. Goodbye!"); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/DefaultService.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/DefaultService.java new file mode 100644 index 000000000000..8993f8894a37 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/DefaultService.java @@ -0,0 +1,35 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.FooGetDefaultResponse; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'Default'", + version = "stable") +public interface DefaultService extends HttpService { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void routing(HttpRules rules) { + rules.get("/", 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/v4/se/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java new file mode 100644 index 000000000000..fb7e5f50cb0a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/DefaultServiceImpl.java @@ -0,0 +1,27 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.FooGetDefaultResponse; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class DefaultServiceImpl implements DefaultService { + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + @Override + public void fooGet(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + + @Override + public void afterStop() { + System.out.println("Service DefaultService is down. Goodbye!"); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java new file mode 100644 index 000000000000..25b1938c65da --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java @@ -0,0 +1,35 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'FakeClassnameTags123'", + version = "stable") +public interface FakeClassnameTags123Service extends HttpService { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void routing(HttpRules rules) { + rules.patch("/", this::testClassname); + } + + + /** + * PATCH /fake_classname_test : To test class name in snake case. + * + * @param request the server request + * @param response the server response + */ + void testClassname(ServerRequest request, ServerResponse response); +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java new file mode 100644 index 000000000000..49c815f5ead2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/FakeClassnameTags123ServiceImpl.java @@ -0,0 +1,27 @@ +package org.openapitools.server.api; + +import org.openapitools.server.model.Client; +import java.util.HexFormat; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.helidon.http.Status; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class FakeClassnameTags123ServiceImpl implements FakeClassnameTags123Service { + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + @Override + public void testClassname(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + + @Override + public void afterStop() { + System.out.println("Service FakeClassnameTags123Service is down. Goodbye!"); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/FakeService.java new file mode 100644 index 000000000000..590761b0577d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/FakeService.java @@ -0,0 +1,233 @@ +package org.openapitools.server.api; + +import java.math.BigDecimal; +import org.openapitools.server.model.ChildWithNullable; +import org.openapitools.server.model.Client; +import java.util.stream.Collectors; +import org.openapitools.server.model.EnumClass; +import org.openapitools.server.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.server.model.FileSchemaTestClass; +import java.nio.file.Files; +import org.openapitools.server.model.GenericTypes; +import io.helidon.http.HeaderNames; +import io.helidon.http.Headers; +import org.openapitools.server.model.HealthCheckResult; +import java.util.HexFormat; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.time.LocalDate; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Objects; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.server.model.OuterComposite; +import org.openapitools.server.model.OuterObjectWithEnumProperty; +import io.helidon.common.parameters.Parameters; +import java.nio.file.Path; +import org.openapitools.server.model.Pet; +import io.helidon.http.media.multipart.ReadablePart; +import io.helidon.http.Status; +import org.openapitools.server.model.TestInlineFreeformAdditionalPropertiesRequest; +import java.io.UncheckedIOException; +import org.openapitools.server.model.User; +import io.helidon.common.mapper.Value; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'Fake'", + version = "stable") +public interface FakeService extends HttpService { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void routing(HttpRules rules) { + rules.get("/BigDecimalMap", this::fakeBigDecimalMap); + rules.get("/health", this::fakeHealthGet); + rules.get("/http-signature-test", this::fakeHttpSignatureTest); + rules.post("/outer/boolean", this::fakeOuterBooleanSerialize); + rules.post("/outer/composite", this::fakeOuterCompositeSerialize); + rules.post("/outer/number", this::fakeOuterNumberSerialize); + rules.post("/outer/string", this::fakeOuterStringSerialize); + rules.post("/property/enum-int", this::fakePropertyEnumIntegerSerialize); + rules.post("/additionalProperties-reference", this::testAdditionalPropertiesReference); + rules.put("/body-with-binary", this::testBodyWithBinary); + rules.put("/body-with-file-schema", this::testBodyWithFileSchema); + rules.put("/body-with-query-params", this::testBodyWithQueryParams); + rules.patch("/", this::testClientModel); + rules.post("/", this::testEndpointParameters); + rules.get("/", this::testEnumParameters); + rules.delete("/", this::testGroupParameters); + rules.post("/inline-additionalProperties", this::testInlineAdditionalProperties); + rules.post("/inline-freeform-additionalProperties", this::testInlineFreeformAdditionalProperties); + rules.get("/jsonFormData", this::testJsonFormData); + rules.post("/nullable", this::testNullable); + rules.put("/test-query-parameters", this::testQueryParameterCollectionFormat); + rules.post("/stringMap-reference", this::testStringMapReference); + } + + + /** + * GET /fake/BigDecimalMap. + * + * @param request the server request + * @param response the server response + */ + void fakeBigDecimalMap(ServerRequest request, ServerResponse response); + /** + * 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 + */ + void fakeHttpSignatureTest(ServerRequest request, ServerResponse response); + /** + * 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 + */ + void fakeOuterCompositeSerialize(ServerRequest request, ServerResponse response); + /** + * 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 + */ + void fakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response); + /** + * POST /fake/additionalProperties-reference : test referenced additionalProperties. + * + * @param request the server request + * @param response the server response + */ + void testAdditionalPropertiesReference(ServerRequest request, ServerResponse response); + /** + * 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 + */ + void testBodyWithFileSchema(ServerRequest request, ServerResponse response); + /** + * PUT /fake/body-with-query-params. + * + * @param request the server request + * @param response the server response + */ + void testBodyWithQueryParams(ServerRequest request, ServerResponse response); + /** + * PATCH /fake : To test \"client\" model. + * + * @param request the server request + * @param response the server response + */ + void testClientModel(ServerRequest request, ServerResponse response); + /** + * 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); + /** + * POST /fake/inline-freeform-additionalProperties : test inline free-form additionalProperties. + * + * @param request the server request + * @param response the server response + */ + void testInlineFreeformAdditionalProperties(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); + /** + * POST /fake/nullable : test nullable parent property. + * + * @param request the server request + * @param response the server response + */ + void testNullable(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); + /** + * POST /fake/stringMap-reference : test referenced string map. + * + * @param request the server request + * @param response the server response + */ + void testStringMapReference(ServerRequest request, ServerResponse response); +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java new file mode 100644 index 000000000000..5d591e8e957a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/FakeServiceImpl.java @@ -0,0 +1,207 @@ +package org.openapitools.server.api; + +import java.math.BigDecimal; +import org.openapitools.server.model.ChildWithNullable; +import org.openapitools.server.model.Client; +import java.util.stream.Collectors; +import org.openapitools.server.model.EnumClass; +import org.openapitools.server.model.FakeBigDecimalMap200Response; +import java.io.File; +import org.openapitools.server.model.FileSchemaTestClass; +import java.nio.file.Files; +import org.openapitools.server.model.GenericTypes; +import io.helidon.http.HeaderNames; +import io.helidon.http.Headers; +import org.openapitools.server.model.HealthCheckResult; +import java.util.HexFormat; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.time.LocalDate; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Objects; +import java.time.OffsetDateTime; +import java.util.Optional; +import org.openapitools.server.model.OuterComposite; +import org.openapitools.server.model.OuterObjectWithEnumProperty; +import io.helidon.common.parameters.Parameters; +import java.nio.file.Path; +import org.openapitools.server.model.Pet; +import io.helidon.http.media.multipart.ReadablePart; +import io.helidon.http.Status; +import org.openapitools.server.model.TestInlineFreeformAdditionalPropertiesRequest; +import java.io.UncheckedIOException; +import org.openapitools.server.model.User; +import io.helidon.common.mapper.Value; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class FakeServiceImpl implements FakeService { + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + @Override + public void fakeBigDecimalMap(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void fakeHealthGet(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void fakeHttpSignatureTest(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void fakeOuterBooleanSerialize(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void fakeOuterCompositeSerialize(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void fakeOuterNumberSerialize(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void fakeOuterStringSerialize(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void fakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testAdditionalPropertiesReference(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testBodyWithBinary(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testBodyWithFileSchema(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testBodyWithQueryParams(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testClientModel(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testEndpointParameters(ServerRequest request, ServerResponse response) { + Parameters formParams = request.content().as(Parameters.class); + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testEnumParameters(ServerRequest request, ServerResponse response) { + Parameters formParams = request.content().as(Parameters.class); + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testGroupParameters(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testInlineAdditionalProperties(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testInlineFreeformAdditionalProperties(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testJsonFormData(ServerRequest request, ServerResponse response) { + Parameters formParams = request.content().as(Parameters.class); + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testNullable(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testQueryParameterCollectionFormat(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void testStringMapReference(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + + @Override + public void afterStop() { + System.out.println("Service FakeService is down. Goodbye!"); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/HCollectors.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/HCollectors.java new file mode 100644 index 000000000000..c95c679e1dc9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/HCollectors.java @@ -0,0 +1,217 @@ +package org.openapitools.server.api; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.BiConsumer; +import java.util.function.BinaryOperator; +import java.util.function.Function; +import java.util.function.Supplier; +import java.util.stream.Collector; + +import io.helidon.common.GenericType; +import io.helidon.http.Headers; +import io.helidon.http.WritableHeaders; +import io.helidon.http.media.EntityReader; +import io.helidon.http.media.FormParamsSupport; +import io.helidon.http.media.MediaSupport; + +/** + * Collectors with particular features useful from the generated code. + */ +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "utility", + version = "stable") +public final class HCollectors { + + private static final MediaSupport FORM_PARAMS_SUPPORT = FormParamsSupport.create(); + private static final Headers EMPTY_HEADERS = WritableHeaders.create(); + + /** + * Returns a new {@link java.util.stream.Collector} that applies a default value in the absence of provided values and returns + * the resulting {@link java.util.List}. + * + * @param baseDefault default value expressed in the base type of the parameter + * @param converter transforms the default value from the base type to the result type + * @param base type + * @param result type + * @return new collector + */ + static Collector> toDefaultedList(BT baseDefault, Function converter) { + return new DefaultableListCollector<>(baseDefault, converter); + } + + static Collector> noOpMap() { + + return new NoOpMapCollector(); + } + + /** + * Decodes URL encoded string as binary data. + *

+ * Inspired hugely by java.net.URLDecoder. + *

+ * + * @param s URL encoded string + * @return binary data encoded by the string + */ + static byte[] decodeBinaryFormParam(String s) { + boolean needToChange = false; + int numChars = s.length(); + int i = 0; + + char c; + ByteArrayOutputStream output = new ByteArrayOutputStream(); + byte[] bytes = null; + while (i < numChars) { + c = s.charAt(i); + switch (c) { + case '+': + output.write(' '); + i++; + needToChange = true; + break; + case '%': + /* + * Starting with this instance of %, process all + * consecutive substrings of the form %xy. Each + * substring %xy will yield a byte. Convert all + * consecutive bytes obtained this way to whatever + * character(s) they represent in the provided + * encoding. + */ + + try { + + // (numChars-i)/3 is an upper bound for the number + // of remaining bytes + if (bytes == null) + bytes = new byte[(numChars-i)/3]; + int pos = 0; + + while ( ((i+2) < numChars) && + (c=='%')) { + int v = Integer.parseInt(s, i + 1, i + 3, 16); + if (v < 0) + throw new IllegalArgumentException( + "URLDecoder: Illegal hex characters in escape " + + "(%) pattern - negative value"); + bytes[pos++] = (byte) v; + i+= 3; + if (i < numChars) + c = s.charAt(i); + } + + // A trailing, incomplete byte encoding such as + // "%x" will cause an exception to be thrown + + if ((i < numChars) && (c=='%')) + throw new IllegalArgumentException( + "URLDecoder: Incomplete trailing escape (%) pattern"); + + output.write(bytes, 0, pos); + } catch (NumberFormatException e) { + throw new IllegalArgumentException( + "URLDecoder: Illegal hex characters in escape (%) pattern - " + + e.getMessage()); + } + needToChange = true; + break; + default: + output.write(c); + i++; + break; + } + } + + return output.toByteArray(); + } + + private static class NoOpMapCollector implements Collector, Map> { + + @Override + public Supplier> supplier() { + return LinkedHashMap::new; + } + + @Override + public BiConsumer, String> accumulator() { + return (map, expr) -> {}; + } + + @Override + public BinaryOperator> combiner() { + return (a, b) -> a; + } + + @Override + public Function, Map> finisher() { + return Function.identity(); + } + + @Override + public Set characteristics() { + return Set.of(); + } + } + + private abstract static class AbstractListCollector implements Collector, List> { + + @Override + public Supplier> supplier() { + return ArrayList::new; + } + + @Override + public BiConsumer, T> accumulator() { + return List::add; + } + + @Override + public BinaryOperator> combiner() { + return (l1, l2) -> { + l2.addAll(l1); + return l2; + }; + } + + @Override + public Set characteristics() { + return Set.of(); + } + } + + /** + * {@link java.util.stream.Collector} for streams of the base type (values from the request, often strings} + * applying a converter to the desired result type and supplying a default value if there are no base values. + * + * @param base type (often string) + * @param result type + */ + private static class DefaultableListCollector extends AbstractListCollector { + + private final BT baseDefault; + private final Function converter; + + DefaultableListCollector(BT baseDefault, Function converter) { + this.baseDefault = baseDefault; + this.converter = converter; + } + + @Override + public Function, List> finisher() { + return l -> { + if (l.isEmpty()) { + l.add(converter.apply(baseDefault)); + } + return l; + }; + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/JsonProvider.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/JsonProvider.java new file mode 100644 index 000000000000..41f01e882ab0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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/v4/se/src/main/java/org/openapitools/server/api/PetService.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/PetService.java new file mode 100644 index 000000000000..1ccfc5ad4d46 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/PetService.java @@ -0,0 +1,112 @@ +package org.openapitools.server.api; + +import java.util.stream.Collectors; +import java.io.File; +import io.helidon.http.HeaderNames; +import io.helidon.http.Headers; +import java.util.HexFormat; +import java.util.List; +import java.util.Map; +import org.openapitools.server.model.ModelApiResponse; +import io.helidon.http.media.multipart.MultiPart; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Optional; +import io.helidon.common.parameters.Parameters; +import org.openapitools.server.model.Pet; +import io.helidon.http.media.multipart.ReadablePart; +import java.util.Set; +import io.helidon.http.Status; +import io.helidon.common.mapper.Value; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'Pet'", + version = "stable") +public interface PetService extends HttpService { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void routing(HttpRules rules) { + rules.post("/pet", 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", 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 + */ + void addPet(ServerRequest request, ServerResponse response); + /** + * 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 + */ + void updatePet(ServerRequest request, ServerResponse response); + /** + * 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/v4/se/src/main/java/org/openapitools/server/api/PetServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/PetServiceImpl.java new file mode 100644 index 000000000000..9159d959b246 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/PetServiceImpl.java @@ -0,0 +1,99 @@ +package org.openapitools.server.api; + +import java.util.stream.Collectors; +import java.io.File; +import io.helidon.http.HeaderNames; +import io.helidon.http.Headers; +import java.util.HexFormat; +import java.util.List; +import java.util.Map; +import org.openapitools.server.model.ModelApiResponse; +import io.helidon.http.media.multipart.MultiPart; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Optional; +import io.helidon.common.parameters.Parameters; +import org.openapitools.server.model.Pet; +import io.helidon.http.media.multipart.ReadablePart; +import java.util.Set; +import io.helidon.http.Status; +import io.helidon.common.mapper.Value; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class PetServiceImpl implements PetService { + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + @Override + public void addPet(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void deletePet(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void findPetsByStatus(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void findPetsByTags(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void getPetById(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void updatePet(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void updatePetWithForm(ServerRequest request, ServerResponse response) { + Parameters formParams = request.content().as(Parameters.class); + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void uploadFile(ServerRequest request, ServerResponse response) { + MultiPart multiPart = request.content().as(MultiPart.class); + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void uploadFileWithRequiredFile(ServerRequest request, ServerResponse response) { + MultiPart multiPart = request.content().as(MultiPart.class); + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + + @Override + public void afterStop() { + System.out.println("Service PetService is down. Goodbye!"); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/StoreService.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/StoreService.java new file mode 100644 index 000000000000..cea059099e03 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/StoreService.java @@ -0,0 +1,60 @@ +package org.openapitools.server.api; + +import java.util.HexFormat; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.server.model.Order; +import io.helidon.http.Status; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'Store'", + version = "stable") +public interface StoreService extends HttpService { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void routing(HttpRules rules) { + rules.delete("/order/{order_id}", this::deleteOrder); + rules.get("/inventory", this::getInventory); + rules.get("/order/{order_id}", this::getOrderById); + rules.post("/order", 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 + */ + void placeOrder(ServerRequest request, ServerResponse response); +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/StoreServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/StoreServiceImpl.java new file mode 100644 index 000000000000..6e0668277506 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/StoreServiceImpl.java @@ -0,0 +1,49 @@ +package org.openapitools.server.api; + +import java.util.HexFormat; +import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.openapitools.server.model.Order; +import io.helidon.http.Status; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class StoreServiceImpl implements StoreService { + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + @Override + public void deleteOrder(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void getInventory(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void getOrderById(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void placeOrder(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + + @Override + public void afterStop() { + System.out.println("Service StoreService is down. Goodbye!"); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/UserService.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/UserService.java new file mode 100644 index 000000000000..07e989d6ced1 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/UserService.java @@ -0,0 +1,97 @@ +package org.openapitools.server.api; + +import java.util.stream.Collectors; +import org.openapitools.server.model.GenericTypes; +import java.util.HexFormat; +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.OffsetDateTime; +import java.util.Optional; +import io.helidon.http.Status; +import org.openapitools.server.model.User; +import jakarta.validation.Valid; + +import io.helidon.webserver.http.HttpRules; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.helidon.webserver.http.HttpService; + +@io.helidon.common.Generated(value = "org.openapitools.codegen.languages.JavaHelidonServerCodegen", + trigger = "tag = 'User'", + version = "stable") +public interface UserService extends HttpService { + + /** + * A service registers itself by updating the routing rules. + * @param rules the routing rules. + */ + @Override + default void routing(HttpRules rules) { + rules.post("/", this::createUser); + rules.post("/createWithArray", this::createUsersWithArrayInput); + rules.post("/createWithList", this::createUsersWithListInput); + rules.delete("/{username}", this::deleteUser); + rules.get("/{username}", this::getUserByName); + rules.get("/login", this::loginUser); + rules.get("/logout", this::logoutUser); + rules.put("/{username}", this::updateUser); + } + + + /** + * POST /user : Create user. + * + * @param request the server request + * @param response the server response + */ + void createUser(ServerRequest request, ServerResponse response); + /** + * 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 + */ + void updateUser(ServerRequest request, ServerResponse response); +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/UserServiceImpl.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/UserServiceImpl.java new file mode 100644 index 000000000000..77ebe9af120f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/UserServiceImpl.java @@ -0,0 +1,82 @@ +package org.openapitools.server.api; + +import java.util.stream.Collectors; +import org.openapitools.server.model.GenericTypes; +import java.util.HexFormat; +import java.util.List; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.time.OffsetDateTime; +import java.util.Optional; +import io.helidon.http.Status; +import org.openapitools.server.model.User; +import jakarta.validation.Valid; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +public class UserServiceImpl implements UserService { + private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); + + + @Override + public void createUser(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void createUsersWithArrayInput(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void createUsersWithListInput(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void deleteUser(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void getUserByName(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void loginUser(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void logoutUser(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + @Override + public void updateUser(ServerRequest request, ServerResponse response) { + ValidatorUtils.Validator validator = ValidatorUtils.validator(); + + response.status(Status.NOT_IMPLEMENTED_501).send(); + } + + + @Override + public void afterStop() { + System.out.println("Service UserService is down. Goodbye!"); + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/ValidatorUtils.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/ValidatorUtils.java new file mode 100644 index 000000000000..f485f7d5ff6a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/api/ValidatorUtils.java @@ -0,0 +1,414 @@ +package org.openapitools.server.api; + +import java.lang.reflect.Array; +import java.math.BigDecimal; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +import io.helidon.common.Errors; +import io.helidon.common.mapper.OptionalValue; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +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); + } + } + + public static T nonEmpty(T arg) { + try { + return Objects.requireNonNull(arg, "Required value is missing"); + } catch (NullPointerException npe) { + throw new ValidationException(npe); + } + } + + public static T nonEmpty(Optional opt) { + if (opt.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return opt.get(); + } + + public static T nonEmpty(OptionalValue ov) { + if (ov.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return ov.get(); + } + + public static > M nonEmpty(M map) { + if (map.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return map; + } + + public static > C nonEmpty(C coll) { + if (coll.isEmpty()) { + throw new ValidationException("Required value is missing"); + } + return coll; + } + + static Validator validator() { + return new Validator(); + } + + public static class Validator { + + private final Errors.Collector errorsCollector = Errors.collector(); + + T check(String paramName, T paramValue, List validValues) { + if (!validValues.contains(paramValue)) { + errorsCollector.fatal(String.format("Invalid value %s = '%s' not among %s", + paramName, + paramValue, + validValues)); + } + return paramValue; + } + + T require(String paramName, T paramValue) { + if (paramValue == null || ((paramValue instanceof Optional opt) && opt.isEmpty())) { + errorsCollector.fatal(String.format("Missing required param: %s", paramName)); + } + return paramValue; + } + + List require(String paramName, List paramValues) { + if (paramValues.isEmpty()) { + errorsCollector.fatal(String.format("Empty required parameter: %s", paramName)); + } + return paramValues; + } + + T require(String paramName, Optional optionalValue) { + if (optionalValue.isEmpty()) { + errorsCollector.fatal(String.format("Empty required parameter: %s", paramName)); + } + return optionalValue.orElse(null); + } + + boolean validateMin(String paramName, Long value, Long min, boolean isExclusive) { + boolean result = value == null || value > min || !isExclusive && value.equals(min); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %d violates %sminimum %d", + paramName, + value, + isExclusive ? "exclusive " : "", + min)); + } + return result; + } + + boolean validateMin(String paramName, Optional value, Long min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Integer value, Integer min, boolean isExclusive) { + return validateMin(paramName, Long.valueOf(value), Long.valueOf(min), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Integer min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Short value, Short min, boolean isExclusive) { + return validateMin(paramName, value.intValue(), min.intValue(), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Short min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Byte value, Byte min, boolean isExclusive) { + return validateMin(paramName, value.intValue(), min.intValue(), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Byte min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Double value, Double min, boolean isExclusive) { + return validateMin(paramName, new BigDecimal(value), new BigDecimal(min), isExclusive); + } + + boolean validateMin(String paramName, Optional value, Double min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, Float value, Float min, boolean isExclusive) { + boolean result = value == null || value.compareTo(min) > 0 || isExclusive && value.equals(min); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %sminimum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + min)); + } + return result; + } + + boolean validateMin(String paramName, Optional value, Float min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMin(String paramName, BigDecimal value, String min, boolean isExclusive) { + return validateMin(paramName, value, new BigDecimal(min), isExclusive); + } + + boolean validateMin(String paramName, BigDecimal value, BigDecimal min, boolean isExclusive) { + boolean result = value == null || value.compareTo(min) > 0 || !isExclusive && value.equals(min); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %sminimum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + min)); + } + return result; + } + + boolean validateMin(String paramName, Optional value, String min, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), min, isExclusive); + } + + boolean validateMax(String paramName, Long value, Long max, boolean isExclusive) { + boolean result = value == null || value < max || !isExclusive && value.equals(max); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %d violates %smaximum %d", + paramName, + value, + isExclusive ? "exclusive " : "", + max)); + } + return result; + } + + boolean validateMax(String paramName, Optional value, Long max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Integer value, Integer max, boolean isExclusive) { + return validateMax(paramName, Long.valueOf(value), Long.valueOf(max), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Integer max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Short value, Short max, boolean isExclusive) { + return validateMax(paramName, value.intValue(), max.intValue(), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Short max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Byte value, Byte max, boolean isExclusive) { + return validateMax(paramName, value.intValue(), max.intValue(), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Byte max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Double value, Double max, boolean isExclusive) { + return validateMax(paramName, new BigDecimal(value), new BigDecimal(max), isExclusive); + } + + boolean validateMax(String paramName, Optional value, Double max, boolean isExclusive) { + return value.isEmpty() || validateMin(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, Float value, Float max, boolean isExclusive) { + boolean result = value == null || value.compareTo(max) < 0 || isExclusive && value.equals(max); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %smaximum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + max)); + } + return result; + } + + boolean validateMax(String paramName, Optional value, Float max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validateMax(String paramName, BigDecimal value, String max, boolean isExclusive) { + return validateMax(paramName, value, new BigDecimal(max), isExclusive); + } + + boolean validateMax(String paramName, BigDecimal value, BigDecimal max, boolean isExclusive) { + boolean result = value == null || value.compareTo(max) < 0 || !isExclusive && value.equals(max); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s %f violates %smaximum %f", + paramName, + value, + isExclusive ? "exclusive " : "", + max)); + } + return result; + } + + boolean validateMax(String paramName, Optional value, String max, boolean isExclusive) { + return value.isEmpty() || validateMax(paramName, value.get(), max, isExclusive); + } + + boolean validatePattern(String paramName, String value, String pattern) { + boolean result = value == null || value.matches(pattern); + if (!result) { + errorsCollector.fatal(String.format("Parameter %s '%s' does not match pattern '%s'", + paramName, + value, + pattern)); + } + return result; + } + + boolean validatePattern(String paramName, Optional value, String pattern) { + return value.isEmpty() || validatePattern(pattern, value.get(), pattern); + } + + boolean validateSize(String paramName, Object value, Integer min, Integer max) { + if (value == null) { + return true; + } + int size = switch (value) { + case Map map -> map.size(); + case CharSequence cs -> cs.length(); + case Collection coll -> coll.size(); + default -> value.getClass().isArray() ? Array.getLength(value) : -1; + }; + if (size == -1) { + errorsCollector.fatal(String.format("Parameter %s with type %s unrecognized for validating size", + paramName, + value.getClass().getName())); + return false; + } + if (min != null) { + validateMin(paramName, size, min, false); + } + if (max != null) { + validateMax(paramName, size, max, false); + } + return true; + } + + boolean validateSize(String paramName, Optional value, Integer min, Integer max) { + return value.isEmpty() || validateSize(paramName, value.get(), min, max); + } + + void execute() { + Errors errors = errorsCollector.collect(); + if (errors.hasFatal()) { + throw new ValidationException("Validation errors: " + errors); + } + } + } +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java new file mode 100644 index 000000000000..1266dac5d907 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java @@ -0,0 +1,87 @@ +package org.openapitools.server.model; + +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java new file mode 100644 index 000000000000..63eeb7f67afb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java @@ -0,0 +1,88 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.SingleRefType; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Animal.java new file mode 100644 index 000000000000..548edc48a8a8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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 jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 000000000000..83c75a242e8e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,72 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java new file mode 100644 index 000000000000..971fb516ba0c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java @@ -0,0 +1,72 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/ArrayTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ArrayTest.java new file mode 100644 index 000000000000..d94cad1da9a3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ArrayTest.java @@ -0,0 +1,106 @@ +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.ReadOnlyFirst; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/Capitalization.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Capitalization.java new file mode 100644 index 000000000000..942f62d57fbc --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Capitalization.java @@ -0,0 +1,153 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Cat.java new file mode 100644 index 000000000000..d0d01e632a5e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Cat.java @@ -0,0 +1,72 @@ +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; + + + +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/v4/se/src/main/java/org/openapitools/server/model/Category.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Category.java new file mode 100644 index 000000000000..ce9f854b3b91 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Category.java @@ -0,0 +1,85 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/ChildWithNullable.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ChildWithNullable.java new file mode 100644 index 000000000000..ea4c963b2b56 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ChildWithNullable.java @@ -0,0 +1,75 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.ParentWithNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class ChildWithNullable extends ParentWithNullable { + + private String otherProperty; + + /** + * Default constructor. + */ + public ChildWithNullable() { + // JSON-B / Jackson + } + + /** + * Create ChildWithNullable. + * + * @param otherProperty otherProperty + */ + public ChildWithNullable( + String otherProperty + ) { + this.otherProperty = otherProperty; + } + + + + /** + * Get otherProperty + * @return otherProperty + */ + public String getOtherProperty() { + return otherProperty; + } + + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).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/v4/se/src/main/java/org/openapitools/server/model/ClassModel.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ClassModel.java new file mode 100644 index 000000000000..806a179ba10a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ClassModel.java @@ -0,0 +1,70 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se/src/main/java/org/openapitools/server/model/Client.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Client.java new file mode 100644 index 000000000000..3b500ac997ee --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Client.java @@ -0,0 +1,68 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/DeprecatedObject.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/DeprecatedObject.java new file mode 100644 index 000000000000..4e2b7051130c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/DeprecatedObject.java @@ -0,0 +1,68 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/Dog.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Dog.java new file mode 100644 index 000000000000..f935612575ee --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Dog.java @@ -0,0 +1,72 @@ +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; + + + +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/v4/se/src/main/java/org/openapitools/server/model/EnumArrays.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/EnumArrays.java new file mode 100644 index 000000000000..29d6ebaa8fb4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/EnumArrays.java @@ -0,0 +1,164 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/EnumClass.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/EnumClass.java new file mode 100644 index 000000000000..ce974651d829 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/EnumClass.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se/src/main/java/org/openapitools/server/model/EnumTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/EnumTest.java new file mode 100644 index 000000000000..d2d7d27c9414 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/EnumTest.java @@ -0,0 +1,345 @@ +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; + + + +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/v4/se/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java new file mode 100644 index 000000000000..b50b92931cf5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/FakeBigDecimalMap200Response.java @@ -0,0 +1,89 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class FakeBigDecimalMap200Response { + + private BigDecimal someId; + private Map someMap = new HashMap<>(); + + /** + * Default constructor. + */ + public FakeBigDecimalMap200Response() { + // JSON-B / Jackson + } + + /** + * Create FakeBigDecimalMap200Response. + * + * @param someId someId + * @param someMap someMap + */ + public FakeBigDecimalMap200Response( + BigDecimal someId, + Map someMap + ) { + this.someId = someId; + this.someMap = someMap; + } + + + + /** + * Get someId + * @return someId + */ + public BigDecimal getSomeId() { + return someId; + } + + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + /** + * Get someMap + * @return someMap + */ + public Map getSomeMap() { + return someMap; + } + + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).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/v4/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java new file mode 100644 index 000000000000..2b6964db9dec --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java @@ -0,0 +1,89 @@ +package org.openapitools.server.model; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.ModelFile; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class FileSchemaTestClass { + + private ModelFile _file; + private List<@Valid ModelFile> files = new ArrayList<>(); + + /** + * Default constructor. + */ + public FileSchemaTestClass() { + // JSON-B / Jackson + } + + /** + * Create FileSchemaTestClass. + * + * @param _file _file + * @param files files + */ + public FileSchemaTestClass( + ModelFile _file, + List<@Valid ModelFile> 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<@Valid ModelFile> getFiles() { + return files; + } + + public void setFiles(List<@Valid ModelFile> 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/v4/se/src/main/java/org/openapitools/server/model/Foo.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Foo.java new file mode 100644 index 000000000000..e02a00803c22 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Foo.java @@ -0,0 +1,68 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java new file mode 100644 index 000000000000..40f8d5855417 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java @@ -0,0 +1,70 @@ +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; + + + +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/v4/se/src/main/java/org/openapitools/server/model/FormatTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/FormatTest.java new file mode 100644 index 000000000000..92e3aef3e80d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/FormatTest.java @@ -0,0 +1,339 @@ +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; + + + +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("*").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/v4/se/src/main/java/org/openapitools/server/model/GenericTypes.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/GenericTypes.java new file mode 100644 index 000000000000..b05ff79a8f5e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/GenericTypes.java @@ -0,0 +1,14 @@ +package org.openapitools.server.model; + +import java.util.List; +import java.util.Map; + +import io.helidon.common.GenericType; + +public interface GenericTypes { + GenericType> TYPE__List_EnumClass = new GenericType<>() {}; + GenericType> TYPE__List_String = new GenericType<>() {}; + GenericType> TYPE__List_User = new GenericType<>() {}; + GenericType> TYPE__Map_Object = new GenericType<>() {}; + GenericType> TYPE__Map_String = new GenericType<>() {}; +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java new file mode 100644 index 000000000000..50c41f059e3b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java @@ -0,0 +1,86 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/HealthCheckResult.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/HealthCheckResult.java new file mode 100644 index 000000000000..5b865aa0e3f3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/HealthCheckResult.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import org.openapitools.jackson.nullable.JsonNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se/src/main/java/org/openapitools/server/model/MapTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/MapTest.java new file mode 100644 index 000000000000..f8051c6e3e45 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/MapTest.java @@ -0,0 +1,160 @@ +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; + + + +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/v4/se/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 000000000000..9f2e5dc7bbef --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,107 @@ +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; + + + +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/v4/se/src/main/java/org/openapitools/server/model/Model200Response.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Model200Response.java new file mode 100644 index 000000000000..28f6bd2cdac0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Model200Response.java @@ -0,0 +1,88 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se/src/main/java/org/openapitools/server/model/ModelApiResponse.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ModelApiResponse.java new file mode 100644 index 000000000000..81a468f1af79 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ModelApiResponse.java @@ -0,0 +1,103 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/ModelFile.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ModelFile.java new file mode 100644 index 000000000000..6743c641a001 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ModelFile.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se/src/main/java/org/openapitools/server/model/ModelList.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ModelList.java new file mode 100644 index 000000000000..88000df9959e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ModelList.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/ModelReturn.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ModelReturn.java new file mode 100644 index 000000000000..a11d5e2b4e49 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ModelReturn.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se/src/main/java/org/openapitools/server/model/Name.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Name.java new file mode 100644 index 000000000000..a3524465b284 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Name.java @@ -0,0 +1,121 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + +/** + * 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/v4/se/src/main/java/org/openapitools/server/model/NullableClass.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/NullableClass.java new file mode 100644 index 000000000000..11e7e2ec0fd0 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/NullableClass.java @@ -0,0 +1,264 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +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; + + + +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; + private List arrayAndItemsNullableProp; + private List arrayItemsNullable = new ArrayList<>(); + private Map objectNullableProp; + private Map objectAndItemsNullableProp; + 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/v4/se/src/main/java/org/openapitools/server/model/NumberOnly.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/NumberOnly.java new file mode 100644 index 000000000000..7caf3c857f39 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/NumberOnly.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java new file mode 100644 index 000000000000..83bc634c1d6b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,124 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.server.model.DeprecatedObject; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/Order.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Order.java new file mode 100644 index 000000000000..0ca5e240f6f6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Order.java @@ -0,0 +1,194 @@ +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; + + + +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/v4/se/src/main/java/org/openapitools/server/model/OuterComposite.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/OuterComposite.java new file mode 100644 index 000000000000..696e549642d2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/OuterComposite.java @@ -0,0 +1,103 @@ +package org.openapitools.server.model; + +import java.math.BigDecimal; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/OuterEnum.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/OuterEnum.java new file mode 100644 index 000000000000..5a6730ab1b57 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/OuterEnum.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java new file mode 100644 index 000000000000..986b7b1f7f60 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se/src/main/java/org/openapitools/server/model/OuterEnumInteger.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/OuterEnumInteger.java new file mode 100644 index 000000000000..ad5c4c2d3784 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/OuterEnumInteger.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 000000000000..93151449261e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,46 @@ +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; + } + + @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/v4/se/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java new file mode 100644 index 000000000000..cd57e792975e --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.server.model.OuterEnumInteger; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/ParentWithNullable.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ParentWithNullable.java new file mode 100644 index 000000000000..e458a6ed3400 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ParentWithNullable.java @@ -0,0 +1,127 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class ParentWithNullable { + + + /** + * Gets or Sets type + */ + public enum TypeEnum { + CHILD_WITH_NULLABLE("ChildWithNullable"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + + @JsonCreator + public static TypeEnum fromValue(String text) { + for (TypeEnum b : TypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + text + "'"); + } + } + + + private TypeEnum type; + private String nullableProperty; + + /** + * Default constructor. + */ + public ParentWithNullable() { + // JSON-B / Jackson + } + + /** + * Create ParentWithNullable. + * + * @param type type + * @param nullableProperty nullableProperty + */ + public ParentWithNullable( + TypeEnum type, + String nullableProperty + ) { + this.type = type; + this.nullableProperty = nullableProperty; + } + + + + /** + * Get type + * @return type + */ + public TypeEnum getType() { + return type; + } + + public void setType(TypeEnum type) { + this.type = type; + } + + /** + * Get nullableProperty + * @return nullableProperty + */ + public String getNullableProperty() { + return nullableProperty; + } + + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).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/v4/se/src/main/java/org/openapitools/server/model/Pet.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Pet.java new file mode 100644 index 000000000000..671a9be156dc --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Pet.java @@ -0,0 +1,201 @@ +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.Arrays; +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; + + + +public class Pet { + + private Long id; + private Category category; + private String name; + private Set photoUrls = new LinkedHashSet<>(); + private List<@Valid Tag> 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<@Valid Tag> 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<@Valid Tag> getTags() { + return tags; + } + + public void setTags(List<@Valid Tag> 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/v4/se/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java new file mode 100644 index 000000000000..6e9d1f16fb1d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java @@ -0,0 +1,85 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/SingleRefType.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/SingleRefType.java new file mode 100644 index 000000000000..d7ada5dddeaf --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/SingleRefType.java @@ -0,0 +1,45 @@ +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; + } + + @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/v4/se/src/main/java/org/openapitools/server/model/SpecialModelName.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/SpecialModelName.java new file mode 100644 index 000000000000..9c14659f899a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/SpecialModelName.java @@ -0,0 +1,69 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/Tag.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Tag.java new file mode 100644 index 000000000000..e0d425d782e2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/Tag.java @@ -0,0 +1,85 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java new file mode 100644 index 000000000000..499fa5013feb --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -0,0 +1,71 @@ +package org.openapitools.server.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.HashMap; +import java.util.Map; +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap { + + private String someProperty; + + /** + * Default constructor. + */ + public TestInlineFreeformAdditionalPropertiesRequest() { + // JSON-B / Jackson + } + + /** + * Create TestInlineFreeformAdditionalPropertiesRequest. + * + * @param someProperty someProperty + */ + public TestInlineFreeformAdditionalPropertiesRequest( + String someProperty + ) { + this.someProperty = someProperty; + } + + + + /** + * Get someProperty + * @return someProperty + */ + public String getSomeProperty() { + return someProperty; + } + + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; + } + + /** + * Create a string representation of this pojo. + **/ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).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/v4/se/src/main/java/org/openapitools/server/model/User.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/User.java new file mode 100644 index 000000000000..9decbea90472 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/model/User.java @@ -0,0 +1,187 @@ +package org.openapitools.server.model; + +import jakarta.validation.constraints.*; +import jakarta.validation.Valid; + + + +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/v4/se/src/main/java/org/openapitools/server/package-info.java b/samples/server/petstore/java-helidon-server/v4/se/src/main/java/org/openapitools/server/package-info.java new file mode 100644 index 000000000000..1025e91aed8f --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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/v4/se/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/java-helidon-server/v4/se/src/main/resources/META-INF/openapi.yml new file mode 100644 index 000000000000..a08bc26cc144 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/resources/META-INF/openapi.yml @@ -0,0 +1,2362 @@ +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 + - application/xml + /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 + - application/xml + /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 + - application/xml + 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-webclient-blocking: false + 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 + - application/xml + /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 generate 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 + - application/xml + /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 + - application/xml + /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 + - application/xml + 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: Something 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/BigDecimalMap: + get: + description: "for Java apache and Java native, test toUrlQueryString for maps\ + \ with BegDecimal keys" + operationId: fakeBigDecimalMap + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/fakeBigDecimalMap_200_response' + description: successful operation + tags: + - fake + 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/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + 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/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + /fake/nullable: + post: + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChildWithNullable' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test nullable parent property + 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 + xml: + name: photoUrl + type: array + uniqueItems: true + xml: + 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' + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' + 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 + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + 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 + ParentWithNullable: + discriminator: + propertyName: type + properties: + type: + enum: + - ChildWithNullable + type: string + nullableProperty: + nullable: true + type: string + type: object + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - properties: + otherProperty: + type: string + type: object + example: + otherProperty: otherProperty + nullableProperty: nullableProperty + type: ChildWithNullable + 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 + fakeBigDecimalMap_200_response: + example: + someId: 0.8008281904610115 + someMap: + key: 6.027456183070403 + properties: + someId: + type: number + someMap: + additionalProperties: + type: number + type: object + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + 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 + 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/v4/se/src/main/resources/application.yaml b/samples/server/petstore/java-helidon-server/v4/se/src/main/resources/application.yaml new file mode 100644 index 000000000000..2c0422edc74a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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/v4/se/src/main/resources/logging.properties b/samples/server/petstore/java-helidon-server/v4/se/src/main/resources/logging.properties new file mode 100644 index 000000000000..c9bc271dee7a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/main/resources/logging.properties @@ -0,0 +1,18 @@ + +# Example Logging Configuration File +# For more information see $JAVA_HOME/jre/lib/logging.properties + +# Send messages to the console +handlers=java.util.logging.ConsoleHandler + +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/v4/se/src/test/java/org/openapitools/server/MainTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/MainTest.java new file mode 100644 index 000000000000..d86de4629d51 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/MainTest.java @@ -0,0 +1,39 @@ +package org.openapitools.server; + +import java.util.Collections; + +import jakarta.json.Json; +import jakarta.json.JsonBuilderFactory; + +import io.helidon.webclient.http1.Http1Client; +import io.helidon.webserver.http.HttpRouting; +import io.helidon.webserver.testing.junit5.ServerTest; +import io.helidon.webserver.testing.junit5.SetUpRoute; + +import org.junit.jupiter.api.Test; + +@ServerTest +public class MainTest { + + private static final JsonBuilderFactory JSON_BUILDER = Json.createBuilderFactory(Collections.emptyMap()); + + + + private Http1Client client; + + MainTest(Http1Client client) { + this.client = client; + } + + @SetUpRoute + static void routing(HttpRouting.Builder builder) { + Main.routing(builder); + } + + + + + @Test + public void test() throws Exception { + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..f6e06fc52a2b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.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 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/v4/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java new file mode 100644 index 000000000000..61816df9b409 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.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 com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +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/v4/se/src/test/java/org/openapitools/server/model/AnimalTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/AnimalTest.java new file mode 100644 index 000000000000..9a3043089ff3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/AnimalTest.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 com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +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/v4/se/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..90060def339d --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 000000000000..4a0fa46c97db --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/server/model/ArrayTestTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ArrayTestTest.java new file mode 100644 index 000000000000..f7cc01228ea5 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/server/model/CapitalizationTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/CapitalizationTest.java new file mode 100644 index 000000000000..83b61a15b3e9 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/CapitalizationTest.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.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/v4/se/src/test/java/org/openapitools/server/model/CatTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/CatTest.java new file mode 100644 index 000000000000..dac6fe611165 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/CatTest.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 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/v4/se/src/test/java/org/openapitools/server/model/CategoryTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/CategoryTest.java new file mode 100644 index 000000000000..02b10b942559 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/CategoryTest.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.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/v4/se/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java new file mode 100644 index 000000000000..6246621383e2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ChildWithNullableTest.java @@ -0,0 +1,62 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.server.model.ParentWithNullable; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ChildWithNullable + */ +public class ChildWithNullableTest { + private final ChildWithNullable model = new ChildWithNullable(); + + /** + * Model tests for ChildWithNullable + */ + @Test + public void testChildWithNullable() { + // TODO: test ChildWithNullable + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + public void nullablePropertyTest() { + // TODO: test nullableProperty + } + + /** + * Test the property 'otherProperty' + */ + @Test + public void otherPropertyTest() { + // TODO: test otherProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ClassModelTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ClassModelTest.java new file mode 100644 index 000000000000..a16d0d7af9e8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ClassModelTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/server/model/ClientTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ClientTest.java new file mode 100644 index 000000000000..3edb9feb3d15 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ClientTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java new file mode 100644 index 000000000000..e2eba67dc94b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/server/model/DogTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/DogTest.java new file mode 100644 index 000000000000..8143306030f6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/DogTest.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 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/v4/se/src/test/java/org/openapitools/server/model/EnumArraysTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/EnumArraysTest.java new file mode 100644 index 000000000000..6d797b45ff82 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/server/model/EnumClassTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/EnumClassTest.java new file mode 100644 index 000000000000..8fa14bec99a4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/EnumClassTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/server/model/EnumTestTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/EnumTestTest.java new file mode 100644 index 000000000000..fc60f14abf27 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/EnumTestTest.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.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/v4/se/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.java new file mode 100644 index 000000000000..c38a4e5469f2 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/FakeBigDecimalMap200ResponseTest.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 com.fasterxml.jackson.annotation.JsonTypeName; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for FakeBigDecimalMap200Response + */ +public class FakeBigDecimalMap200ResponseTest { + private final FakeBigDecimalMap200Response model = new FakeBigDecimalMap200Response(); + + /** + * Model tests for FakeBigDecimalMap200Response + */ + @Test + public void testFakeBigDecimalMap200Response() { + // TODO: test FakeBigDecimalMap200Response + } + + /** + * Test the property 'someId' + */ + @Test + public void someIdTest() { + // TODO: test someId + } + + /** + * Test the property 'someMap' + */ + @Test + public void someMapTest() { + // TODO: test someMap + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java new file mode 100644 index 000000000000..11b779605c74 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java new file mode 100644 index 000000000000..83cb2f5ffb8c --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.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.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/v4/se/src/test/java/org/openapitools/server/model/FooTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/FooTest.java new file mode 100644 index 000000000000..9aecdffde70a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/FooTest.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/server/model/FormatTestTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/FormatTestTest.java new file mode 100644 index 000000000000..3226b83d99ed --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/FormatTestTest.java @@ -0,0 +1,165 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java new file mode 100644 index 000000000000..f247acac7157 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.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 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/v4/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java new file mode 100644 index 000000000000..594a8baa95c6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/HealthCheckResultTest.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.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/v4/se/src/test/java/org/openapitools/server/model/MapTestTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/MapTestTest.java new file mode 100644 index 000000000000..ab00e116e10a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/MapTestTest.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 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/v4/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 000000000000..46eb7361ce6a --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.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 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/v4/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.java new file mode 100644 index 000000000000..ad6f6db532c4 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/Model200ResponseTest.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 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/v4/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java new file mode 100644 index 000000000000..47500c309d89 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ModelApiResponseTest.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.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/v4/se/src/test/java/org/openapitools/server/model/ModelFileTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ModelFileTest.java new file mode 100644 index 000000000000..21eafc087a27 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ModelFileTest.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 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/v4/se/src/test/java/org/openapitools/server/model/ModelListTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ModelListTest.java new file mode 100644 index 000000000000..d073083d48a6 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ModelListTest.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 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/v4/se/src/test/java/org/openapitools/server/model/ModelReturnTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ModelReturnTest.java new file mode 100644 index 000000000000..d84cff2fdb06 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ModelReturnTest.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 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/v4/se/src/test/java/org/openapitools/server/model/NameTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/NameTest.java new file mode 100644 index 000000000000..ac557c71d0d8 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/NameTest.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.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/v4/se/src/test/java/org/openapitools/server/model/NullableClassTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/NullableClassTest.java new file mode 100644 index 000000000000..a33acb6dd853 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.java new file mode 100644 index 000000000000..8d154d78f6e3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/NumberOnlyTest.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 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/v4/se/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java new file mode 100644 index 000000000000..75417286d72b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/server/model/OrderTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OrderTest.java new file mode 100644 index 000000000000..8ac0b0fbdd00 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OrderTest.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.java new file mode 100644 index 000000000000..29769579ebfc --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OuterCompositeTest.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.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/v4/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java new file mode 100644 index 000000000000..79a4bb7cf334 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 000000000000..8b693a146618 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java new file mode 100644 index 000000000000..bfc747798376 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java new file mode 100644 index 000000000000..182b6b964185 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OuterEnumTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java new file mode 100644 index 000000000000..e06cefec2845 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.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.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +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/v4/se/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ParentWithNullableTest.java new file mode 100644 index 000000000000..466dc910f557 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ParentWithNullableTest.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.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import org.junit.jupiter.api.Test; + +/** + * Model tests for ParentWithNullable + */ +public class ParentWithNullableTest { + private final ParentWithNullable model = new ParentWithNullable(); + + /** + * Model tests for ParentWithNullable + */ + @Test + public void testParentWithNullable() { + // TODO: test ParentWithNullable + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'nullableProperty' + */ + @Test + public void nullablePropertyTest() { + // TODO: test nullableProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/PetTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/PetTest.java new file mode 100644 index 000000000000..0beb36cbe364 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/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.Arrays; +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/v4/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java new file mode 100644 index 000000000000..1cb2ad846425 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.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.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/v4/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java new file mode 100644 index 000000000000..a698b5ecb972 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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/v4/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java new file mode 100644 index 000000000000..45e482228aca --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/SpecialModelNameTest.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 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/v4/se/src/test/java/org/openapitools/server/model/TagTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/TagTest.java new file mode 100644 index 000000000000..ead74db6880b --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/TagTest.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.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/v4/se/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.java new file mode 100644 index 000000000000..55c3e0e12bb3 --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/TestInlineFreeformAdditionalPropertiesRequestTest.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 java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ +public class TestInlineFreeformAdditionalPropertiesRequestTest { + private final TestInlineFreeformAdditionalPropertiesRequest model = new TestInlineFreeformAdditionalPropertiesRequest(); + + /** + * Model tests for TestInlineFreeformAdditionalPropertiesRequest + */ + @Test + public void testTestInlineFreeformAdditionalPropertiesRequest() { + // TODO: test TestInlineFreeformAdditionalPropertiesRequest + } + + /** + * Test the property 'someProperty' + */ + @Test + public void somePropertyTest() { + // TODO: test someProperty + } + +} diff --git a/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/UserTest.java b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/UserTest.java new file mode 100644 index 000000000000..a9dbfb06dedd --- /dev/null +++ b/samples/server/petstore/java-helidon-server/v4/se/src/test/java/org/openapitools/server/model/UserTest.java @@ -0,0 +1,95 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This 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 + } + +}