diff --git a/README.md b/README.md index 1dcaa8b4d25..39bcb335064 100644 --- a/README.md +++ b/README.md @@ -343,20 +343,26 @@ cd /vagrant ### [1.7 - NPM](#table-of-contents) -There is also an [NPM package wrapper](https://github.com/HarmoWatch/openapi-generator-cli), available. -Please see the [docs](https://github.com/HarmoWatch/openapi-generator-cli) there for more information. +There is also an [NPM package wrapper](https://www.npmjs.com/package/@openapitools/openapi-generator-cli) available for different platforms (e.g. Linux, Mac, Windows). (JVM is still required) +Please see the [project's README](https://github.com/openapitools/openapi-generator-cli) there for more information. Install it globally to get the CLI available on the command line: ```sh -npm install @harmowatch/openapi-generator-cli -g +npm install @openapitools/openapi-generator-cli -g openapi-generator version ``` -Or you install it as dev-dependency like this: +Or install a particualar OpenAPI Generator version (e.g. v3.3.3): ```sh -npm install @harmowatch/openapi-generator-cli -D +npm install @openapitools/openapi-generator-cli@cli-3.3.3 -g +``` + +Or install it as dev-dependency: + +```sh +npm install @openapitools/openapi-generator-cli -D ``` ## [2 - Getting Started](#table-of-contents) @@ -476,6 +482,15 @@ Please refer to [integration.md](docs/integration.md) on how to integrate OpenAP ### [3.3 - Online OpenAPI generator](#table-of-contents) +Here are the public online services: + +- latest stable version: http://api.openapi-generator.tech +- latest master: http://api-latest-master.openapi-generator.tech (updated with latest master every hour) + +The server is sponsored by [Linode](https://www.linode.com/) [![Linode Logo](https://www.linode.com/media/images/logos/standard/light/linode-logo_standard_light_small.png)](https://www.linode.com/) + +(These services are beta and do not have any guarantee on service level) + Please refer to [online-openapi-generator.md](docs/online-openapi-generator.md) on how to run and use the `openapi-generator-online` - a web service for `openapi-generator`. ### [3.4 - License information on Generated Code](#table-of-contents) @@ -491,6 +506,7 @@ When code is generated from this project, it shall be considered **AS IS** and o Here are some companies/projects (alphabetical order) using OpenAPI Generator in production. To add your company/project to the list, please visit [README.md](README.md) and click on the icon to edit the page. - [Angular.Schule](https://angular.schule/) +- [b<>com](https://b-com.com/en) - [Bithost GmbH](https://www.bithost.ch) - [Boxever](https://www.boxever.com/) - [GMO Pepabo](https://pepabo.com/en/) @@ -518,7 +534,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2018/08/22 - [OpenAPI Generatorのプロジェクト構成などのメモ](https://yinm.info/20180822/) by [Yusuke Iinuma](https://github.com/yinm) - 2018/10/31 - [A node package wrapper for openapi-generator](https://github.com/HarmoWatch/openapi-generator-cli) - 2018/11/03 - [OpenAPI Generator + golang + Flutter でアプリ開発](http://ryuichi111std.hatenablog.com/entry/2018/11/03/214005) by [Ryuichi Daigo](https://github.com/ryuichi111) - +- 2018/11/19 - [OpenAPIs are everywhere](https://youtu.be/-lDot4Yn7Dg) by [Jeremie Bresson (Unblu)](https://github.com/jmini) at [EclipseCon Europe 2018](https://www.eclipsecon.org/europe2018) ## [6 - About Us](#table-of-contents) diff --git a/bin/openapi3/ruby-client-petstore.sh b/bin/openapi3/ruby-client-petstore.sh index a1daedaccbe..b01c768b30e 100755 --- a/bin/openapi3/ruby-client-petstore.sh +++ b/bin/openapi3/ruby-client-petstore.sh @@ -25,6 +25,11 @@ then mvn clean package fi +# purge lib/doc folder +echo "purge ruby petstore lib, docs folder" +rm -Rf samples/openapi3/client/petstore/ruby/lib +rm -Rf samples/openapi3/client/petstore/ruby/docs + # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/openapi3/client/petstore/ruby -DskipFormModel=true $@" diff --git a/bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.sh b/bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.sh index 856e56d1407..5c94e89b113 100755 --- a/bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.sh +++ b/bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test\resources/2_0/petstore.yaml -g typescript-angular -c bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.json -o samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm -D providedInRoot=false --additional-properties ngVersion=6.0.0 $@" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-angular -c bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.json -o samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm -D providedInRoot=false --additional-properties ngVersion=6.0.0 $@" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/typescript-angular-v6-petstore-not-provided-in-root.sh b/bin/typescript-angular-v6-petstore-not-provided-in-root.sh index c33a15d4b49..d2da8813fbf 100755 --- a/bin/typescript-angular-v6-petstore-not-provided-in-root.sh +++ b/bin/typescript-angular-v6-petstore-not-provided-in-root.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test\resources/2_0/petstore.yaml -g typescript-angular -o samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default -D providedInRoot=false --additional-properties ngVersion=6.0.0 $@" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-angular -o samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default -D providedInRoot=false --additional-properties ngVersion=6.0.0 $@" java $JAVA_OPTS -jar $executable $ags diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 91ebf5fc6a6..0aee9282c64 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -28,4 +28,9 @@ CONFIG OPTIONS for kotlin java8 - Java 8 native JSR310 threetenbp - Threetenbp + collectionType + Option. Collection type to use + array - kotlin.Array + list - kotlin.collections.List + Back to the [generators list](README.md) diff --git a/docs/generators/spring.md b/docs/generators/spring.md index e7d64807746..648064fd820 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -170,6 +170,9 @@ CONFIG OPTIONS for spring hateoas Use Spring HATEOAS library to allow adding HATEOAS links (Default: false) + returnSuccessCode + Generated server returns 2xx code (Default: false) + library library template (sub-template) to use (Default: spring-boot) spring-boot - Spring-boot Server application using the SpringFox integration. diff --git a/docs/online-openapi-generator.md b/docs/online-openapi-generator.md index 2780ca8dcdb..f41b6419a1a 100644 --- a/docs/online-openapi-generator.md +++ b/docs/online-openapi-generator.md @@ -1,8 +1,17 @@ ## Online OpenAPI generator -One can also generate API client or server using the online openapi-generator. +One can also generate API clients or server stubs using the online openapi-generator. -Here are the steps to run it locally: +Here are the public online services: + +- latest stable version: http://api.openapi-generator.tech +- latest master: http://api-latest-master.openapi-generator.tech (updated with latest master every hour) + +The server is sponsored by [Linode](https://www.linode.com/) [![Linode Logo](https://www.linode.com/media/images/logos/standard/light/linode-logo_standard_light_small.png)](https://www.linode.com/) + +(These services are beta and do not have any guarantee on service level) + +If you prefer to run the service locally, here are the steps: ``` mvn clean install cd modules/openapi-generator-online diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java index a19dcf06c9e..17dc1e54c68 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java @@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory; import static org.openapitools.codegen.config.CodegenConfiguratorUtils.*; import static org.apache.commons.lang3.StringUtils.isNotEmpty; +import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.stream.Stream; @@ -246,6 +247,11 @@ public class Generate implements Runnable { } if (isNotEmpty(spec)) { + if (!spec.matches("^http(s)?://.*") && !new File(spec).exists()) { + System.err.println("[error] The spec file is not found: " + spec); + System.err.println("[error] Check the path of the OpenAPI spec and try again."); + System.exit(1); + } configurator.setInputSpec(spec); } diff --git a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java index 39bb0df7eb4..dea73a301ef 100644 --- a/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java +++ b/modules/openapi-generator-cli/src/test/java/org/openapitools/codegen/cmd/GenerateTest.java @@ -64,7 +64,7 @@ public class GenerateTest { @Test public void testRequiredArgs_ShortArgs() throws Exception { - setupAndRunTest("-i", "swagger.yaml", "-g", "java", "-o", "src/main/java", false, null); + setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", false, null); new FullVerifications() { { } @@ -73,7 +73,7 @@ public class GenerateTest { @Test public void testRequiredArgs_LongArgs() throws Exception { - setupAndRunTest("--input-spec", "swagger.yaml", "--generator-name", "java", "--output", + setupAndRunTest("--input-spec", "src/test/resources/swagger.yaml", "--generator-name", "java", "--output", "src/main/java", false, null); new FullVerifications() { { @@ -220,7 +220,7 @@ public class GenerateTest { @Test public void testConfig() throws Exception { - setupAndRunTest("-i", "swagger.yaml", "-g", "java", "-o", "src/main/java", true, + setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", true, "config.json", "-c", "config.json"); new FullVerifications() { @@ -228,7 +228,7 @@ public class GenerateTest { } }; - setupAndRunTest("-i", "swagger.yaml", "-g", "java", "-o", "src/main/java", true, + setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", true, "config.json", "--config", "config.json"); new FullVerifications() { @@ -570,7 +570,7 @@ public class GenerateTest { } private void setupAndRunGenericTest(String... additionalParameters) { - setupAndRunTest("-i", "swagger.yaml", "-g", "java", "-o", "src/main/java", false, null, + setupAndRunTest("-i", "src/test/resources/swagger.yaml", "-g", "java", "-o", "src/main/java", false, null, additionalParameters); } } diff --git a/modules/openapi-generator-cli/src/test/resources/swagger.yaml b/modules/openapi-generator-cli/src/test/resources/swagger.yaml new file mode 100644 index 00000000000..f92e3e60184 --- /dev/null +++ b/modules/openapi-generator-cli/src/test/resources/swagger.yaml @@ -0,0 +1,109 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Swagger Petstore + license: + name: MIT +servers: + - url: http://petstore.swagger.io/v1 +paths: + /pets: + get: + summary: List all pets + operationId: listPets + tags: + - pets + parameters: + - name: limit + in: query + description: How many items to return at one time (max 100) + required: false + schema: + type: integer + format: int32 + responses: + '200': + description: A paged array of pets + headers: + x-next: + description: A link to the next page of responses + schema: + type: string + content: + application/json: + schema: + $ref: "#/components/schemas/Pets" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + summary: Create a pet + operationId: createPets + tags: + - pets + responses: + '201': + description: Null response + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /pets/{petId}: + get: + summary: Info for a specific pet + operationId: showPetById + tags: + - pets + parameters: + - name: petId + in: path + required: true + description: The id of the pet to retrieve + schema: + type: string + responses: + '200': + description: Expected response to a valid request + content: + application/json: + schema: + $ref: "#/components/schemas/Pets" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" +components: + schemas: + Pet: + required: + - id + - name + properties: + id: + type: integer + format: int64 + name: + type: string + tag: + type: string + Pets: + type: array + items: + $ref: "#/components/schemas/Pet" + Error: + required: + - code + - message + properties: + code: + type: integer + format: int32 + message: + type: string \ No newline at end of file diff --git a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java index 2c213bb4a89..ce04ac29349 100644 --- a/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java +++ b/modules/openapi-generator-maven-plugin/src/main/java/org/openapitools/codegen/plugin/CodeGenMojo.java @@ -56,6 +56,10 @@ import org.sonatype.plexus.build.incremental.DefaultBuildContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.google.common.base.Charsets; +import com.google.common.hash.Hashing; +import com.google.common.io.Files; + /** * Goal which generates client/server code from a OpenAPI json/yaml definition. */ @@ -317,6 +321,12 @@ public class CodeGenMojo extends AbstractMojo { @Parameter(name = "skip", property = "codegen.skip", required = false, defaultValue = "false") private Boolean skip; + /** + * Skip the execution if the source file is older than the output folder. + */ + @Parameter(name = "skipIfSpecIsUnchanged", property = "codegen.skipIfSpecIsUnchanged", required = false, defaultValue = "false") + private Boolean skipIfSpecIsUnchanged; + /** * Add the output directory to the project as a source root, so that the generated java types * are compiled and included in the project artifact. @@ -368,6 +378,21 @@ public class CodeGenMojo extends AbstractMojo { } } + if (skipIfSpecIsUnchanged) { + if (inputSpecFile.exists()) { + File storedInputSpecHashFile = getHashFile(inputSpecFile); + if(storedInputSpecHashFile.exists()) { + String inputSpecHash = Files.asByteSource(inputSpecFile).hash(Hashing.sha256()).toString(); + String storedInputSpecHash = Files.asCharSource(storedInputSpecHashFile, Charsets.UTF_8).read(); + if (inputSpecHash.equals(storedInputSpecHash)) { + getLog().info( + "Code generation is skipped because input was unchanged"); + return; + } + } + } + } + // attempt to read from config file CodegenConfigurator configurator = CodegenConfigurator.fromFile(configurationFile); @@ -606,6 +631,17 @@ public class CodeGenMojo extends AbstractMojo { if (buildContext != null) { buildContext.refresh(new File(getCompileSourceRoot())); } + + // Store a checksum of the input spec + File storedInputSpecHashFile = getHashFile(inputSpecFile); + String inputSpecHash = Files.asByteSource(inputSpecFile).hash(Hashing.sha256()).toString(); + + if (storedInputSpecHashFile.getParent() != null && !new File(storedInputSpecHashFile.getParent()).exists()) { + File parent = new File(storedInputSpecHashFile.getParent()); + parent.mkdirs(); + } + Files.asCharSink(storedInputSpecHashFile, Charsets.UTF_8).write(inputSpecHash); + } catch (Exception e) { // Maven logs exceptions thrown by plugins only if invoked with -e // I find it annoying to jump through hoops to get basic diagnostic information, @@ -618,7 +654,11 @@ public class CodeGenMojo extends AbstractMojo { "Code generation failed. See above for the full exception."); } } - + + private File getHashFile(File inputSpecFile) { + return new File(output.getPath() + File.separator + ".openapi-generator" + File.separator + inputSpecFile.getName() + ".sha256"); + } + private String getCompileSourceRoot() { final Object sourceFolderObject = configOptions == null ? null : configOptions @@ -647,10 +687,10 @@ public class CodeGenMojo extends AbstractMojo { } } /** - * This method enables conversion of true/false strings in + * This method enables conversion of true/false strings in * config.additionalProperties (configuration/configOptions) to proper booleans. * This enables mustache files to handle the properties better. - * + * * @param config */ private void adjustAdditionalProperties(final CodegenConfig config) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java index 275d12205bc..261614814cd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConfig.java @@ -27,6 +27,7 @@ import io.swagger.v3.oas.models.servers.Server; import io.swagger.v3.oas.models.servers.ServerVariable; import java.io.File; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -261,4 +262,9 @@ public interface CodegenConfig { public void setEnablePostProcessFile(boolean isEnablePostProcessFile); + // set OpenAPI and schemas + public void setGlobalOpenAPI(OpenAPI openAPI); + + public void setGlobalSchemas(OpenAPI openAPI); + } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index e8a4cc5f9bb..2462a1418f6 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -137,6 +137,9 @@ public class DefaultCodegen implements CodegenConfig { // flag to indicate whether to use environment variable to post process file protected boolean enablePostProcessFile = false; + // make openapi and schemas available to all methods + protected OpenAPI globalOpenAPI; + protected Map globalSchemas; public List cliOptions() { return cliOptions; @@ -383,6 +386,32 @@ public class DefaultCodegen implements CodegenConfig { } } + + /** + * Set global OpenAPI based on OpenAPI object + * + * @param openAPI OpenAPI object + */ + public void setGlobalOpenAPI(OpenAPI openAPI) { + this.globalOpenAPI = openAPI; + } + + + /** + * Set global schema based on OpenAPI object + * + * @param openAPI OpenAPI object + */ + public void setGlobalSchemas(OpenAPI openAPI) { + if (openAPI != null && openAPI.getComponents() != null) { + this.globalSchemas = openAPI.getComponents().getSchemas(); + } + + if (this.globalSchemas == null) { // initalize with empty map if it's null + this.globalSchemas = new HashMap(); + } + } + // override with any special post-processing @SuppressWarnings("static-method") public Map postProcessOperations(Map objs) { @@ -1762,6 +1791,7 @@ public class DefaultCodegen implements CodegenConfig { return org.openapitools.codegen.utils.StringUtils.camelize(toVarName(name)); } + /** * Convert OAS Property object to Codegen Property object * @@ -1775,6 +1805,10 @@ public class DefaultCodegen implements CodegenConfig { return null; } LOGGER.debug("debugging fromProperty for " + name + " : " + p); + + // unalias schema + p = ModelUtils.unaliasSchema(globalSchemas, p); + CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY); property.name = toVarName(name); property.baseName = name; @@ -2003,7 +2037,8 @@ public class DefaultCodegen implements CodegenConfig { if (itemName == null) { itemName = property.name; } - CodegenProperty cp = fromProperty(itemName, ((ArraySchema) p).getItems()); + Schema innerSchema = ModelUtils.unaliasSchema(globalSchemas, ((ArraySchema) p).getItems()); + CodegenProperty cp = fromProperty(itemName, innerSchema); updatePropertyForArray(property, cp); } else if (ModelUtils.isMapSchema(p)) { property.isContainer = true; @@ -2014,7 +2049,8 @@ public class DefaultCodegen implements CodegenConfig { property.maxItems = p.getMaxProperties(); // handle inner property - CodegenProperty cp = fromProperty("inner", ModelUtils.getAdditionalProperties(p)); + Schema innerSchema = ModelUtils.unaliasSchema(globalSchemas, ModelUtils.getAdditionalProperties(p)); + CodegenProperty cp = fromProperty("inner", innerSchema); updatePropertyForMap(property, cp); } else if (ModelUtils.isFreeFormObject(p)) { property.isFreeFormObject = true; @@ -2308,10 +2344,8 @@ public class DefaultCodegen implements CodegenConfig { op.responses.get(op.responses.size() - 1).hasMore = false; if (methodResponse != null) { - Schema responseSchema = ModelUtils.getSchemaFromResponse(methodResponse); - if (openAPI != null && openAPI.getComponents() != null) { // has models/aliases defined - responseSchema = ModelUtils.unaliasSchema(openAPI.getComponents().getSchemas(), responseSchema); - } + Schema responseSchema = ModelUtils.unaliasSchema(globalSchemas, ModelUtils.getSchemaFromResponse(methodResponse)); + if (responseSchema != null) { CodegenProperty cm = fromProperty("response", responseSchema); @@ -2331,7 +2365,13 @@ public class DefaultCodegen implements CodegenConfig { } // generate examples - op.examples = new ExampleGenerator(schemas, openAPI).generateFromResponseSchema(responseSchema, getProducesInfo(openAPI, operation)); + String exampleStatusCode = "200"; + for (String key : operation.getResponses().keySet()) { + if (operation.getResponses().get(key) == methodResponse && !key.equals("default")) { + exampleStatusCode = key; + } + } + op.examples = new ExampleGenerator(schemas, openAPI).generateFromResponseSchema(exampleStatusCode, responseSchema, getProducesInfo(openAPI, operation)); op.defaultResponse = toDefaultValue(responseSchema); op.returnType = cm.dataType; op.hasReference = schemas != null && schemas.containsKey(op.returnBaseType); @@ -2559,7 +2599,12 @@ public class DefaultCodegen implements CodegenConfig { } else { r.code = responseCode; } - final Schema responseSchema = ModelUtils.getSchemaFromResponse(response); + Schema responseSchema; + if (openAPI != null && openAPI.getComponents() != null) { + responseSchema = ModelUtils.unaliasSchema(openAPI.getComponents().getSchemas(), ModelUtils.getSchemaFromResponse(response)); + } else { // no model/alias defined + responseSchema = ModelUtils.getSchemaFromResponse(response); + } r.schema = responseSchema; r.message = escapeText(response.getDescription()); // TODO need to revise and test examples in responses @@ -2573,6 +2618,7 @@ public class DefaultCodegen implements CodegenConfig { r.hasHeaders = !r.headers.isEmpty(); if (r.schema != null) { + Map allSchemas = null; CodegenProperty cp = fromProperty("response", responseSchema); if (ModelUtils.isArraySchema(responseSchema)) { @@ -3209,6 +3255,7 @@ public class DefaultCodegen implements CodegenConfig { String description = headers.getValue().getDescription(); // follow the $ref Header header = ModelUtils.getReferencedHeader(openAPI, headers.getValue()); + CodegenProperty cp = fromProperty(headers.getKey(), header.getSchema()); cp.setDescription(escapeText(description)); cp.setUnescapedDescription(description); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java index d97fac919b7..1ffa43cc145 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultGenerator.java @@ -38,7 +38,6 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.ignore.CodegenIgnoreProcessor; -//import org.openapitools.codegen.languages.AbstractJavaCodegen; import org.openapitools.codegen.utils.ImplementationVersion; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.URLPathUtils; @@ -181,6 +180,11 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { config.processOpts(); config.preprocessOpenAPI(openAPI); + + // set OpenAPI and schemas to make these available to all methods + config.setGlobalOpenAPI(openAPI); + config.setGlobalSchemas(openAPI); + config.additionalProperties().put("generatorVersion", ImplementationVersion.read()); config.additionalProperties().put("generatedDate", ZonedDateTime.now().toString()); config.additionalProperties().put("generatedYear", String.valueOf(ZonedDateTime.now().getYear())); @@ -424,6 +428,25 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { } Schema schema = schemas.get(name); + + // check to see if it's a "map" model + if (ModelUtils.isMapSchema(schema)) { + if (schema.getProperties() == null || schema.getProperties().isEmpty()) { + // schema without property, i.e. alias to map + LOGGER.info("Model " + name + " not generated since it's an alias to map (without property)"); + continue; + } + } + + // check to see if it's an "array" model + if (ModelUtils.isArraySchema(schema)) { + if (schema.getProperties() == null || schema.getProperties().isEmpty()) { + // schema without property, i.e. alias to array + LOGGER.info("Model " + name + " not generated since it's an alias to array (without property)"); + continue; + } + } + Map schemaMap = new HashMap<>(); schemaMap.put(name, schema); Map models = processModels(config, schemaMap, schemas); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java index 47552634f4f..2e011918491 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/examples/ExampleGenerator.java @@ -42,6 +42,7 @@ public class ExampleGenerator { private static final String NONE = "none"; private static final String URL = "url"; private static final String URI = "uri"; + private static final String STATUS_CODE = "statusCode"; protected Map examples; private OpenAPI openAPI; @@ -54,7 +55,20 @@ public class ExampleGenerator { this.random = new Random("ExampleGenerator".hashCode()); } - public List> generateFromResponseSchema(Schema responseSchema, Set producesInfo) { + public List> generateFromResponseSchema(String statusCode, Schema responseSchema, Set producesInfo) { + List> examples = generateFromResponseSchema(responseSchema, producesInfo); + if (examples == null) { + return null; + } + + for (Map example : examples) { + example.put(STATUS_CODE, statusCode); + } + + return examples; + } + + private List> generateFromResponseSchema(Schema responseSchema, Set producesInfo) { if (responseSchema.getExample() == null && StringUtils.isEmpty(responseSchema.get$ref()) && !ModelUtils.isArraySchema(responseSchema)) { // no example provided return null; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java index 754d825016b..7b32b989bd7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractRubyCodegen.java @@ -147,20 +147,7 @@ abstract class AbstractRubyCodegen extends DefaultCodegen implements CodegenConf } public String toRegularExpression(String pattern) { - if (StringUtils.isEmpty(pattern)) { - return pattern; - } - - // We don't escape \ in string since Ruby doesn't like \ escaped in regex literal - String regexString = pattern; - if (!regexString.startsWith("/")) { - regexString = "/" + regexString; - } - if (StringUtils.countMatches(regexString, '/') == 1) { - // we only have forward slash inserted at start... adding one to end - regexString = regexString + "/"; - } - return regexString; + return addRegularExpressionDelimiter(pattern); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java index e9b8783f072..51d5f672899 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ElixirClientCodegen.java @@ -654,6 +654,9 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig sb.append(param.dataType); } else if (param.isFile || param.isBinary) { sb.append("String.t"); + } else if ("String.t".equals(param.dataType)) { + // uuid, password, etc + sb.append(param.dataType); } else { // .Model..t sb.append(moduleName); @@ -693,6 +696,8 @@ public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig // Primitive return type, don't even try to decode if (returnBaseType == null || (returnSimpleType && returnTypeIsPrimitive)) { return "false"; + } else if (isListContainer && languageSpecificPrimitives().contains(returnBaseType)) { + return "[]"; } StringBuilder sb = new StringBuilder(); if (isListContainer) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 673ca163714..85ac703ef54 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -31,9 +31,11 @@ import java.util.Map; public class KotlinClientCodegen extends AbstractKotlinCodegen { public static final String DATE_LIBRARY = "dateLibrary"; + public static final String COLLECTION_TYPE = "collectionType"; private static final Logger LOGGER = LoggerFactory.getLogger(KotlinClientCodegen.class); protected String dateLibrary = DateLibrary.JAVA8.value; + protected String collectionType = CollectionType.ARRAY.value; public enum DateLibrary { STRING("string"), @@ -47,6 +49,17 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { } } + public enum CollectionType { + ARRAY("array"), + LIST("list"); + + public final String value; + + CollectionType(String value) { + this.value = value; + } + } + /** * Constructs an instance of `KotlinClientCodegen`. */ @@ -74,6 +87,13 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { dateOptions.put(DateLibrary.JAVA8.value, "Java 8 native JSR310"); dateLibrary.setEnum(dateOptions); cliOptions.add(dateLibrary); + + CliOption collectionType = new CliOption(COLLECTION_TYPE, "Option. Collection type to use"); + Map collectionOptions = new HashMap<>(); + collectionOptions.put(CollectionType.ARRAY.value, "kotlin.Array"); + collectionOptions.put(CollectionType.LIST.value, "kotlin.collections.List"); + collectionType.setEnum(collectionOptions); + cliOptions.add(collectionType); } public CodegenType getTag() { @@ -92,6 +112,10 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { this.dateLibrary = library; } + public void setCollectionType(String collectionType) { + this.collectionType = collectionType; + } + @Override public void processOpts() { super.processOpts(); @@ -116,6 +140,15 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { additionalProperties.put(DateLibrary.JAVA8.value, true); } + if (additionalProperties.containsKey(COLLECTION_TYPE)) { + setCollectionType(additionalProperties.get(COLLECTION_TYPE).toString()); + } + + if (CollectionType.LIST.value.equals(collectionType)) { + typeMapping.put("array", "kotlin.collections.List"); + typeMapping.put("list", "kotlin.collections.List"); + } + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("build.gradle.mustache", "", "build.gradle")); supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 719c4a47042..9865d665c2d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -77,6 +77,7 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String OPENAPI_DOCKET_CONFIG = "swaggerDocketConfig"; public static final String API_FIRST = "apiFirst"; public static final String HATEOAS = "hateoas"; + public static final String RETURN_SUCCESS_CODE = "returnSuccessCode"; protected String title = "OpenAPI Spring"; protected String configPackage = "org.openapitools.configuration"; @@ -98,6 +99,7 @@ public class SpringCodegen extends AbstractJavaCodegen protected boolean useOptional = false; protected boolean virtualService = false; protected boolean hateoas = false; + protected boolean returnSuccessCode = false; public SpringCodegen() { super(); @@ -131,6 +133,7 @@ public class SpringCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(API_FIRST, "Generate the API from the OAI spec at server compile time (API first approach)", apiFirst)); cliOptions.add(CliOption.newBoolean(USE_OPTIONAL,"Use Optional container for optional parameters", useOptional)); cliOptions.add(CliOption.newBoolean(HATEOAS, "Use Spring HATEOAS library to allow adding HATEOAS links", hateoas)); + cliOptions.add(CliOption.newBoolean(RETURN_SUCCESS_CODE, "Generated server returns 2xx code", returnSuccessCode)); supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application using the SpringFox integration."); supportedLibraries.put(SPRING_MVC_LIBRARY, "Spring-MVC Server application using the SpringFox integration."); @@ -277,6 +280,10 @@ public class SpringCodegen extends AbstractJavaCodegen this.setHateoas(Boolean.valueOf(additionalProperties.get(HATEOAS).toString())); } + if (additionalProperties.containsKey(RETURN_SUCCESS_CODE)) { + this.setReturnSuccessCode(Boolean.valueOf(additionalProperties.get(RETURN_SUCCESS_CODE).toString())); + } + typeMapping.put("file", "Resource"); importMapping.put("Resource", "org.springframework.core.io.Resource"); @@ -721,6 +728,10 @@ public class SpringCodegen extends AbstractJavaCodegen this.hateoas = hateoas; } + public void setReturnSuccessCode(boolean returnSuccessCode) { + this.returnSuccessCode = returnSuccessCode; + } + @Override public void postProcessModelProperty(CodegenModel model, CodegenProperty property) { super.postProcessModelProperty(model, property); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index 6f495304fcc..86edabc9707 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -771,22 +771,15 @@ public class ModelUtils { return schema; } else if (isFreeFormObject(ref)) { return schema; - } else if (isArraySchema(ref) || isComposedSchema(ref)) { // array def should be created as models + } else if (isArraySchema(ref)) { + return unaliasSchema(allSchemas, allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); + } else if (isComposedSchema(ref)) { return schema; } else if (isMapSchema(ref)) { if (ref.getProperties() != null && !ref.getProperties().isEmpty()) // has properties return schema; // treat it as model else { // treat it as a typical map - /* TODO unalias the map item if it's an alias - if (ref.getAdditionalProperties() != null) { - - Schema innerSchema = (Schema) ref.getAdditionalProperties(); - if (StringUtils.isNotEmpty(innerSchema.get$ref())) { // map item is a ref to something else - //Schema unaliasInnerSchema = unaliasSchema(allSchemas, allSchemas.get(ModelUtils.getSimpleRef(innerSchema.get$ref()))); - //ref.setAdditionalProperties(unaliasInnerSchema); - } - }*/ return unaliasSchema(allSchemas, allSchemas.get(ModelUtils.getSimpleRef(schema.get$ref()))); } } else if (isObjectSchema(ref)) { // model diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache new file mode 100644 index 00000000000..441a7849436 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache @@ -0,0 +1,169 @@ +# {{artifactId}} + +{{appName}} +- API version: {{appVersion}} +{{^hideGenerationTimestamp}} + - Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} + +{{#appDescription}}{{{appDescription}}}{{/appDescription}} + +{{#infoUrl}} + For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + + +## Requirements + +Building the API client library requires: +1. Java {{#supportJava6}}1.6{{/supportJava6}}{{^supportJava6}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/supportJava6}}+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + {{{groupId}}} + {{{artifactId}}} + {{{artifactVersion}}} + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "{{{groupId}}}:{{{artifactId}}}:{{{artifactVersion}}}" +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/{{{artifactId}}}-{{{artifactVersion}}}.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java +{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} +import {{{invokerPackage}}}.*; +import {{{invokerPackage}}}.auth.*; +import {{{modelPackage}}}.*; +import {{{package}}}.{{{classname}}}; + +import java.io.File; +import java.util.*; + +public class {{{classname}}}Example { + + public static void main(String[] args) { + {{#hasAuthMethods}}ApiClient defaultClient = Configuration.getDefaultApiClient(); + {{#authMethods}}{{#isBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}){{#optionalParams}} + .{{{paramName}}}({{{paramName}}}){{/optionalParams}} + .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} + System.out.println(result);{{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + e.printStackTrace(); + } + } +} +{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation for Models + +{{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) +{{/model}}{{/models}} + +## Documentation for Authorization + +{{^authMethods}}All endpoints do not require authorization. +{{/authMethods}}Authentication schemes defined for the API: +{{#authMethods}}### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}}- **Type**: HTTP basic authentication +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + +{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} +{{/hasMore}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index affaec014b9..16384f1fd39 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -63,7 +63,7 @@ public class {{classname}} { } {{#operation}} - /** + {{^vendorExtensions.x-group-parameters}}/** * Build call for {{operationId}}{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} * @param progressListener Progress listener @@ -81,7 +81,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public com.squareup.okhttp.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} com.squareup.okhttp.Call {{operationId}}Call({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object {{localVariablePrefix}}localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}new Object(){{/bodyParam}}; // create path and map variables @@ -185,6 +185,7 @@ public class {{classname}} { {{/performBeanValidation}} } + {{^vendorExtensions.x-group-parameters}} /** * {{summary}} * {{notes}}{{#allParams}} @@ -206,8 +207,9 @@ public class {{classname}} { {{#returnType}}ApiResponse<{{{returnType}}}> {{localVariablePrefix}}resp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} return {{localVariablePrefix}}resp.getData();{{/returnType}} } + {{/vendorExtensions.x-group-parameters}} - /** + {{^vendorExtensions.x-group-parameters}}/** * {{summary}} * {{notes}}{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} @@ -224,13 +226,13 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { com.squareup.okhttp.Call {{localVariablePrefix}}call = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null, null); {{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType);{{/returnType}}{{^returnType}}return {{localVariablePrefix}}apiClient.execute({{localVariablePrefix}}call);{{/returnType}} } - /** + {{^vendorExtensions.x-group-parameters}}/** * {{summary}} (asynchronously) * {{notes}}{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} @@ -248,7 +250,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public com.squareup.okhttp.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{localVariablePrefix}}callback) throws ApiException { + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} com.squareup.okhttp.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{localVariablePrefix}}callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -274,6 +276,119 @@ public class {{classname}} { {{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType, {{localVariablePrefix}}callback);{{/returnType}}{{^returnType}}{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}callback);{{/returnType}} return {{localVariablePrefix}}call; } + {{#vendorExtensions.x-group-parameters}} + + public class API{{operationId}}Request { + {{#requiredParams}} + private final {{{dataType}}} {{localVariablePrefix}}{{paramName}}; + {{/requiredParams}} + {{#optionalParams}} + private {{{dataType}}} {{localVariablePrefix}}{{paramName}}; + {{/optionalParams}} + + private API{{operationId}}Request({{#requiredParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}) { + {{#requiredParams}} + this.{{localVariablePrefix}}{{paramName}} = {{paramName}}; + {{/requiredParams}} + } + + {{#optionalParams}} + /** + * Set {{paramName}} + * @param {{paramName}} {{description}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}) + * @return API{{operationId}}Request + */ + public API{{operationId}}Request {{paramName}}({{{dataType}}} {{paramName}}) { + this.{{localVariablePrefix}}{{paramName}} = {{paramName}}; + return this; + } + + {{/optionalParams}} + /** + * Build call for {{operationId}} + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public com.squareup.okhttp.Call buildCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + return {{operationId}}Call({{#allParams}}{{localVariablePrefix}}{{paramName}}, {{/allParams}}progressListener, progressRequestListener); + } + + /** + * Execute {{operationId}} request{{#returnType}} + * @return {{returnType}}{{/returnType}} + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} execute() throws ApiException { + {{#returnType}}ApiResponse<{{{returnType}}}> {{localVariablePrefix}}resp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{#returnType}} + return {{localVariablePrefix}}resp.getData();{{/returnType}} + } + + /** + * Execute {{operationId}} request with HTTP info returned + * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { + return {{operationId}}WithHttpInfo({{#allParams}}{{localVariablePrefix}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + } + + /** + * Execute {{operationId}} request (asynchronously) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public com.squareup.okhttp.Call executeAsync(final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> callback) throws ApiException { + return {{operationId}}Async({{#allParams}}{{localVariablePrefix}}{{paramName}}, {{/allParams}}callback); + } + } + + /** + * {{summary}} + * {{notes}}{{#requiredParams}} + * @param {{paramName}} {{description}} (required){{/requiredParams}} + * @return API{{operationId}}Request + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public API{{operationId}}Request {{operationId}}({{#requiredParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}) { + return new API{{operationId}}Request({{#requiredParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}); + } + {{/vendorExtensions.x-group-parameters}} {{/operation}} } {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_doc.mustache new file mode 100644 index 00000000000..1292eb3aa84 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_doc.mustache @@ -0,0 +1,85 @@ +# {{classname}}{{#description}} +{{description}}{{/description}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +# **{{operationId}}**{{^vendorExtensions.x-group-parameters}} +> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} +> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} + +{{summary}}{{#notes}} + +{{notes}}{{/notes}} + +### Example +```java +// Import classes:{{#hasAuthMethods}} +//import {{{invokerPackage}}}.ApiClient;{{/hasAuthMethods}} +//import {{{invokerPackage}}}.ApiException;{{#hasAuthMethods}} +//import {{{invokerPackage}}}.Configuration; +//import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} +//import {{{package}}}.{{{classname}}}; + +{{#hasAuthMethods}} +ApiClient defaultClient = Configuration.getDefaultApiClient(); +{{#authMethods}}{{#isBasic}} +// Configure HTTP basic authorization: {{{name}}} +HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); +{{{name}}}.setUsername("YOUR USERNAME"); +{{{name}}}.setPassword("YOUR PASSWORD");{{/isBasic}}{{#isApiKey}} +// Configure API key authorization: {{{name}}} +ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); +{{{name}}}.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} +// Configure OAuth2 access token for authorization: {{{name}}} +OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); +{{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} +{{/authMethods}} +{{/hasAuthMethods}} + +{{{classname}}} apiInstance = new {{{classname}}}(); +{{#allParams}} +{{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} +{{/allParams}} +try { + {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}){{#optionalParams}} + .{{{paramName}}}({{{paramName}}}){{/optionalParams}} + .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} + System.out.println(result);{{/returnType}} +} catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + e.printStackTrace(); +} +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache new file mode 100644 index 00000000000..b5693776b59 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache @@ -0,0 +1,47 @@ +{{>licenseInfo}} + +package {{package}}; + +import {{invokerPackage}}.ApiException; +{{#imports}}import {{import}}; +{{/imports}} +import org.junit.Test; +import org.junit.Ignore; + +{{^fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{/fullJavaUtil}} + +/** + * API tests for {{classname}} + */ +@Ignore +public class {{classname}}Test { + + private final {{classname}} api = new {{classname}}(); + + {{#operations}}{{#operation}} + /** + * {{summary}} + * + * {{notes}} + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void {{operationId}}Test() throws ApiException { + {{#allParams}} + {{{dataType}}} {{paramName}} = null; + {{/allParams}} + {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/requiredParams}}){{#optionalParams}} + .{{paramName}}({{paramName}}){{/optionalParams}} + .execute();{{/vendorExtensions.x-group-parameters}} + + // TODO: test validations + } + {{/operation}}{{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache index 8597a7419ca..40b041331ce 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/methodBody.mustache @@ -16,7 +16,7 @@ return CompletableFuture.supplyAsync(()-> { {{#jdk8}} {{#async}} {{/async}} }); {{/jdk8}} -{{#async}} {{/async}} return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); +{{#async}} {{/async}} return new ResponseEntity<>({{#returnSuccessCode}}HttpStatus.valueOf({{{statusCode}}}){{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}); {{#jdk8}} {{#async}} }, Runnable::run); @@ -25,14 +25,14 @@ return CompletableFuture.supplyAsync(()-> { {{/-last}} {{/examples}} {{^examples}} -return {{#jdk8}}{{#async}}CompletableFuture.completedFuture({{/async}}{{/jdk8}}new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED){{#jdk8}}{{#async}}){{/async}}{{/jdk8}}; +return {{#jdk8}}{{#async}}CompletableFuture.completedFuture({{/async}}{{/jdk8}}new ResponseEntity<>({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}){{#jdk8}}{{#async}}){{/async}}{{/jdk8}}; {{/examples}} {{/reactive}} {{#reactive}} -exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - Mono result = Mono.empty(); +Mono result = Mono.empty(); {{#examples}} {{#-first}} + exchange.getResponse().setStatusCode({{#returnSuccessCode}}HttpStatus.valueOf({{{statusCode}}}){{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { {{/-first}} if (mediaType.isCompatibleWith(MediaType.valueOf("{{{contentType}}}"))) { @@ -43,5 +43,8 @@ exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); } {{/-last}} {{/examples}} +{{^examples}} + exchange.getResponse().setStatusCode({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}}); +{{/examples}} return result.then(Mono.empty()); {{/reactive}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/elixir/api.mustache b/modules/openapi-generator/src/main/resources/elixir/api.mustache index 48bb292aae1..43f465f3900 100644 --- a/modules/openapi-generator/src/main/resources/elixir/api.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/api.mustache @@ -49,7 +49,7 @@ defmodule {{moduleName}}.Api.{{classname}} do |> url("{{replacedPathName}}") {{#requiredParams}} {{^isPathParam}} - |> add_param({{#isBodyParam}}:body{{/isBodyParam}}{{#isFormParam}}{{#isMultipart}}{{#isFile}}:file{{/isFile}}{{^isFile}}:form{{/isFile}}{{/isMultipart}}{{^isMultipart}}:form{{/isMultipart}}{{/isFormParam}}{{#isQueryParam}}:query{{/isQueryParam}}{{#isHeaderParam}}:headers{{/isHeaderParam}}, :"{{baseName}}", {{#underscored}}{{paramName}}{{/underscored}}) + |> add_param({{#isBodyParam}}:body{{/isBodyParam}}{{#isFormParam}}{{#isMultipart}}{{#isFile}}:file{{/isFile}}{{^isFile}}:form{{/isFile}}{{/isMultipart}}{{^isMultipart}}:form{{/isMultipart}}{{/isFormParam}}{{#isQueryParam}}:query{{/isQueryParam}}{{#isHeaderParam}}:headers{{/isHeaderParam}}, {{#isBodyParam}}:body, {{/isBodyParam}}{{^isBodyParam}}:"{{baseName}}", {{/isBodyParam}}{{#underscored}}{{paramName}}{{/underscored}}) {{/isPathParam}} {{/requiredParams}} {{#optionalParams}} diff --git a/modules/openapi-generator/src/main/resources/elixir/model.mustache b/modules/openapi-generator/src/main/resources/elixir/model.mustache index 20bcfbdce9c..98c01f9096d 100644 --- a/modules/openapi-generator/src/main/resources/elixir/model.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/model.mustache @@ -11,7 +11,7 @@ ] @type t :: %__MODULE__{ - {{#vars}}:"{{baseName}}" => {{{dataType}}}{{#hasMore}}, + {{#vars}}:"{{baseName}}" => {{{datatype}}}{{#isNullable}} | nil{{/isNullable}}{{^isNullable}}{{^required}} | nil{{/required}}{{/isNullable}}{{#hasMore}}, {{/hasMore}}{{/vars}} } end diff --git a/modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache b/modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache index 191832e9bdb..10afaba4ce5 100644 --- a/modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/request_builder.ex.mustache @@ -85,6 +85,10 @@ defmodule {{moduleName}}.RequestBuilder do |> Map.put_new_lazy(:body, &Tesla.Multipart.new/0) |> Map.update!(:body, &(Tesla.Multipart.add_field(&1, key, Poison.encode!(value), headers: [{:"Content-Type", "application/json"}]))) end + def add_param(request, :headers, key, value) do + request + |> Map.update(:headers, %{key => value}, &(Map.put(&1, key, value))) + end def add_param(request, :file, name, path) do request |> Map.put_new_lazy(:body, &Tesla.Multipart.new/0) diff --git a/modules/openapi-generator/src/main/resources/php/README.mustache b/modules/openapi-generator/src/main/resources/php/README.mustache index 4771537651b..a617b0547e0 100644 --- a/modules/openapi-generator/src/main/resources/php/README.mustache +++ b/modules/openapi-generator/src/main/resources/php/README.mustache @@ -30,7 +30,7 @@ To install the bindings via [Composer](http://getcomposer.org/), add the followi { "repositories": [ { - "type": "git", + "type": "vcs", "url": "https://github.com/{{#composerVendorName}}{{.}}{{/composerVendorName}}{{^composerVendorName}}{{gitUserId}}{{/composerVendorName}}/{{#composerProjectName}}{{.}}{{/composerProjectName}}{{^composerProjectName}}{{gitRepoId}}{{/composerProjectName}}.git" } ], diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenModelTest.java index 4c6894c17d4..0def2969475 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenModelTest.java @@ -199,6 +199,33 @@ public class KotlinClientCodegenModelTest { Assert.assertTrue(property.isContainer); } + @Test(description = "convert a model with array property to a kotlin.collections.List") + public void listPropertyTest() { + final Schema model = getArrayTestSchema(); + + final KotlinClientCodegen codegen = new KotlinClientCodegen(); + codegen.setCollectionType(KotlinClientCodegen.CollectionType.LIST.value); + codegen.processOpts(); + final CodegenModel generated = codegen.fromModel("sample", model, Collections.singletonMap("sample", model)); + + Assert.assertEquals(generated.name, "sample"); + Assert.assertEquals(generated.classname, "Sample"); + Assert.assertEquals(generated.description, "a sample model"); + Assert.assertEquals(generated.vars.size(), 2); + + final CodegenProperty property = generated.vars.get(1); + Assert.assertEquals(property.baseName, "examples"); + Assert.assertEquals(property.getter, "getExamples"); + Assert.assertEquals(property.setter, "setExamples"); + Assert.assertEquals(property.dataType, "kotlin.collections.List"); + Assert.assertEquals(property.name, "examples"); + Assert.assertEquals(property.defaultValue, "null"); + Assert.assertEquals(property.baseType, "kotlin.collections.List"); + Assert.assertEquals(property.containerType, "array"); + Assert.assertFalse(property.required); + Assert.assertTrue(property.isContainer); + } + @Test(description = "convert a model with a map property") public void mapPropertyTest() { final Schema schema = getMapSchema(); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java index 9bb5e0f0464..5d025c098f0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java @@ -319,13 +319,7 @@ public class RubyClientCodegenTest { Assert.assertEquals(op.allParams.get(0).pattern, "/^pattern$/"); // pattern_two_slashes '/^pattern$/i' Assert.assertEquals(op.allParams.get(1).pattern, "/^pattern$/i"); - // pattern_one_slash_start '/^pattern$' - Assert.assertEquals(op.allParams.get(2).pattern, "/^pattern$/"); - // pattern_one_slash_end '^pattern$/' - Assert.assertEquals(op.allParams.get(3).pattern, "/^pattern$/"); - // pattern_one_slash_near_end '^pattern$/im' - Assert.assertEquals(op.allParams.get(4).pattern, "/^pattern$/im"); // pattern_dont_escape_backslash '/^pattern\d{3}$/i' NOTE: the double \ is to escape \ in string but is read as single \ - Assert.assertEquals(op.allParams.get(5).pattern, "/^pattern\\d{3}$/i"); + Assert.assertEquals(op.allParams.get(2).pattern, "/^pattern\\d{3}$/i"); } } diff --git a/modules/openapi-generator/src/test/resources/3_0/test_regex.yaml b/modules/openapi-generator/src/test/resources/3_0/test_regex.yaml index af1ae8d3101..f0e8decdbb4 100644 --- a/modules/openapi-generator/src/test/resources/3_0/test_regex.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/test_regex.yaml @@ -25,21 +25,6 @@ paths: schema: type: string pattern: '/^pattern$/i' - - name: pattern_one_slash_start - in: header - schema: - type: string - pattern: '/^pattern$' - - name: pattern_one_slash_end - in: header - schema: - type: string - pattern: '^pattern$/' - - name: pattern_one_slash_near_end - in: header - schema: - type: string - pattern: '^pattern$/im' - name: pattern_dont_escape_backslash in: header schema: diff --git a/pom.xml b/pom.xml index 9fbb2523e85..43207c685ea 100644 --- a/pom.xml +++ b/pom.xml @@ -1019,11 +1019,11 @@ - samples/client/petstore/c + samples/client/petstore/dart-jaguar/openapi samples/client/petstore/dart-jaguar/flutter_petstore/openapi - - samples/client/petstore/haskell-http-client + + samples/client/petstore/elm-0.18 samples/client/petstore/groovy samples/client/petstore/rust diff --git a/samples/client/petstore-security-test/java/okhttp-gson/.openapi-generator/VERSION b/samples/client/petstore-security-test/java/okhttp-gson/.openapi-generator/VERSION index a6527129083..3f09e910959 100644 --- a/samples/client/petstore-security-test/java/okhttp-gson/.openapi-generator/VERSION +++ b/samples/client/petstore-security-test/java/okhttp-gson/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.2-SNAPSHOT \ No newline at end of file +3.3.3 \ No newline at end of file diff --git a/samples/client/petstore-security-test/php/OpenAPIClient-php/README.md b/samples/client/petstore-security-test/php/OpenAPIClient-php/README.md index 72e324853a6..5322ee7822a 100644 --- a/samples/client/petstore-security-test/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore-security-test/php/OpenAPIClient-php/README.md @@ -19,7 +19,7 @@ To install the bindings via [Composer](http://getcomposer.org/), add the followi { "repositories": [ { - "type": "git", + "type": "vcs", "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" } ], diff --git a/samples/client/petstore/csharp/OpenAPIClient/README.md b/samples/client/petstore/csharp/OpenAPIClient/README.md index aabf26b7899..52d7d417cb7 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp/OpenAPIClient/README.md @@ -138,7 +138,6 @@ Class | Method | HTTP request | Description - [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - [Model.Animal](docs/Animal.md) - - [Model.AnimalFarm](docs/AnimalFarm.md) - [Model.ApiResponse](docs/ApiResponse.md) - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) @@ -169,7 +168,6 @@ Class | Method | HTTP request | Description - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - - [Model.StringBooleanMap](docs/StringBooleanMap.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/another_fake.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/another_fake.ex index 3a20ea4fa7d..868c0babf88 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/another_fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/another_fake.ex @@ -30,7 +30,7 @@ defmodule OpenapiPetstore.Api.AnotherFake do %{} |> method(:patch) |> url("/another-fake/dummy") - |> add_param(:body, :"Client", client) + |> add_param(:body, :body, client) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%OpenapiPetstore.Model.Client{}) diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex index 6e04b911898..2950acf621a 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake.ex @@ -137,7 +137,7 @@ defmodule OpenapiPetstore.Api.Fake do %{} |> method(:put) |> url("/fake/body-with-file-schema") - |> add_param(:body, :"FileSchemaTestClass", file_schema_test_class) + |> add_param(:body, :body, file_schema_test_class) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(false) @@ -162,7 +162,7 @@ defmodule OpenapiPetstore.Api.Fake do |> method(:put) |> url("/fake/body-with-query-params") |> add_param(:query, :"query", query) - |> add_param(:body, :"User", user) + |> add_param(:body, :body, user) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(false) @@ -187,7 +187,7 @@ defmodule OpenapiPetstore.Api.Fake do %{} |> method(:patch) |> url("/fake") - |> add_param(:body, :"Client", client) + |> add_param(:body, :body, client) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%OpenapiPetstore.Model.Client{}) @@ -345,7 +345,7 @@ defmodule OpenapiPetstore.Api.Fake do %{} |> method(:post) |> url("/fake/inline-additionalProperties") - |> add_param(:body, :"request_body", request_body) + |> add_param(:body, :body, request_body) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(false) diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake_classname_tags123.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake_classname_tags123.ex index f1a9eb3c1ed..d23f7779649 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/fake_classname_tags123.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/fake_classname_tags123.ex @@ -30,7 +30,7 @@ defmodule OpenapiPetstore.Api.FakeClassnameTags123 do %{} |> method(:patch) |> url("/fake_classname_test") - |> add_param(:body, :"Client", client) + |> add_param(:body, :body, client) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%OpenapiPetstore.Model.Client{}) diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex index 777f3102f8e..8976e16e66c 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/pet.ex @@ -29,7 +29,7 @@ defmodule OpenapiPetstore.Api.Pet do %{} |> method(:post) |> url("/pet") - |> add_param(:body, :"Pet", pet) + |> add_param(:body, :body, pet) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(false) @@ -155,7 +155,7 @@ defmodule OpenapiPetstore.Api.Pet do %{} |> method(:put) |> url("/pet") - |> add_param(:body, :"Pet", pet) + |> add_param(:body, :body, pet) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(false) diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/store.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/store.ex index 381d4ef10e8..5484d84c98d 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/store.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/store.ex @@ -100,7 +100,7 @@ defmodule OpenapiPetstore.Api.Store do %{} |> method(:post) |> url("/store/order") - |> add_param(:body, :"Order", order) + |> add_param(:body, :body, order) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(%OpenapiPetstore.Model.Order{}) diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/api/user.ex b/samples/client/petstore/elixir/lib/openapi_petstore/api/user.ex index bf5840bea3a..2b00ccaeee7 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/api/user.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/api/user.ex @@ -30,7 +30,7 @@ defmodule OpenapiPetstore.Api.User do %{} |> method(:post) |> url("/user") - |> add_param(:body, :"User", user) + |> add_param(:body, :body, user) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(false) @@ -54,7 +54,7 @@ defmodule OpenapiPetstore.Api.User do %{} |> method(:post) |> url("/user/createWithArray") - |> add_param(:body, :"User", user) + |> add_param(:body, :body, user) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(false) @@ -78,7 +78,7 @@ defmodule OpenapiPetstore.Api.User do %{} |> method(:post) |> url("/user/createWithList") - |> add_param(:body, :"User", user) + |> add_param(:body, :body, user) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(false) @@ -199,7 +199,7 @@ defmodule OpenapiPetstore.Api.User do %{} |> method(:put) |> url("/user/#{username}") - |> add_param(:body, :"User", user) + |> add_param(:body, :body, user) |> Enum.into([]) |> (&Connection.request(connection, &1)).() |> decode(false) diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex index 0921cc583f8..837bf62a7ce 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.AdditionalPropertiesClass do ] @type t :: %__MODULE__{ - :"map_property" => %{optional(String.t) => String.t}, - :"map_of_map_property" => %{optional(String.t) => %{optional(String.t) => String.t}} + :"map_property" => %{optional(String.t) => String.t} | nil, + :"map_of_map_property" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex index 27e45bc5ead..deb93a04d0e 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex @@ -15,7 +15,7 @@ defmodule OpenapiPetstore.Model.Animal do @type t :: %__MODULE__{ :"className" => String.t, - :"color" => String.t + :"color" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex index 27a6813ff20..7dc34e32ad7 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex @@ -15,9 +15,9 @@ defmodule OpenapiPetstore.Model.ApiResponse do ] @type t :: %__MODULE__{ - :"code" => integer(), - :"type" => String.t, - :"message" => String.t + :"code" => integer() | nil, + :"type" => String.t | nil, + :"message" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex index 1ee202f602f..e126f51109c 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.ArrayOfArrayOfNumberOnly do ] @type t :: %__MODULE__{ - :"ArrayArrayNumber" => [[float()]] + :"ArrayArrayNumber" => [[float()]] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_number_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_number_only.ex index 0be9ae36939..2e8e5355248 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_number_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_number_only.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.ArrayOfNumberOnly do ] @type t :: %__MODULE__{ - :"ArrayNumber" => [float()] + :"ArrayNumber" => [float()] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_test.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_test.ex index d725eb77a19..fbed2547c5e 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_test.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_test.ex @@ -15,9 +15,9 @@ defmodule OpenapiPetstore.Model.ArrayTest do ] @type t :: %__MODULE__{ - :"array_of_string" => [String.t], - :"array_array_of_integer" => [[integer()]], - :"array_array_of_model" => [[ReadOnlyFirst]] + :"array_of_string" => [String.t] | nil, + :"array_array_of_integer" => [[integer()]] | nil, + :"array_array_of_model" => [[ReadOnlyFirst]] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/capitalization.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/capitalization.ex index 7b303458fd3..e9627cf3341 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/capitalization.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/capitalization.ex @@ -18,12 +18,12 @@ defmodule OpenapiPetstore.Model.Capitalization do ] @type t :: %__MODULE__{ - :"smallCamel" => String.t, - :"CapitalCamel" => String.t, - :"small_Snake" => String.t, - :"Capital_Snake" => String.t, - :"SCA_ETH_Flow_Points" => String.t, - :"ATT_NAME" => String.t + :"smallCamel" => String.t | nil, + :"CapitalCamel" => String.t | nil, + :"small_Snake" => String.t | nil, + :"Capital_Snake" => String.t | nil, + :"SCA_ETH_Flow_Points" => String.t | nil, + :"ATT_NAME" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/cat.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/cat.ex index ab4e49e6d80..416bb0a73eb 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/cat.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/cat.ex @@ -16,8 +16,8 @@ defmodule OpenapiPetstore.Model.Cat do @type t :: %__MODULE__{ :"className" => String.t, - :"color" => String.t, - :"declawed" => boolean() + :"color" => String.t | nil, + :"declawed" => boolean() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/category.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/category.ex index 9b1c71be1b6..2d1c853ab49 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/category.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/category.ex @@ -14,7 +14,7 @@ defmodule OpenapiPetstore.Model.Category do ] @type t :: %__MODULE__{ - :"id" => integer(), + :"id" => integer() | nil, :"name" => String.t } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/class_model.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/class_model.ex index 9b26c5e3e7b..e204556d8b7 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/class_model.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/class_model.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.ClassModel do ] @type t :: %__MODULE__{ - :"_class" => String.t + :"_class" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/client.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/client.ex index d02cc3e7c06..cd5a452028b 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/client.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/client.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.Client do ] @type t :: %__MODULE__{ - :"client" => String.t + :"client" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/dog.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/dog.ex index 509f7b8f154..f4a7eae34ab 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/dog.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/dog.ex @@ -16,8 +16,8 @@ defmodule OpenapiPetstore.Model.Dog do @type t :: %__MODULE__{ :"className" => String.t, - :"color" => String.t, - :"breed" => String.t + :"color" => String.t | nil, + :"breed" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_arrays.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_arrays.ex index 367ab0f6f28..d8f98a028a7 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_arrays.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_arrays.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.EnumArrays do ] @type t :: %__MODULE__{ - :"just_symbol" => String.t, - :"array_enum" => [String.t] + :"just_symbol" => String.t | nil, + :"array_enum" => [String.t] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_test.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_test.ex index abc41ec5a80..11e81c98a77 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_test.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_test.ex @@ -17,11 +17,11 @@ defmodule OpenapiPetstore.Model.EnumTest do ] @type t :: %__MODULE__{ - :"enum_string" => String.t, + :"enum_string" => String.t | nil, :"enum_string_required" => String.t, - :"enum_integer" => integer(), - :"enum_number" => float(), - :"outerEnum" => OuterEnum + :"enum_integer" => integer() | nil, + :"enum_number" => float() | nil, + :"outerEnum" => OuterEnum | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/file_schema_test_class.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/file_schema_test_class.ex index 3a52359a5f0..2c5031ca919 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/file_schema_test_class.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/file_schema_test_class.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.FileSchemaTestClass do ] @type t :: %__MODULE__{ - :"file" => File, - :"files" => [File] + :"file" => File | nil, + :"files" => [File] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/format_test.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/format_test.ex index 144a12a254d..869d7aa4192 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/format_test.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/format_test.ex @@ -25,18 +25,18 @@ defmodule OpenapiPetstore.Model.FormatTest do ] @type t :: %__MODULE__{ - :"integer" => integer(), - :"int32" => integer(), - :"int64" => integer(), + :"integer" => integer() | nil, + :"int32" => integer() | nil, + :"int64" => integer() | nil, :"number" => float(), - :"float" => float(), - :"double" => float(), - :"string" => String.t, + :"float" => float() | nil, + :"double" => float() | nil, + :"string" => String.t | nil, :"byte" => binary(), - :"binary" => String.t, + :"binary" => String.t | nil, :"date" => Date.t, - :"dateTime" => DateTime.t, - :"uuid" => String.t, + :"dateTime" => DateTime.t | nil, + :"uuid" => String.t | nil, :"password" => String.t } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/has_only_read_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/has_only_read_only.ex index aea5065c090..1a1fa302edb 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/has_only_read_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/has_only_read_only.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.HasOnlyReadOnly do ] @type t :: %__MODULE__{ - :"bar" => String.t, - :"foo" => String.t + :"bar" => String.t | nil, + :"foo" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/map_test.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/map_test.ex index d3870aa0075..726814dd817 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/map_test.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/map_test.ex @@ -16,10 +16,10 @@ defmodule OpenapiPetstore.Model.MapTest do ] @type t :: %__MODULE__{ - :"map_map_of_string" => %{optional(String.t) => %{optional(String.t) => String.t}}, - :"map_of_enum_string" => %{optional(String.t) => String.t}, - :"direct_map" => %{optional(String.t) => boolean()}, - :"indirect_map" => %{optional(String.t) => boolean()} + :"map_map_of_string" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil, + :"map_of_enum_string" => %{optional(String.t) => String.t} | nil, + :"direct_map" => %{optional(String.t) => boolean()} | nil, + :"indirect_map" => %{optional(String.t) => boolean()} | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex index 014b696ff6d..3603ec4f6bb 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex @@ -15,9 +15,9 @@ defmodule OpenapiPetstore.Model.MixedPropertiesAndAdditionalPropertiesClass do ] @type t :: %__MODULE__{ - :"uuid" => String.t, - :"dateTime" => DateTime.t, - :"map" => %{optional(String.t) => Animal} + :"uuid" => String.t | nil, + :"dateTime" => DateTime.t | nil, + :"map" => %{optional(String.t) => Animal} | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/model_200_response.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/model_200_response.ex index e3764d66ea2..2bc6d152906 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/model_200_response.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/model_200_response.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.Model200Response do ] @type t :: %__MODULE__{ - :"name" => integer(), - :"class" => String.t + :"name" => integer() | nil, + :"class" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/name.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/name.ex index 1b4c97a8060..cd2fdce24d0 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/name.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/name.ex @@ -17,9 +17,9 @@ defmodule OpenapiPetstore.Model.Name do @type t :: %__MODULE__{ :"name" => integer(), - :"snake_case" => integer(), - :"property" => String.t, - :"123Number" => integer() + :"snake_case" => integer() | nil, + :"property" => String.t | nil, + :"123Number" => integer() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/number_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/number_only.ex index 84e1ae57760..825553cf9f3 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/number_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/number_only.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.NumberOnly do ] @type t :: %__MODULE__{ - :"JustNumber" => float() + :"JustNumber" => float() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/order.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/order.ex index 3f6f5c81314..936a7039dce 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/order.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/order.ex @@ -18,12 +18,12 @@ defmodule OpenapiPetstore.Model.Order do ] @type t :: %__MODULE__{ - :"id" => integer(), - :"petId" => integer(), - :"quantity" => integer(), - :"shipDate" => DateTime.t, - :"status" => String.t, - :"complete" => boolean() + :"id" => integer() | nil, + :"petId" => integer() | nil, + :"quantity" => integer() | nil, + :"shipDate" => DateTime.t | nil, + :"status" => String.t | nil, + :"complete" => boolean() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_composite.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_composite.ex index 00c4df9228e..04143a20a57 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_composite.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_composite.ex @@ -15,9 +15,9 @@ defmodule OpenapiPetstore.Model.OuterComposite do ] @type t :: %__MODULE__{ - :"my_number" => float(), - :"my_string" => String.t, - :"my_boolean" => boolean() + :"my_number" => float() | nil, + :"my_string" => String.t | nil, + :"my_boolean" => boolean() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/pet.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/pet.ex index 8f2802d5953..4fdcdc95a8e 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/pet.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/pet.ex @@ -18,12 +18,12 @@ defmodule OpenapiPetstore.Model.Pet do ] @type t :: %__MODULE__{ - :"id" => integer(), - :"category" => Category, + :"id" => integer() | nil, + :"category" => Category | nil, :"name" => String.t, :"photoUrls" => [String.t], - :"tags" => [Tag], - :"status" => String.t + :"tags" => [Tag] | nil, + :"status" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/read_only_first.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/read_only_first.ex index 942bb6045e8..bfd2dda2072 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/read_only_first.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/read_only_first.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.ReadOnlyFirst do ] @type t :: %__MODULE__{ - :"bar" => String.t, - :"baz" => String.t + :"bar" => String.t | nil, + :"baz" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/return.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/return.ex index ad2765dbd12..8a2102c5989 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/return.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/return.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.Return do ] @type t :: %__MODULE__{ - :"return" => integer() + :"return" => integer() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/special_model_name.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/special_model_name.ex index e4bed9810c6..429129b42a0 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/special_model_name.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/special_model_name.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.SpecialModelName do ] @type t :: %__MODULE__{ - :"$special[property.name]" => integer() + :"$special[property.name]" => integer() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/tag.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/tag.ex index 720f19b309b..5dd3bac7502 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/tag.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/tag.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.Tag do ] @type t :: %__MODULE__{ - :"id" => integer(), - :"name" => String.t + :"id" => integer() | nil, + :"name" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/user.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/user.ex index 17cfecea713..faaf4ab9a96 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/user.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/user.ex @@ -20,14 +20,14 @@ defmodule OpenapiPetstore.Model.User do ] @type t :: %__MODULE__{ - :"id" => integer(), - :"username" => String.t, - :"firstName" => String.t, - :"lastName" => String.t, - :"email" => String.t, - :"password" => String.t, - :"phone" => String.t, - :"userStatus" => integer() + :"id" => integer() | nil, + :"username" => String.t | nil, + :"firstName" => String.t | nil, + :"lastName" => String.t | nil, + :"email" => String.t | nil, + :"password" => String.t | nil, + :"phone" => String.t | nil, + :"userStatus" => integer() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/request_builder.ex b/samples/client/petstore/elixir/lib/openapi_petstore/request_builder.ex index 2b23a156281..e81e72d1cf3 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/request_builder.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/request_builder.ex @@ -88,6 +88,10 @@ defmodule OpenapiPetstore.RequestBuilder do |> Map.put_new_lazy(:body, &Tesla.Multipart.new/0) |> Map.update!(:body, &(Tesla.Multipart.add_field(&1, key, Poison.encode!(value), headers: [{:"Content-Type", "application/json"}]))) end + def add_param(request, :headers, key, value) do + request + |> Map.update(:headers, %{key => value}, &(Map.put(&1, key, value))) + end def add_param(request, :file, name, path) do request |> Map.put_new_lazy(:body, &Tesla.Multipart.new/0) diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 91a0e994b24..c6ffd9374bf 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -71,7 +71,6 @@ Class | Method | HTTP request | Description - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - [ApiResponse](docs/ApiResponse.md) - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) @@ -102,7 +101,6 @@ Class | Method | HTTP request | Description - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Return](docs/Return.md) - [SpecialModelName](docs/SpecialModelName.md) - - [StringBooleanMap](docs/StringBooleanMap.md) - [Tag](docs/Tag.md) - [User](docs/User.md) diff --git a/samples/client/petstore/go/go-petstore/docs/AnimalFarm.md b/samples/client/petstore/go/go-petstore/docs/AnimalFarm.md deleted file mode 100644 index df6bab21dae..00000000000 --- a/samples/client/petstore/go/go-petstore/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore/docs/StringBooleanMap.md b/samples/client/petstore/go/go-petstore/docs/StringBooleanMap.md deleted file mode 100644 index 7abf11ec68b..00000000000 --- a/samples/client/petstore/go/go-petstore/docs/StringBooleanMap.md +++ /dev/null @@ -1,9 +0,0 @@ -# StringBooleanMap - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/go/go-petstore/model_animal_farm.go b/samples/client/petstore/go/go-petstore/model_animal_farm.go deleted file mode 100644 index e3ff77813ee..00000000000 --- a/samples/client/petstore/go/go-petstore/model_animal_farm.go +++ /dev/null @@ -1,13 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -type AnimalFarm struct { -} diff --git a/samples/client/petstore/go/go-petstore/model_string_boolean_map.go b/samples/client/petstore/go/go-petstore/model_string_boolean_map.go deleted file mode 100644 index 7cc08c7e895..00000000000 --- a/samples/client/petstore/go/go-petstore/model_string_boolean_map.go +++ /dev/null @@ -1,13 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstore - -type StringBooleanMap struct { -} diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs index ef55290920b..010abaab453 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/Model.hs @@ -278,34 +278,6 @@ mkAnimal animalClassName = , animalColor = Nothing } --- ** AnimalFarm --- | AnimalFarm -data AnimalFarm = AnimalFarm - { - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON AnimalFarm -instance A.FromJSON AnimalFarm where - parseJSON = A.withObject "AnimalFarm" $ \o -> - pure AnimalFarm - - --- | ToJSON AnimalFarm -instance A.ToJSON AnimalFarm where - toJSON AnimalFarm = - _omitNulls - [ - ] - - --- | Construct a value of type 'AnimalFarm' (by applying it's required fields, if any) -mkAnimalFarm - :: AnimalFarm -mkAnimalFarm = - AnimalFarm - { - } - -- ** ApiResponse -- | ApiResponse data ApiResponse = ApiResponse @@ -1326,34 +1298,6 @@ mkSpecialModelName = { specialModelNameSpecialPropertyName = Nothing } --- ** StringBooleanMap --- | StringBooleanMap -data StringBooleanMap = StringBooleanMap - { - } deriving (P.Show, P.Eq, P.Typeable) - --- | FromJSON StringBooleanMap -instance A.FromJSON StringBooleanMap where - parseJSON = A.withObject "StringBooleanMap" $ \o -> - pure StringBooleanMap - - --- | ToJSON StringBooleanMap -instance A.ToJSON StringBooleanMap where - toJSON StringBooleanMap = - _omitNulls - [ - ] - - --- | Construct a value of type 'StringBooleanMap' (by applying it's required fields, if any) -mkStringBooleanMap - :: StringBooleanMap -mkStringBooleanMap = - StringBooleanMap - { - } - -- ** Tag -- | Tag data Tag = Tag diff --git a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs index b1aa4c791c5..0b8a2a84813 100644 --- a/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs +++ b/samples/client/petstore/haskell-http-client/lib/OpenAPIPetstore/ModelLens.hs @@ -64,10 +64,6 @@ animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f a --- * AnimalFarm - - - -- * ApiResponse -- | 'apiResponseCode' Lens @@ -603,10 +599,6 @@ specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelName --- * StringBooleanMap - - - -- * Tag -- | 'tagId' Lens diff --git a/samples/client/petstore/haskell-http-client/tests/Instances.hs b/samples/client/petstore/haskell-http-client/tests/Instances.hs index 59f575e12cd..74830f44ba2 100644 --- a/samples/client/petstore/haskell-http-client/tests/Instances.hs +++ b/samples/client/petstore/haskell-http-client/tests/Instances.hs @@ -101,11 +101,6 @@ instance Arbitrary Animal where <$> arbitrary -- animalClassName :: Text <*> arbitrary -- animalColor :: Maybe Text -instance Arbitrary AnimalFarm where - arbitrary = - - pure AnimalFarm - instance Arbitrary ApiResponse where arbitrary = ApiResponse @@ -301,11 +296,6 @@ instance Arbitrary SpecialModelName where SpecialModelName <$> arbitrary -- specialModelNameSpecialPropertyName :: Maybe Integer -instance Arbitrary StringBooleanMap where - arbitrary = - - pure StringBooleanMap - instance Arbitrary Tag where arbitrary = Tag diff --git a/samples/client/petstore/haskell-http-client/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests/Test.hs index ea6fff251e3..9d6355d7b71 100644 --- a/samples/client/petstore/haskell-http-client/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests/Test.hs @@ -22,7 +22,6 @@ main = pure () propMimeEq MimeJSON (Proxy :: Proxy AdditionalPropertiesClass) propMimeEq MimeJSON (Proxy :: Proxy Animal) - propMimeEq MimeJSON (Proxy :: Proxy AnimalFarm) propMimeEq MimeJSON (Proxy :: Proxy ApiResponse) propMimeEq MimeJSON (Proxy :: Proxy ArrayOfArrayOfNumberOnly) propMimeEq MimeJSON (Proxy :: Proxy ArrayOfNumberOnly) @@ -53,7 +52,6 @@ main = propMimeEq MimeJSON (Proxy :: Proxy Pet) propMimeEq MimeJSON (Proxy :: Proxy ReadOnlyFirst) propMimeEq MimeJSON (Proxy :: Proxy SpecialModelName) - propMimeEq MimeJSON (Proxy :: Proxy StringBooleanMap) propMimeEq MimeJSON (Proxy :: Proxy Tag) propMimeEq MimeJSON (Proxy :: Proxy User) diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 5ffad5e1991..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto 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.apache.commons.lang3.ObjectUtils; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 5b20288f8f6..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto 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.apache.commons.lang3.ObjectUtils; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md index 62046473c1f..873f2636426 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **testGroupParameters** -> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group).stringGroup(stringGroup).booleanGroup(booleanGroup).int64Group(int64Group).execute(); Fake endpoint to test group parameters (optional) @@ -491,7 +491,11 @@ 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); + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testGroupParameters"); e.printStackTrace(); diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java index 49f8a954e98..afd061f83b2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1305,20 +1305,7 @@ public class FakeApi { apiClient.executeAsync(call, callback); return call; } - /** - * Build call for testGroupParameters - * @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) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = new Object(); // create path and map variables @@ -1406,52 +1393,13 @@ public class FakeApi { } - /** - * 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) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - } - /** - * 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 ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + private ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { com.squareup.okhttp.Call call = testGroupParametersValidateBeforeCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, null, null); return apiClient.execute(call); } - /** - * Fake endpoint to test group parameters (optional) (asynchronously) - * 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) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call testGroupParametersAsync(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback callback) throws ApiException { + private com.squareup.okhttp.Call testGroupParametersAsync(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1476,6 +1424,101 @@ public class FakeApi { apiClient.executeAsync(call, callback); return call; } + + public class APItestGroupParametersRequest { + private final Integer requiredStringGroup; + private final Boolean requiredBooleanGroup; + private final Long requiredInt64Group; + private Integer stringGroup; + private Boolean booleanGroup; + private Long int64Group; + + private APItestGroupParametersRequest(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group) { + this.requiredStringGroup = requiredStringGroup; + this.requiredBooleanGroup = requiredBooleanGroup; + this.requiredInt64Group = requiredInt64Group; + } + + /** + * Set stringGroup + * @param stringGroup String in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest stringGroup(Integer stringGroup) { + this.stringGroup = stringGroup; + return this; + } + + /** + * Set booleanGroup + * @param booleanGroup Boolean in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest booleanGroup(Boolean booleanGroup) { + this.booleanGroup = booleanGroup; + return this; + } + + /** + * Set int64Group + * @param int64Group Integer in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest int64Group(Long int64Group) { + this.int64Group = int64Group; + return this; + } + + /** + * Build call for testGroupParameters + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call buildCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + return testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, progressListener, progressRequestListener); + } + + /** + * Execute testGroupParameters request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void execute() throws ApiException { + testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /** + * Execute testGroupParameters request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /** + * Execute testGroupParameters request (asynchronously) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call executeAsync(final ApiCallback callback) throws ApiException { + return testGroupParametersAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, callback); + } + } + + /** + * 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) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group) { + return new APItestGroupParametersRequest(requiredStringGroup, requiredBooleanGroup, requiredInt64Group); + } /** * Build call for testInlineAdditionalProperties * @param requestBody request body (required) diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index d0911570bb7..00000000000 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; -import android.os.Parcelable; -import android.os.Parcel; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList implements Parcelable { - public AnimalFarm() { - super(); - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public void writeToParcel(Parcel out, int flags) { - out.writeList(this); - } - - AnimalFarm(Parcel in) { - in.readTypedList(this, Animal.CREATOR); - } - - public int describeContents() { - return 0; - } - - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public AnimalFarm createFromParcel(Parcel in) { - AnimalFarm result = new AnimalFarm(); - result.addAll(in.readArrayList(Animal.class.getClassLoader())); - return result; - } - public AnimalFarm[] newArray(int size) { - return new AnimalFarm[size]; - } - }; -} - diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index fa40c1e911a..00000000000 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import android.os.Parcelable; -import android.os.Parcel; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap implements Parcelable { - public StringBooleanMap() { - super(); - } - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - - public void writeToParcel(Parcel out, int flags) { - super.writeToParcel(out, flags); - } - - StringBooleanMap(Parcel in) { - super(in); - } - - public int describeContents() { - return 0; - } - - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public StringBooleanMap createFromParcel(Parcel in) { - return new StringBooleanMap(in); - } - public StringBooleanMap[] newArray(int size) { - return new StringBooleanMap[size]; - } - }; -} - diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/FakeApiTest.java index 07f4a80a5b2..34e199c0cca 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -220,7 +220,11 @@ public class FakeApiTest { Integer stringGroup = null; Boolean booleanGroup = null; Long int64Group = null; - api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .execute(); // TODO: test validations } diff --git a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index 62046473c1f..873f2636426 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md @@ -470,7 +470,7 @@ No authorization required # **testGroupParameters** -> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group).stringGroup(stringGroup).booleanGroup(booleanGroup).int64Group(int64Group).execute(); Fake endpoint to test group parameters (optional) @@ -491,7 +491,11 @@ 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); + apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .execute(); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testGroupParameters"); e.printStackTrace(); diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java index 49f8a954e98..afd061f83b2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1305,20 +1305,7 @@ public class FakeApi { apiClient.executeAsync(call, callback); return call; } - /** - * Build call for testGroupParameters - * @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) - * @param progressListener Progress listener - * @param progressRequestListener Progress request listener - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - */ - public com.squareup.okhttp.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testGroupParametersCall(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = new Object(); // create path and map variables @@ -1406,52 +1393,13 @@ public class FakeApi { } - /** - * 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) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - } - /** - * 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 ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - */ - public ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + private ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { com.squareup.okhttp.Call call = testGroupParametersValidateBeforeCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, null, null); return apiClient.execute(call); } - /** - * Fake endpoint to test group parameters (optional) (asynchronously) - * 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) - * @param callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - */ - public com.squareup.okhttp.Call testGroupParametersAsync(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback callback) throws ApiException { + private com.squareup.okhttp.Call testGroupParametersAsync(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1476,6 +1424,101 @@ public class FakeApi { apiClient.executeAsync(call, callback); return call; } + + public class APItestGroupParametersRequest { + private final Integer requiredStringGroup; + private final Boolean requiredBooleanGroup; + private final Long requiredInt64Group; + private Integer stringGroup; + private Boolean booleanGroup; + private Long int64Group; + + private APItestGroupParametersRequest(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group) { + this.requiredStringGroup = requiredStringGroup; + this.requiredBooleanGroup = requiredBooleanGroup; + this.requiredInt64Group = requiredInt64Group; + } + + /** + * Set stringGroup + * @param stringGroup String in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest stringGroup(Integer stringGroup) { + this.stringGroup = stringGroup; + return this; + } + + /** + * Set booleanGroup + * @param booleanGroup Boolean in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest booleanGroup(Boolean booleanGroup) { + this.booleanGroup = booleanGroup; + return this; + } + + /** + * Set int64Group + * @param int64Group Integer in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest int64Group(Long int64Group) { + this.int64Group = int64Group; + return this; + } + + /** + * Build call for testGroupParameters + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call buildCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + return testGroupParametersCall(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, progressListener, progressRequestListener); + } + + /** + * Execute testGroupParameters request + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void execute() throws ApiException { + testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /** + * Execute testGroupParameters request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + + /** + * Execute testGroupParameters request (asynchronously) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call executeAsync(final ApiCallback callback) throws ApiException { + return testGroupParametersAsync(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, callback); + } + } + + /** + * 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) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group) { + return new APItestGroupParametersRequest(requiredStringGroup, requiredBooleanGroup, requiredInt64Group); + } /** * Build call for testInlineAdditionalProperties * @param requestBody request body (required) diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java index 07f4a80a5b2..34e199c0cca 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -220,7 +220,11 @@ public class FakeApiTest { Integer stringGroup = null; Boolean booleanGroup = null; Long int64Group = null; - api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .execute(); // TODO: test validations } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 57997e8d7b3..00000000000 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; -import com.fasterxml.jackson.dataformat.xml.annotation.*; -import javax.xml.bind.annotation.*; - -/** - * AnimalFarm - */ - -@XmlRootElement(name = "AnimalFarm") -@XmlAccessorType(XmlAccessType.FIELD) -@JacksonXmlRootElement(localName = "AnimalFarm") -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 83beddee920..00000000000 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import com.fasterxml.jackson.dataformat.xml.annotation.*; -import javax.xml.bind.annotation.*; - -/** - * StringBooleanMap - */ - -@XmlRootElement(name = "StringBooleanMap") -@XmlAccessorType(XmlAccessType.FIELD) -@JacksonXmlRootElement(localName = "StringBooleanMap") -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 867cf78d4ac..00000000000 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; -import javax.validation.constraints.*; -import javax.validation.Valid; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index c651556f7d0..00000000000 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 867cf78d4ac..00000000000 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; -import javax.validation.constraints.*; -import javax.validation.Valid; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index c651556f7d0..00000000000 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 867cf78d4ac..00000000000 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; -import javax.validation.constraints.*; -import javax.validation.Valid; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index c651556f7d0..00000000000 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AnimalFarm.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AnimalFarm.java deleted file mode 100644 index 2f43f1b1a96..00000000000 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AnimalFarm.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Animal; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/StringBooleanMap.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/StringBooleanMap.java deleted file mode 100644 index 8b18b0c9b51..00000000000 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/StringBooleanMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/php/OpenAPIClient-php/README.md b/samples/client/petstore/php/OpenAPIClient-php/README.md index fc3d0e453e9..f42e37b4a46 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/client/petstore/php/OpenAPIClient-php/README.md @@ -19,7 +19,7 @@ To install the bindings via [Composer](http://getcomposer.org/), add the followi { "repositories": [ { - "type": "git", + "type": "vcs", "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" } ], @@ -120,7 +120,6 @@ Class | Method | HTTP request | Description - [AdditionalPropertiesClass](docs/Model/AdditionalPropertiesClass.md) - [Animal](docs/Model/Animal.md) - - [AnimalFarm](docs/Model/AnimalFarm.md) - [ApiResponse](docs/Model/ApiResponse.md) - [ArrayOfArrayOfNumberOnly](docs/Model/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/Model/ArrayOfNumberOnly.md) @@ -151,7 +150,6 @@ Class | Method | HTTP request | Description - [Pet](docs/Model/Pet.md) - [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md) - [SpecialModelName](docs/Model/SpecialModelName.md) - - [StringBooleanMap](docs/Model/StringBooleanMap.md) - [Tag](docs/Model/Tag.md) - [User](docs/Model/User.md) diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php deleted file mode 100644 index 776d096ebc8..00000000000 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php +++ /dev/null @@ -1,80 +0,0 @@ -/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index 97c1a0151eb..4dff547a851 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -195,8 +195,8 @@ module Petstore invalid_properties.push('invalid value for "byte", byte cannot be nil.') end - if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$) - invalid_properties.push('invalid value for "byte", must conform to the pattern /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$.') + if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) + invalid_properties.push('invalid value for "byte", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.') end if @date.nil? @@ -234,7 +234,7 @@ module Petstore return false if !@double.nil? && @double < 67.8 return false if !@string.nil? && @string !~ Regexp.new(/[a-z]/i) return false if @byte.nil? - return false if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$) + return false if @byte !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) return false if @date.nil? return false if @password.nil? return false if @password.to_s.length > 64 @@ -333,8 +333,8 @@ module Petstore fail ArgumentError, 'byte cannot be nil' end - if byte !~ Regexp.new(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$) - fail ArgumentError, 'invalid value for "byte", must conform to the pattern /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$.' + if byte !~ Regexp.new(/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/) + fail ArgumentError, 'invalid value for "byte", must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.' end @byte = byte diff --git a/samples/client/petstore/ruby/lib/petstore/models/string_boolean_map.rb b/samples/client/petstore/ruby/lib/petstore/models/string_boolean_map.rb deleted file mode 100644 index f6cee538289..00000000000 --- a/samples/client/petstore/ruby/lib/petstore/models/string_boolean_map.rb +++ /dev/null @@ -1,174 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class StringBooleanMap - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/client/petstore/ruby/spec/models/animal_farm_spec.rb b/samples/client/petstore/ruby/spec/models/animal_farm_spec.rb deleted file mode 100644 index fafc7166178..00000000000 --- a/samples/client/petstore/ruby/spec/models/animal_farm_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.4-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AnimalFarm -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'AnimalFarm' do - before do - # run before each test - @instance = Petstore::AnimalFarm.new - end - - after do - # run after each test - end - - describe 'test an instance of AnimalFarm' do - it 'should create an instance of AnimalFarm' do - expect(@instance).to be_instance_of(Petstore::AnimalFarm) - end - end -end diff --git a/samples/client/petstore/ruby/spec/models/string_boolean_map_spec.rb b/samples/client/petstore/ruby/spec/models/string_boolean_map_spec.rb deleted file mode 100644 index 921a427d613..00000000000 --- a/samples/client/petstore/ruby/spec/models/string_boolean_map_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.4-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::StringBooleanMap -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'StringBooleanMap' do - before do - # run before each test - @instance = Petstore::StringBooleanMap.new - end - - after do - # run after each test - end - - describe 'test an instance of StringBooleanMap' do - it 'should create an instance of StringBooleanMap' do - expect(@instance).to be_instance_of(Petstore::StringBooleanMap) - end - end -end diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md index 6ab6d44eaa5..34ffbd1ab45 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md @@ -19,7 +19,7 @@ To install the bindings via [Composer](http://getcomposer.org/), add the followi { "repositories": [ { - "type": "git", + "type": "vcs", "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" } ], @@ -121,7 +121,6 @@ Class | Method | HTTP request | Description - [AdditionalPropertiesClass](docs/Model/AdditionalPropertiesClass.md) - [Animal](docs/Model/Animal.md) - - [AnimalFarm](docs/Model/AnimalFarm.md) - [ApiResponse](docs/Model/ApiResponse.md) - [ArrayOfArrayOfNumberOnly](docs/Model/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/Model/ArrayOfNumberOnly.md) @@ -160,7 +159,6 @@ Class | Method | HTTP request | Description - [Pet](docs/Model/Pet.md) - [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md) - [SpecialModelName](docs/Model/SpecialModelName.md) - - [StringBooleanMap](docs/Model/StringBooleanMap.md) - [Tag](docs/Model/Tag.md) - [User](docs/Model/User.md) diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php deleted file mode 100644 index 776d096ebc8..00000000000 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php +++ /dev/null @@ -1,80 +0,0 @@ -/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/body4.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/body4.rb deleted file mode 100644 index 7b0954a6061..00000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/body4.rb +++ /dev/null @@ -1,204 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.3.2-SNAPSHOT - -=end - -require 'date' - -module Petstore - class Body4 - # field1 - attr_accessor :param - - # field2 - attr_accessor :param2 - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'param' => :'param', - :'param2' => :'param2' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'param' => :'String', - :'param2' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - - if attributes.has_key?(:'param') - self.param = attributes[:'param'] - end - - if attributes.has_key?(:'param2') - self.param2 = attributes[:'param2'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @param.nil? - invalid_properties.push('invalid value for "param", param cannot be nil.') - end - - if @param2.nil? - invalid_properties.push('invalid value for "param2", param2 cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @param.nil? - return false if @param2.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - param == o.param && - param2 == o.param2 - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [param, param2].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_boolean.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_boolean.rb deleted file mode 100644 index 323e66b278b..00000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_boolean.rb +++ /dev/null @@ -1,174 +0,0 @@ -=begin -#Swagger Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 -Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class OuterBoolean - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.swagger_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_number.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_number.rb deleted file mode 100644 index 03e7a603cb0..00000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_number.rb +++ /dev/null @@ -1,174 +0,0 @@ -=begin -#Swagger Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 -Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class OuterNumber - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.swagger_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_string.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_string.rb deleted file mode 100644 index 5e6dfc4b6bb..00000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/outer_string.rb +++ /dev/null @@ -1,174 +0,0 @@ -=begin -#Swagger Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 -Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class OuterString - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.swagger_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.swagger_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/models/string_boolean_map.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/models/string_boolean_map.rb deleted file mode 100644 index f6cee538289..00000000000 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/models/string_boolean_map.rb +++ /dev/null @@ -1,174 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.0.0-SNAPSHOT - -=end - -require 'date' - -module Petstore - class StringBooleanMap - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - } - end - - # Attribute type mapping. - def self.openapi_types - { - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - return unless attributes.is_a?(Hash) - - # convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Fixnum] Hash code - def hash - [].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(value) - when :Date - Date.parse(value) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :BOOLEAN - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - temp_model = Petstore.const_get(type).new - temp_model.build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/animal_farm_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/animal_farm_spec.rb deleted file mode 100644 index 895781828d2..00000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/animal_farm_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#Swagger Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 -Contact: apiteam@swagger.io -Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.0-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::AnimalFarm -# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen) -# Please update as you see appropriate -describe 'AnimalFarm' do - before do - # run before each test - @instance = Petstore::AnimalFarm.new - end - - after do - # run after each test - end - - describe 'test an instance of AnimalFarm' do - it 'should create an instance of AnimalFarm' do - expect(@instance).to be_instance_of(Petstore::AnimalFarm) - end - end -end diff --git a/samples/openapi3/client/petstore/ruby/spec/models/string_boolean_map_spec.rb b/samples/openapi3/client/petstore/ruby/spec/models/string_boolean_map_spec.rb deleted file mode 100644 index 3f54837a62a..00000000000 --- a/samples/openapi3/client/petstore/ruby/spec/models/string_boolean_map_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -=begin -#OpenAPI Petstore - -#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -OpenAPI spec version: 1.0.0 - -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 3.0.3-SNAPSHOT - -=end - -require 'spec_helper' -require 'json' -require 'date' - -# Unit tests for Petstore::StringBooleanMap -# Automatically generated by openapi-generator (https://openapi-generator.tech) -# Please update as you see appropriate -describe 'StringBooleanMap' do - before do - # run before each test - @instance = Petstore::StringBooleanMap.new - end - - after do - # run after each test - end - - describe 'test an instance of StringBooleanMap' do - it 'should create an instance of StringBooleanMap' do - expect(@instance).to be_instance_of(Petstore::StringBooleanMap) - end - end -end diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/AnimalFarm.java deleted file mode 100644 index ea7ba3a7d13..00000000000 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/AnimalFarm.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.openapitools.model; - -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Animal; -import javax.validation.constraints.*; -import javax.validation.Valid; - -import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import com.fasterxml.jackson.annotation.JsonProperty; - -public class AnimalFarm extends ArrayList { - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/StringBooleanMap.java deleted file mode 100644 index be2e2950ecb..00000000000 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/model/StringBooleanMap.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.openapitools.model; - -import java.util.HashMap; -import java.util.Map; -import javax.validation.constraints.*; -import javax.validation.Valid; - -import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import com.fasterxml.jackson.annotation.JsonProperty; - -public class StringBooleanMap extends HashMap { - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/php-slim/README.md b/samples/server/petstore/php-slim/README.md index c8c96d9a893..9c0e467e273 100644 --- a/samples/server/petstore/php-slim/README.md +++ b/samples/server/petstore/php-slim/README.md @@ -92,7 +92,6 @@ Class | Method | HTTP request | Description * OpenAPIServer\Model\AdditionalPropertiesClass * OpenAPIServer\Model\Animal -* OpenAPIServer\Model\AnimalFarm * OpenAPIServer\Model\ApiResponse * OpenAPIServer\Model\ArrayOfArrayOfNumberOnly * OpenAPIServer\Model\ArrayOfNumberOnly @@ -123,7 +122,6 @@ Class | Method | HTTP request | Description * OpenAPIServer\Model\Pet * OpenAPIServer\Model\ReadOnlyFirst * OpenAPIServer\Model\SpecialModelName -* OpenAPIServer\Model\StringBooleanMap * OpenAPIServer\Model\Tag * OpenAPIServer\Model\User diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs index c0c34329339..3f873a33749 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/client/mod.rs @@ -395,7 +395,7 @@ if let Some(body) = body { .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) .and_then(|body| - serde_json::from_str::(body) + serde_json::from_str::(body) .map_err(|e| e.into()) )) @@ -545,7 +545,7 @@ if let Some(body) = body { .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) .and_then(|body| - serde_json::from_str::(body) + serde_json::from_str::(body) .map_err(|e| e.into()) )) @@ -620,7 +620,7 @@ if let Some(body) = body { .map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e))) .and_then(|body| - serde_json::from_str::(body) + serde_json::from_str::(body) .map_err(|e| e.into()) )) diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs index a3034479d5d..b1fb3e7f5a8 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/lib.rs @@ -48,7 +48,7 @@ pub enum TestSpecialTagsResponse { #[derive(Debug, PartialEq)] pub enum FakeOuterBooleanSerializeResponse { /// Output boolean - OutputBoolean ( models::OuterBoolean ) , + OutputBoolean ( bool ) , } #[derive(Debug, PartialEq)] @@ -60,13 +60,13 @@ pub enum FakeOuterCompositeSerializeResponse { #[derive(Debug, PartialEq)] pub enum FakeOuterNumberSerializeResponse { /// Output number - OutputNumber ( models::OuterNumber ) , + OutputNumber ( f64 ) , } #[derive(Debug, PartialEq)] pub enum FakeOuterStringSerializeResponse { /// Output string - OutputString ( models::OuterString ) , + OutputString ( String ) , } #[derive(Debug, PartialEq)] diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs index 8e3d864a0a4..0daa05e4dbf 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/src/models.rs @@ -51,68 +51,6 @@ impl Animal { } } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct AnimalFarm(Vec); - -impl ::std::convert::From> for AnimalFarm { - fn from(x: Vec) -> Self { - AnimalFarm(x) - } -} - -impl ::std::convert::From for Vec { - fn from(x: AnimalFarm) -> Self { - x.0 - } -} - -impl ::std::iter::FromIterator for AnimalFarm { - fn from_iter>(u: U) -> Self { - AnimalFarm(Vec::::from_iter(u)) - } -} - -impl ::std::iter::IntoIterator for AnimalFarm { - type Item = Animal; - type IntoIter = ::std::vec::IntoIter; - - fn into_iter(self) -> Self::IntoIter { - self.0.into_iter() - } -} - -impl<'a> ::std::iter::IntoIterator for &'a AnimalFarm { - type Item = &'a Animal; - type IntoIter = ::std::slice::Iter<'a, Animal>; - - fn into_iter(self) -> Self::IntoIter { - (&self.0).into_iter() - } -} - -impl<'a> ::std::iter::IntoIterator for &'a mut AnimalFarm { - type Item = &'a mut Animal; - type IntoIter = ::std::slice::IterMut<'a, Animal>; - - fn into_iter(self) -> Self::IntoIter { - (&mut self.0).into_iter() - } -} - -impl ::std::ops::Deref for AnimalFarm { - type Target = Vec; - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl ::std::ops::DerefMut for AnimalFarm { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ApiResponse { #[serde(rename = "code")] diff --git a/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs b/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs index 03a3b955945..a4d5b838c10 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs +++ b/samples/server/petstore/rust-server/output/rust-server-test/src/models.rs @@ -32,18 +32,6 @@ impl ANullableContainer { } } -/// An additionalPropertiesObject -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct AdditionalPropertiesObject { -} - -impl AdditionalPropertiesObject { - pub fn new() -> AdditionalPropertiesObject { - AdditionalPropertiesObject { - } - } -} - #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct InlineObject { #[serde(rename = "id")] diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AnimalFarm.java deleted file mode 100644 index 393968173ac..00000000000 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AnimalFarm.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Animal; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/StringBooleanMap.java deleted file mode 100644 index 42b689e5e22..00000000000 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/StringBooleanMap.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.HashMap; -import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AnimalFarm.java deleted file mode 100644 index 393968173ac..00000000000 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AnimalFarm.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Animal; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/StringBooleanMap.java deleted file mode 100644 index 42b689e5e22..00000000000 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/StringBooleanMap.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.HashMap; -import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AnimalFarm.java deleted file mode 100644 index 393968173ac..00000000000 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AnimalFarm.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Animal; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/StringBooleanMap.java deleted file mode 100644 index 42b689e5e22..00000000000 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/StringBooleanMap.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.HashMap; -import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AnimalFarm.java deleted file mode 100644 index 393968173ac..00000000000 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AnimalFarm.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Animal; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/StringBooleanMap.java deleted file mode 100644 index 42b689e5e22..00000000000 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/StringBooleanMap.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.HashMap; -import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index ddc7c2a0e8f..5f8fd137adb 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -31,8 +31,8 @@ public interface AnotherFakeApiDelegate { */ default Mono> call123testSpecialTags(Mono client, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { result = ApiUtil.getExampleResponse(exchange, "{ \"client\" : \"client\"}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index 3b3f23ccece..7d71fc5afbf 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -40,8 +40,8 @@ public interface FakeApiDelegate { */ default Mono> fakeOuterBooleanSerialize(Mono body, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -51,8 +51,8 @@ public interface FakeApiDelegate { */ default Mono> fakeOuterCompositeSerialize(Mono outerComposite, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { result = ApiUtil.getExampleResponse(exchange, "{ \"my_string\" : \"my_string\", \"my_number\" : 0.80082819046101150206595775671303272247314453125, \"my_boolean\" : true}"); @@ -68,8 +68,8 @@ public interface FakeApiDelegate { */ default Mono> fakeOuterNumberSerialize(Mono body, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -79,8 +79,8 @@ public interface FakeApiDelegate { */ default Mono> fakeOuterStringSerialize(Mono body, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -90,8 +90,8 @@ public interface FakeApiDelegate { */ default Mono> testBodyWithFileSchema(Mono fileSchemaTestClass, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -102,8 +102,8 @@ public interface FakeApiDelegate { default Mono> testBodyWithQueryParams(String query, Mono user, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -113,8 +113,8 @@ public interface FakeApiDelegate { */ default Mono> testClientModel(Mono client, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { result = ApiUtil.getExampleResponse(exchange, "{ \"client\" : \"client\"}"); @@ -143,8 +143,8 @@ public interface FakeApiDelegate { String password, String paramCallback, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -161,8 +161,8 @@ public interface FakeApiDelegate { List enumFormStringArray, String enumFormString, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -177,8 +177,8 @@ public interface FakeApiDelegate { Boolean booleanGroup, Long int64Group, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -188,8 +188,8 @@ public interface FakeApiDelegate { */ default Mono> testInlineAdditionalProperties(Mono requestBody, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -200,8 +200,8 @@ public interface FakeApiDelegate { default Mono> testJsonFormData(String param, String param2, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -213,8 +213,8 @@ public interface FakeApiDelegate { MultipartFile requiredFile, String additionalMetadata, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { result = ApiUtil.getExampleResponse(exchange, "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index bffd475ef6b..bef3cea1a08 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -31,8 +31,8 @@ public interface FakeClassnameTestApiDelegate { */ default Mono> testClassname(Mono client, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { result = ApiUtil.getExampleResponse(exchange, "{ \"client\" : \"client\"}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java index 1606fac281d..3cf894153de 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -33,8 +33,8 @@ public interface PetApiDelegate { */ default Mono> addPet(Mono pet, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -45,8 +45,8 @@ public interface PetApiDelegate { default Mono> deletePet(Long petId, String apiKey, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -56,8 +56,8 @@ public interface PetApiDelegate { */ default Mono>> findPetsByStatus(List status, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { result = ApiUtil.getExampleResponse(exchange, "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); @@ -77,8 +77,8 @@ public interface PetApiDelegate { */ default Mono>> findPetsByTags(List tags, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { result = ApiUtil.getExampleResponse(exchange, "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); @@ -98,8 +98,8 @@ public interface PetApiDelegate { */ default Mono> getPetById(Long petId, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { result = ApiUtil.getExampleResponse(exchange, "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}"); @@ -119,8 +119,8 @@ public interface PetApiDelegate { */ default Mono> updatePet(Mono pet, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -132,8 +132,8 @@ public interface PetApiDelegate { String name, String status, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -145,8 +145,8 @@ public interface PetApiDelegate { String additionalMetadata, MultipartFile file, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { result = ApiUtil.getExampleResponse(exchange, "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java index 8e95e0178b0..30ab1e9d348 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -32,8 +32,8 @@ public interface StoreApiDelegate { */ default Mono> deleteOrder(String orderId, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -42,8 +42,8 @@ public interface StoreApiDelegate { * @see StoreApi#getInventory */ default Mono>> getInventory(ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -53,8 +53,8 @@ public interface StoreApiDelegate { */ default Mono> getOrderById(Long orderId, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { result = ApiUtil.getExampleResponse(exchange, "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); @@ -74,8 +74,8 @@ public interface StoreApiDelegate { */ default Mono> placeOrder(Mono order, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { result = ApiUtil.getExampleResponse(exchange, "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}"); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index 03de7cd2b49..fbfafaaa378 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -32,8 +32,8 @@ public interface UserApiDelegate { */ default Mono> createUser(Mono user, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -43,8 +43,8 @@ public interface UserApiDelegate { */ default Mono> createUsersWithArrayInput(Flux user, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -54,8 +54,8 @@ public interface UserApiDelegate { */ default Mono> createUsersWithListInput(Flux user, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -65,8 +65,8 @@ public interface UserApiDelegate { */ default Mono> deleteUser(String username, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -76,8 +76,8 @@ public interface UserApiDelegate { */ default Mono> getUserByName(String username, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { result = ApiUtil.getExampleResponse(exchange, "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}"); @@ -98,8 +98,8 @@ public interface UserApiDelegate { default Mono> loginUser(String username, String password, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -108,8 +108,8 @@ public interface UserApiDelegate { * @see UserApi#logoutUser */ default Mono> logoutUser(ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } @@ -120,8 +120,8 @@ public interface UserApiDelegate { default Mono> updateUser(String username, Mono user, ServerWebExchange exchange) { - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); Mono result = Mono.empty(); + exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); return result.then(Mono.empty()); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AnimalFarm.java deleted file mode 100644 index 393968173ac..00000000000 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AnimalFarm.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Animal; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/StringBooleanMap.java deleted file mode 100644 index 42b689e5e22..00000000000 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/StringBooleanMap.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.HashMap; -import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AnimalFarm.java deleted file mode 100644 index 393968173ac..00000000000 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AnimalFarm.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Animal; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/StringBooleanMap.java deleted file mode 100644 index 42b689e5e22..00000000000 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/StringBooleanMap.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.HashMap; -import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AnimalFarm.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AnimalFarm.java deleted file mode 100644 index 225ae3beb87..00000000000 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AnimalFarm.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.virtualan.model; - -import java.util.Objects; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.virtualan.model.Animal; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/StringBooleanMap.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/StringBooleanMap.java deleted file mode 100644 index 095b736ebbc..00000000000 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/StringBooleanMap.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openapitools.virtualan.model; - -import java.util.Objects; -import java.util.HashMap; -import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalFarm.java deleted file mode 100644 index 393968173ac..00000000000 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AnimalFarm.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Animal; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/StringBooleanMap.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/StringBooleanMap.java deleted file mode 100644 index 42b689e5e22..00000000000 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/StringBooleanMap.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openapitools.model; - -import java.util.Objects; -import java.util.HashMap; -import java.util.Map; -import javax.validation.Valid; -import javax.validation.constraints.*; - -/** - * StringBooleanMap - */ - -public class StringBooleanMap extends HashMap { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class StringBooleanMap {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} -